Re: Manually adding points/values in NCL script

From: Gerry Creager <gerry.creager_at_nyahnyahspammersnyahnyah>
Date: Wed, 16 Apr 2008 07:18:34 -0500

William,

What is the origin of your dataset (before it goes into the database)?
METAR? MADIS? Carrier pigeon with paper datasets?

The first two are amenable to pretty easy machine processing if the
original datasets are around, while the third is easier once it's into a
database.

Having said that, creating a CSV-type file from the database with the
appropriate info is one of the file formats NCL should be able to handle.

(Aside to Mary: Getting a more or less standard SQL interface might be
cool for NCL)

Otherwise, creating a netcdf via script which gets data using SQL is
pretty straightforward, using NCO.

gerry

valkhorn_at_aol.com wrote:
> Let me see if I can find a graphic example of what I want:
>
> http://www.ncl.ucar.edu/Applications/Scripts/native_3.ncl
>
> I have data for hundreds of stations for highs, lows, precip, snowfall,
> etc. I want to generate a map that looks like that (although not rotated
> slightly to the right) that gives me high, low, precip, etc. maps for
> each day that I have data.
>
> I want a map to look like that, but I want to ability to manually add
> points line by line and not by using an external ASCII file.
>
> In the example above how would I change it to manually add the points
> one by one by one, line by line instead of an array, using latitude and
> longitude?
>
> Also does it get just the data from the .grb file or does it get the map
> info from there too?
>
> Does that clarify it a bit?
>
> -William
>
>
>
> -----Original Message-----
> From: Mary Haley <haley_at_ucar.edu>
> To: valkhorn_at_aol.com
> Cc: ncl-talk_at_ucar.edu
> Sent: Tue, 15 Apr 2008 5:16 pm
> Subject: Re: Manually adding points/values in NCL script
>
> Hi,
>
> Sorry for the lack of response. I'm still trying to figure out what
> you want. You said you want to write a script that generates an NCL
> script into a file that you run later. This is a bit confusing
> because it sounds like you are talking about three executable scripts
> here.
>
> I guess the way I would do this is write a big script, like a C-shell
> or Python script that is capable of reading and/or processing the SQL
> databases into a format that NCL can handle, like a simple ASCII file,
> or maybe even a NetCDF file.
>
> You can then have this script either generate an NCL script on the
> fly, or else have an NCL script already written that takes command
> line arguments to intialize things, like what the name of your data
> files are, how many points you have, etc. For information on
> command line options, see:
>
> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclCLO.shtml
>
> These can really come in handy when you need to write
> a generic NCL script, and pass it values from another script.
>
> This NCL script can be set up to write the graphical output to a PS or
> PDF file that will be saved.
>
> I think the hardest part will be figuring out how to get the data from
> the SQL database into something NCL can read. I don't have experience
> with this, but perhaps somebody else can jump in here.
>
> --Mary
>
>
> On Tue, 15 Apr 2008 valkhorn_at_aol.com <mailto:valkhorn_at_aol.com> wrote:
>
> > I posted this a few days ago but still haven't gotten a response. I
> have a very large SQL database of weather data and I was hoping to
> produce contoured weather maps with this data.
> >
> > Of course NCL doesn't interface with SQL, so what I wanted to do is
> write a script that automatically generates the NCL script into a file
> that I can run later but which adds all of the points I need and
> generates the image.
> >
> > In general, this is what I hope to do just to clarify what I'm asking:
> >
> > ncl script generation script:
> > -----------------------------
> > Write the script to a .ncl which does the following {
> > ??? Initialize graph
> > ??? Pull all data from SQL tables and add each point manually in a loop
> > ??? Plot points
> > ??? Save graph
> > }
> >
> > Then batch run the script generator for the days I need.
> >
> > In pseudocode, what I'm looking for is something like
> >
> > AddPoint(latitude, longitude, value);
> > AddPoint(latitude, longitude, value);
> >
> > Can anyone help me out? Thanks!
> >
> > -William
> >
> ------------------------------------------------------------------------
> Get the MapQuest Toolbar
> <http://www.mapquest.com/toolbar?NCID=mpqmap00030000000003>, Maps,
> Traffic, Directions & More!
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Gerry Creager -- gerry.creager_at_tamu.edu
Texas Mesonet -- AATLT, Texas A&M University	
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
Office: 1700 Research Parkway Ste 160, TAMU, College Station, TX 77843
Received on Wed Apr 16 2008 - 06:18:34 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 23 2008 - 12:56:49 MDT