Re: passing arguments, contouring

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 14 2013 - 09:32:31 MDT

On Jun 11, 2013, at 2: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?

Have you tried contouring the data directly, rather than putting it on a grid?

It would help if you could show us some sample images.

> 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.

It would help if we could see a sample file and script that you've written so far.
As Jonathan Vigh pointed out, there are different methods for reading ascii
files, but it just depends on what your file looks like. If you have a mix of data
and numbers, then I usually find the str_get_field and str_get_cols functions
to be the best way of reading in columnar data. I use str_get_field if the data
is separated by some delimiter, like a comma. I use str_get_cols if the data
are in perfectly lined up columns, which can be specified by column numbers.

If you can provide your file and script, then you can use our ftp site:

> 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.

Can you give an example of which page is not printing out properly? One issue might be
that you need to click on the page you want to print, to make sure you are printing the
text you want, and not the header information.


> Jeremy
> --
> “What is wanted is not the will to believe,
> but the wish to find out, which is its exact opposite”
> ... Bertrand Russell
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Jun 14 09:32:43 2013

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