Re: Define a specific directory for plots

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 28 2011 - 11:35:23 MDT

Xin,

There are several good ways. You must add a few lines of code to
each script. Here are two methods that I use a lot. Create the
output directory by hand, before starting.

1. Define plot directory in each script. This makes it easy to
have different output directories for different projects, if you
would like to do that.

   plot_dir = "out/" ; dir inside current dir
   plot_dir = "/home/username/plots/" ; or use absolute path
   outfile = plot_dir + "plotname1"
   wks = gsn_open_wks ("pdf", outfile)

2. Make your own environment variable.

Before running NCL, or in a system startup file, set an environment
variable:

   setenv PLOTS /home/username/plots/

In NCL script:

   outfile = "$PLOTS/plotname1"
   wks = gsn_open_wks ("pdf", outfile)

--Dave

On 9/27/2011 7:31 PM, Xin Xi wrote:
> Hi, all
> I am wondering is there a simpler way to define a directory
> specifically for all generated plots, rather than define it in the
> scripts? by default all plots are output to the same directory as
> the scripts, such that the directory gets messy with time...
> Thanks,
> Xin
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 28 11:35:24 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 09 2011 - 13:05:26 MDT