Re: passing arguments, contouring

From: Jonathan Vigh <jvigh_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 11 2013 - 15:50:45 MDT

Hi Jeremy,

Welcome to NCL. I think I can help with a couple of your questions.

Regarding automation and command line options, see:

There are ways to read in ASCII files with headers and mixed formats. These
typically involve reading the entire file as one array of strings (one
for each line)
using asciiread. Figure out how many lines the header takes up and then
the remaining lines using functions like str_get_fields or str_get_cols.

The following example illustrates how to do this for space delimited
formatted files:

Some of the other examples on that page illustrate how to read files
with fixed
columns or stranger cases.

Hope this helps,

On 06/11/2013 08:32 PM, Jeremy Winick wrote:
> I am trying to learn ncl as a long time matlab user who is retired and
> cannot afford new licenses.
> My first problem I am attempting is plotting contours of satellite
> retrieved data on map projections.
> I have gotten this to work to some extent, but want to automate the
> process and don't see how to do it efficiently. The data comes from limb
> retrievals of satellite passes, 15 orbits per day. At least one day is
> needed to get the longitudinal coverage, and sometimes two or three days
> will help fill in more points.
> To contour temperature at some altitude or pressure level, using
> gsn_csm_contour_map_polar I am currently using natgrid to put the
> temperature data at each lat, lon point on a uniform grid. Then after
> setting, units, named dimensions and coordinate variables I can get the
> plot. With one day of data these contours often have some "non-smooth"
> features. Is there a way to get smoother contours or better griding.
> Note that these temperature points are measured at different times and
> maybe getting a grid should not just use nearest neighbor type methods
> but is there a way to weight points by how far apart in time?
> Now, to the problem of automating. All the examples I see on the web
> pages surely don't fit my type of need. The data opened in the script
> uses a specific name. My data is data that has already been analyzed and
> it in large ascii files - column format. Although all columns are not
> numeric, readAsciiTable seems to work although the column of the data
> that are not numeric (say dates in Feb12 type format) are not usable. I
> want to tell the script what the file to open (changing from run to run
> or incorporated in an csh-shell or bourne shell script, and also pass
> which days, and which column (temperature at one of a few levels).
> Setting enumerable environment variables seems like an awkward solution.
> Passing these as command line arguments would be very nice (like in
> matlab), but I haven't seen that this is possible. My work around now
> would be to open a fixed name file that I read in the script and change
> it each run to change these important parameters. I think I must be
> missing something that is basic, since my problem doesn't seem to be
> unusual.
> One other complaint is that the web page support when viewed on Firefox
> 20.0 does not print correctly. Only the first page (and not even all of
> it) prints. I know these pages are designed for online work, but having
> ten or more open at a time and going back to just one or two, it would
> be easier to have those two printed out.
> Jeremy

Jonathan Vigh						
Project Scientist I, Joint Numerical Testbed	
Research Applications Laboratory (RAL)
National Center for Atmospheric Research (NCAR)
P.O. Box 3000            tel: +1 303 497 8205
Boulder, CO 80307-3000   fax: +1 (303) 497-8171
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Jun 11 15:50:57 2013

This archive was generated by hypermail 2.1.8 : Mon Jun 24 2013 - 11:46:47 MDT