[Thread Prev][Thread Next][Index]

Re: plotting global attributes



Hi Claire,

You can condense the syntax that Bill has proposed using the "SPAWN" directive inside of the definition of a string variable.  See Ch7 Sec2.10. in the
Ferret Users Guide.  An example is:

     LET my_string = {SPAWN:"ls *.nc"}

In place of "ls *.nc" can you insert a Unix command (grep and sed) to extract the names of your global attributes in a predictable order?

    - steve

================================================

"Gustafson, William I" wrote:

> Claire,
>
> This is one of those things that I wish Ferret could do easily too. Here is my work around. I think I got it from the ferret_users archive if you want
> more information on it. I found the syntax a bit finicky. In my example, I need to get some map info from a WRF file so that I can rotate the wind
> components. The name of the data file is passed as the script argument and then assigned to a symbol name as shown here. This works great
> except when using descriptor files for the data set. Then, you have to track the actual filename being used by the descriptor. Here is the
> relevant part of the code:
>
> def sym datafile "$1"
> sp echo def sym mapproj \"\`ncdump -h ($datafile) | grep MAP_PROJ | tr -d :MAP_PROJ\ = | tr -d f\\;\`\" > rotateuv.tmp.jnl
> sp echo def sym cenlon \"\`ncdump -h ($datafile) | grep CEN_LON | tr -d :CEN_LON\ = | tr -d f\\;\`\" >> rotateuv.tmp.jnl
> sp echo def sym cenlat \"\`ncdump -h ($datafile) | grep CEN_LAT | grep -v MOAD_CEN_LAT | tr -d :CEN_LAT\ = | tr -d f\\;\`\" >> rotateuv.tmp.jnl
> go rotateuv.tmp.jnl
> sp rm rotateuv.tmp.jnl
>
> Hope this helps.
>
> -Bill
> _______________________________________
> William I. Gustafson Jr., Ph.D.
> Pacific Northwest National Laboratory
> P.O. Box 999, MSIN K9-30
> Richland, WA 99352, USA
> Voice & Msg: (509)372-6110
> FAX: (509)372-6168
> http://www.pnl.gov/atmos_sciences

--
º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤º¤ø,¸¸,ø¤º

Steve Hankin, NOAA/PMEL -- Steven.C.Hankin@noaa.gov
7600 Sand Point Way NE, Seattle, WA 98115-6349
ph. (206) 526-6080, FAX (206) 526-6744



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement