[gradsusr] gradsusr Digest, Vol 8, Issue 33

Brian.Hoeth at noaa.gov Brian.Hoeth at noaa.gov
Wed Oct 20 14:03:12 EDT 2010


Jennifer,

Your suggestions worked, thank you very much!

Brian Hoeth
NWS Spaceflight Meteorology Group
Johnson Space Center
Houston, TX
281-483-3246

----- Original Message -----
From: gradsusr-request at gradsusr.org
Date: Wednesday, October 20, 2010 10:46 am
Subject: gradsusr Digest, Vol 8, Issue 33
To: gradsusr at gradsusr.org


> Send gradsusr mailing list submissions to
>  	gradsusr at gradsusr.org
>  
>  To subscribe or unsubscribe via the World Wide Web, visit
>  	
>  or, via email, send a message with subject or body 'help' to
>  	gradsusr-request at gradsusr.org
>  
>  You can reach the person managing the list at
>  	gradsusr-owner at gradsusr.org
>  
>  When replying, please edit your Subject line so it is more specific
>  than "Re: Contents of gradsusr digest..."
>  
>  
>  Today's Topics:
>  
>     1. Re: Trouble displaying data from netcdf file (Jennifer Adams)
>     2. spatial plot form a time series of multiple stations
>        (Thomas W. Collow)
>     3. Re: CDIFF Versus HDIVG? (Eric Altshuler)
>     4. Re: Visualize Wind Vectors (Nena Carina Espa?ola)
>     5. cdiff function (Adrian Scherzinger)
>     6. Re: cdiff function (Jeffrey Duda)
>  
>  
>  ----------------------------------------------------------------------
>  
>  Message: 1
>  Date: Tue, 19 Oct 2010 16:44:19 -0400
>  From: Jennifer Adams <jma at cola.iges.org>
>  Subject: Re: [gradsusr] Trouble displaying data from netcdf file
>  To: GrADS Users Forum <gradsusr at gradsusr.org>
>  Message-ID: <83639431-6BF9-4621-99DA-9F2FB4479837 at cola.iges.org>
>  Content-Type: text/plain; charset="us-ascii"
>  
>  In the ncdump output, you have this:
>        float mslp(record, levels_1, y, x) ;
>  
>  which means the variable has 4 dimensions, so you need to change your 
>  
>  variable declaration in the descriptor file from
>        mslp=>mslp 1 Y,X Mean Sea Level Pressure (Pa)
>  to
>        mslp=>mslp 1 t,z,y,x Mean Sea Level Pressure (Pa)
>  
>  Similar changes may be required for other variables. Also, it isn't  
> 
>  necessary to alias the variable name to the identical thing. The  
>  native varname is compliant with GrADS requirements, so you can 
> change  
>  "mslp=>mslp" to just "mslp".
>  
>  --Jennifer
>  
>  On Oct 19, 2010, at 3:00 PM, Brian.Hoeth at noaa.gov wrote:
>  
>  > Hello,
>  >
>  > I'm having troubles displaying data from a netcdf file.  I'm sure  
> 
>  > there is an error in my index file, but I just don't know what I'm  
> 
>  > missing?
>  >
>  > I've attached the output of ncdump -c (ncdump.txt), my control file 
>  
>  > (adas_ncdf.ctl), and my grads session (gradsout.txt).
>  >
>  > Thanks in advance for your help!>  > Brian Hoeth
>  > NWS Spaceflight Meteorology Group
>  > Johnson Space Center
>  > Houston, TX
>  > 281-483-3246
>  >

>  >
>  >
>  >
>  > < 
>  > adas_ncdf 
>  > .ctl 
>  > > 
>  > < 
>  > gradsout 
>  > .txt><ncdump.txt>_______________________________________________
>  > gradsusr mailing list
>  > gradsusr at gradsusr.org
>  > 
>  
>  --
>  Jennifer M. Adams
>  IGES/COLA
>  4041 Powder Mill Road, Suite 302
>  Calverton, MD 20705
>  jma at cola.iges.org
>  
>  
>  
>  -------------- next part --------------
>  An HTML attachment was scrubbed...
>  URL:  
>  
>  ------------------------------
>  
>  Message: 2
>  Date: Tue, 19 Oct 2010 16:55:45 -0400 (EDT)
>  From: "Thomas W. Collow" <tcollow at eden.rutgers.edu>
>  Subject: [gradsusr] spatial plot form a time series of multiple
>  	stations
>  To: gradsusr at gradsusr.org
>  Message-ID: <209816879.4383.1287521744847.JavaMail.tomcat at aveo>
>  Content-Type: text/plain; charset=ISO-8859-1
>  
>  I asked a similar question awhile back but perhaps did not make it 
> clear enough what I am trying to do.
>  
>  I have several ARM/CART files for soil moisture data for about 12 
> different stations over the central USA.  Each file is a netcdf file 
> for 24 different times (every hour for one day).  I am able to 
> template each of the files that are for the same station to make a 
> time series say over one month.  So for each of the 12 different 
> stations I can make a monthly time series.  What I would like to do is 
> create a spatial plot of this data which would involve me taking one 
> point from each of the 12 files and plotting it on a single map in 
> GrADS.  Each point would have a different latitude and longitude 
> depending on the file but it would be at the same time.  I have 
> created a control file for each station which allows me to display the 
> station time series in GrADS using the xdfopen command.  The command 
> sdfopen did not work in opening the control file.  Also there was no 
> latitude/ longitude dimension, only time and depth.  The latitude and 
> longitude are known and are put in for the y!
>   def and xdef parameters respectively.
>  
>  Here is a control file for opening the time series of one station (ARM_E4)
>  
>  DSET ^ARM_files/sgpswatsE4.b1.201008%d2.000700.cdf
>  OPTIONS template
>  OPTIONS zrev
>  TITLE ARM Data
>  UNDEF -9999
>  XDEF time 01 levels -98.329
>  YDEF time 01 levels 37.953
>  ZDEF depth 8 levels 175 125 85 60 35 25 15 5
>  TDEF time 720 linear 00Z01aug2010 1hr
>  VARS 2
>  watcont_W=>smw 8 99 water content west
>  watcont_E=>sme 8 99 water content east
>  ENDVARS
>  
>  For station E9 (ARM_E9)
>  DSET ^ARM_files/sgpswatsE9.b1.201008%d2.000700.cdf
>  OPTIONS template
>  OPTIONS zrev
>  TITLE ARM Data
>  UNDEF -9999
>  XDEF time 01 levels -97.266
>  YDEF time 01 levels 37.133
>  ZDEF depth 8 levels 175 125 85 60 35 25 15 5
>  TDEF time 720 linear 00Z01aug2010 1hr
>  VARS 2
>  watcont_W=>smw 8 99 water content west
>  watcont_E=>sme 8 99 water content east
>  ENDVARS
>  
>  This is one approach I took, here is a GrADS script I tried to use to 
> plot these two stations on a spatial map.
>  
>  reinit
>  set mpdset hires
>  xdfopen ARM_E4
>  xdfopen ARM_E9
>  set lat 25 45
>  set lon -105 -85
>  set T 1
>  set z 8
>  set gxout grfill
>  d smw
>  d smw.2
>  
>  
>  However, all this did was plot two points on a map in the right 
> locations but GrADS is treating them as entirely different variables 
> and it seems two maps were made with one map on top of the other.  
> Therefore it looks like one map but it really isn?t.  How do I treat 
> these as one variable on one map for two or more stations?  Thanks
>  
>  Tom
>  
>  
>  
>  ------------------------------
>  
>  Message: 3
>  Date: Tue, 19 Oct 2010 19:58:16 -0400 (EDT)
>  From: Eric Altshuler <ela at cola.iges.org>
>  Subject: Re: [gradsusr] CDIFF Versus HDIVG?
>  To: GrADS Users Forum <gradsusr at gradsusr.org>
>  Message-ID:
>  	<1541734297.2667.1287532696811.JavaMail.root at mail.iges.org>
>  Content-Type: text/plain; charset=utf-8
>  
>  Hello Robert,
>  
>  Your expressions for du and dv are incorrect for calculating 
> divergence. I assume you copied the expressions from the grads 
> documentation page for cdiff, where an example is presented for 
> calculating vorticity. However, the expressions are different when 
> calculating divergence. Use the following:
>  
>  du = cdiff(ugrdprs,x)
>  dv = cdiff(vgrdprs*cos(lat*3.1416/180),y)
>  
>  I based these expressions on the formula for divergence in spherical 
> coordinates given in Holton's book, in the appendix on vector analysis 
> (I have the 4th edition, but older editions should have the same appendix).
>  
>  As an aside, I think it's possible to obtain more accurate 
> approximations for divergence and vorticity than those given in the 
> grads documentation, because the factor cos(lat) can be taken outside 
> the derivative operator and differentiated analytically rather than 
> using finite differencing. Using the product rule of differentiation 
> and a bit of algebra, I have derived the following sequence of 
> calculations for these quantities (my definitions of intermediate 
> quantities are different, but the end result is the same):
>  
>  pi=3.14159265359
>  dtr=pi/180
>  a=6.371e6
>  dx=a*cos(dtr*lat)*dtr*cdiff(lon,x)
>  dy=a*dtr*cdiff(lat,y)
>  div=cdiff(u,x)/dx+cdiff(v,y)/dy-v*tan(dtr*lat)/a
>  vor=cdiff(v,x)/dx-cdiff(u,y)/dy+u*tan(dtr*lat)/a
>  def1=cdiff(u,x)/dx-cdiff(v,y)/dy-v*tan(dtr*lat)/a
>  def2=cdiff(v,x)/dx+cdiff(u,y)/dy+u*tan(dtr*lat)/a
>  
>  In these formulas, substitute your wind variable names for u and v. 
> In addition to divergence and vorticity, there are also calculations 
> of the components of deformation, def1 and def2, and total deformation 
> is equal to mag(def1,def2). These formulas (in terms of continuous 
> fields) can also be found in Bluestein (1992), "Synoptic-Dynamic 
> Meteorology in Midlatitudes", Vol. I, p. 111.
>  
>  Best regards,
>  
>  Eric L. Altshuler
>  Assistant Research Scientist
>  Center for Ocean-Land-Atmosphere Studies
>  4041 Powder Mill Road, Suite 302
>  Calverton, MD 20705-3106
>  USA
>  
>  E-mail: ela at cola.iges.org
>  Phone: (301) 902-1257
>  Fax: (301) 595-9793
>  
>  ----- Original Message -----
>  From: "Robert N LeeJoice" <rnleejoi at nps.edu>
>  To: gradsusr at gradsusr.org
>  Sent: Tuesday, October 19, 2010 3:27:26 PM
>  Subject: [gradsusr] CDIFF Versus HDIVG?
>  
>  
>  I was wondering if there is a difference in the differencing scheme 
> between CDIFF and HDIVG. I ask because I did a modified example from 
> the documentation, i.e., divergence vice vorticity. The documentation 
> states that CDIFF uses centered differencing. HDIVG says the same. The 
> images suggest something else unless I?m missing something. 
>  
>  CDIFF file 
>  if(var='DIV') 
>  'run bluewhitered.gs -2.0 .5 10' 
>  'define dv = cdiff(vgrdprs,x)' 
>  'define dx = cdiff(lon,x)*3.1416/180' 
>  'define du = cdiff(ugrdprs*cos(lat*3.1416/180),y)' 
>  'define dy = cdiff(lat,y)*3.1416/180' 
>  'display (du/dx+dv/dy)*1e5/(6.37e6*cos(lat*3.1416/180))' 
>  'run cbarn.gs 0.8 1 10.4 4.7' 
>  endif 
>  
>  HDIVG file 
>  if(var='DIV') 
>  'run bluewhitered.gs -2.0 .5 10' 
>  'd 1e5*hdivg(ugrdprs,vgrdprs)' 
>  'run cbarn.gs 0.8 1 10.4 4.7' 
>  Endif 
>  
>  Here are the images in order... 
>  
>  Thank you for any comments, 
>  
>  Robert LeeJoice 
>  PhD Candidate, Naval Postgraduate School 
>  
>  _______________________________________________
>  gradsusr mailing list
>  gradsusr at gradsusr.org
>  
>  
>  
>  
>  ------------------------------
>  
>  Message: 4
>  Date: Wed, 20 Oct 2010 13:41:09 +0800
>  From: Nena Carina Espa?ola <nena at asti.dost.gov.ph>
>  Subject: Re: [gradsusr] Visualize Wind Vectors
>  To: GrADS Users Forum <gradsusr at gradsusr.org>
>  Message-ID: <4CBE80F5.9000303 at asti.dost.gov.ph>
>  Content-Type: text/plain; charset="utf-8"
>  
>    Hi Daniele,
>  
>  Thanks for the help.
>  
>  I am still figuring out how to convert my station data into GrADS 
> binary 
>  as I am very new to GrADS. I already posted my problem yesterday but 
> 
>  nobody has answered it yet. 
>  
>  
>  I do not know how to create a binary with more than one surface 
>  variable. I was able to create a binary for one variable only and 
> most 
>  examples I find use only one variable. Now I have three, and data is 
> 
>  hourly. Here's a sample:
>  YEAR    MO    DA    HO    STNID    LATITUDE     LONGITUDE     
> PRESSURE  
>  DIR    SPEED
>  2010    09    08    08    98132    20.800283    121.847534    1012.3  
>   
>  160    12
>  2010    09    08    08    98133    19.283147    121.463012    1008.5  
>   
>  120    8
>  2010    09    08    08    98134    20.454293    121.963806    1009.2  
>   
>  140    12
>  2010    09    08    08    98222    17.582765    120.387268    1008.1  
>   
>  220    4
>  2010    09    08    08    98223    18.185845    120.58239     1006.6  
>   
>  250    10
>  2010    09    08    08    98232    18.360782    121.658935    1009.5  
>   
>  90     4
>  2010    09    08    08    98233    17.629364    121.70288     1008.1  
>   
>  0      0
>  2010    09    08    08    98324    15.328294    119.980087    1007.2  
>   
>  270    2
>  2010    09    08    08    98325    16.051192    120.333195    1007.3  
>   
>  360    4
>  2010    09    08    08    98327    16.607768    121.265259    1007.5  
>   
>  190    4
>  
>  Thanks again. :-)
>  
>  
>  On Friday, 15 October, 2010 05:52 PM, Daniele Gandini wrote:
>  > Hi Nena.
>  >
>  > Here a simple formula to have U and V in m/s from wind speed (velv) 
> and direction (dirv):
>  >
>  >   'set gxout barb'
>  >   'd -velv*cos((dirv-90)/180*3.14);-velv*cos(dirv/180*3.14)'
>  >
>  > To display these data with OACRES function first you must create a 
> base grid file
>  > with a "dummy" constant value for example and then you can 
> interpolate wind data:
>  >
>  >    'vel=oacres(dummy.1,velv.2,4,3,3,1)'
>  >    'd vel'
>  >    'run cbarn.gs'
>  >
>  > Good luck.
>  >
>  > Daniele
>  >
>  > ----- Messaggio originale -----
>  > Da: "Nena Carina Espa?ola"<nena at asti.dost.gov.ph>
>  > A: "GrADS Users Forum"<gradsusr at gradsusr.org>
>  > Inviato: Venerd?, 15 ottobre 2010 5:32:26
>  > Oggetto: [gradsusr] Visualize Wind Vectors
>  >
>  >
>  > Hello Guys!
>  >
>  > I am trying to create a visualization of the wind vectors. I am not 
> sure where to begin as my data is not split into U and V components. 
> Here's a snippet of the sample data I have. These are from 24 weather 
> stations in the Philippines. Can I also interpolate these scattered 
> data to create a gridded data using the OACRES function?
>  >
>  >
>  >
>  > 	Station ID 	Latitude 	Longitude 	Wind Speed (m/s) 	Wind Direction 
> (degrees)
>  > 	12 	15.721279 	121.522293 	0.8 	204
>  > 	70 	7.135233 	124.814758 	2.21 	148
>  > 	72 	6.960916 	126.212082 	6.34 	286
>  > 	73 	9.282162 	123.244572 	9.6 	20
>  > 	74 	8.997093 	124.883595 	1.54 	85
>  > 	75 	9.217067 	124.713134 	3.84 	89
>  > Thanks,
>  >
>  > Nena
>  >
>  >
>  
>  -- 
>  *GRID OPERATIONS TEAM*
>  Advanced Science & Technology Institute
>  Department Of Science & Technology
>  ASTI Bldg., C.P. Garcia Ave., Technology Park Complex
>  U.P. Campus, Diliman, Quezon City, PHILIPPINES 1101
>  Tel No: +63 2 4269760
>  Email: nena at asti.dost.gov.ph <>
>  -------------- next part --------------
>  An HTML attachment was scrubbed...
>  URL:  
>  
>  ------------------------------
>  
>  Message: 5
>  Date: Wed, 20 Oct 2010 15:18:30 +0200
>  From: Adrian Scherzinger <adrian.scherzinger at meteotest.ch>
>  Subject: [gradsusr] cdiff function
>  To: gradsusr at gradsusr.org
>  Message-ID: <4CBEEC26.2020009 at meteotest.ch>
>  Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>  
>    Hi
>  I am looking for a function similar to cdiff, BUT instead of
>  "The result value at each grid point is the value at the grid point 
> plus 
>  one minus the value at the grid point minus one."
>  i need a funktion that calculates:
>  "The result value at each grid point is the value at the grid point 
>  minus the value at the grid point minus one."
>  
>  This is my problem:
>  Each timestep of my mm5 precipitation data set contains the integral 
> of 
>  the precipitation since t=1. I want to plot a bar graph with the 
>  precipitation of each hour (not the integral). If I want to get the 
>  value only at time X, I need to calculate (rain at t=x)-(rain at t=x-1).
>  cdiff(rain,t) is not the solution.
>  
>  Thanks for your help
>  Adrian
>  
>  -- 
>  ___________________________
>  Adrian Scherzinger
>  Stv. Leiter Wetterprognosen
>  
>  Genossenschaft METEOTEST
>  Fabrikstrasse 14, CH-3012 Bern
>  Tel +41 (0)31 307 26 26
>  Fax +41 (0)31 307 26 10
>  adrian.scherzinger at meteotest.ch
>  
>  
>  ********************************************************************
>  0900 57 61 52 (CHF 3.13/Min) im direkten Dialog mit dem Prognostiker
>  METEOFON - das pers?nliche Wettertelefon von METEOTEST (05-18 Uhr)
>  ********************************************************************
>  
>  
>  
>  ------------------------------
>  
>  Message: 6
>  Date: Wed, 20 Oct 2010 10:40:06 -0500
>  From: Jeffrey Duda <jdduda at iastate.edu>
>  Subject: Re: [gradsusr] cdiff function
>  To: GrADS Users Forum <gradsusr at gradsusr.org>
>  Message-ID:
>  	<AANLkTiku13b3nOh64Vq2VzhuFcN8GbW8LOgfpw0dNuDs at mail.gmail.com>
>  Content-Type: text/plain; charset="iso-8859-1"
>  
>  Adrain,
>  Indeed, the CDIFF function won't help you here, but it sounds like 
> you have
>  answered your own question.  All you need to do is (quoted from your
>  message): "(rain at t=x)-(rain at t=x-1)" and almost in that exact syntax.
>  Whatever your "rain" variable is called (I'll call it "rain" in this
>  example), just do 'd rain(t=x) - rain(t=x-1)', or if you want to do this
>  over a range of values, do either
>  
>  'set t t1 t2'
>  'd tloop(rain-rain(t-1))'
>  
>  OR
>  
>  'set t t1 t2'
>  'define rainvariable = rain-rain(t-1)'
>  'd rainvariable'
>  
>  That should work.
>  
>  Jeff Duda
>  
>  On Wed, Oct 20, 2010 at 8:18 AM, Adrian Scherzinger <
>  adrian.scherzinger at meteotest.ch> wrote:
>  
>  >  Hi
>  > I am looking for a function similar to cdiff, BUT instead of
>  > "The result value at each grid point is the value at the grid point 
> plus
>  > one minus the value at the grid point minus one."
>  > i need a funktion that calculates:
>  > "The result value at each grid point is the value at the grid point
>  > minus the value at the grid point minus one."
>  >
>  > This is my problem:
>  > Each timestep of my mm5 precipitation data set contains the 
> integral of
>  > the precipitation since t=1. I want to plot a bar graph with the
>  > precipitation of each hour (not the integral). If I want to get the
>  > value only at time X, I need to calculate (rain at t=x)-(rain at t=x-1).
>  > cdiff(rain,t) is not the solution.
>  >
>  > Thanks for your help
>  > Adrian
>  >
>  > --
>  > ___________________________
>  > Adrian Scherzinger
>  > Stv. Leiter Wetterprognosen
>  >
>  > Genossenschaft METEOTEST
>  > Fabrikstrasse 14, CH-3012 Bern
>  > Tel +41 (0)31 307 26 26
>  > Fax +41 (0)31 307 26 10
>  > adrian.scherzinger at meteotest.ch
>  > 
>  >
>  > ********************************************************************
>  > 0900 57 61 52 (CHF 3.13/Min) im direkten Dialog mit dem Prognostiker
>  > METEOFON - das pers?nliche Wettertelefon von METEOTEST (05-18 Uhr)
>  > ********************************************************************
>  >
>  > _______________________________________________
>  > gradsusr mailing list
>  > gradsusr at gradsusr.org
>  > 
>  >
>  
>  
>  
>  -- 
>  Jeff Duda
>  Iowa State University
>  Meteorology Graduate Student
>  3134 Agronomy Hall
>  www.meteor.iastate.edu/~jdduda
>  -------------- next part --------------
>  An HTML attachment was scrubbed...
>  URL:  
>  
>  ------------------------------
>  
>  _______________________________________________
>  gradsusr mailing list
>  gradsusr at gradsusr.org
>  
>  
>  
>  End of gradsusr Digest, Vol 8, Issue 33
>  *************************************** 



More information about the gradsusr mailing list