[gradsusr] Help on displaying NetCDF data with Grads.

Anil Kumar Sharma aanil649 at gmail.com
Wed Jan 29 05:11:03 EST 2014


Many thanks for reply Kieren !!!

Although your reply solved the problem for displaying complete data in a
single plot with center at POINT(0,0), but I wished to plot it by using a
single "display" command probably by manipulating data-set to behave to our
requirement. is that possible ?

*Thanks & Regards*

*Anil Kumar*




On Tue, Jan 28, 2014 at 2:43 PM, Marsh, Kieren <k.marsh at geos-uae.com> wrote:

> You need to have a second plot command in your script with longitude set
> to cover the remainder of the chart:
>
>
>
> Try adapting this into your plotting commands:
>
>
>
> * Set chart longitude extremes
>
> *-------------------------------------
>
> Lon1 = -180;* west longitude extreme of your plotting area
>
> Lon2 = 180;* east longitude extreme of your plotting area
>
>
>
> *Set longitude environment
>
> *----------------------------------
>
> 'set lon 'Lon1' 'Lon2
>
>
>
> * if your east extreme is on or east of 74.16 this will plot
>
> * everything from 74.16 to Lon2 (i.e.what you have now)
>
>
> *-------------------------------------------------------------------------------
>
> If(Lon2 >= 74.16)
>
> 'd skip(u_velocity*1.95,50,50);v_velocity*1.95'
>
> endif
>
>
>
> *Set new variables shifting your longitude domain round by 360 degrees
>
>
> *----------------------------------------------------------------------------------------
>
> Lona = Lon1 + 360
>
> Lonb = Lon2 + 360
>
>
>
> *If your west extreme is to the west of 74.16 it will use the new shifted
> domain
>
> *and plot everything up to 434.062
>
> *You may get a thin meridional line on the chart at 74.16 in
> contoured/shaded plots by doing this
>
> *You can attempt to remove this line by using the const function when
> plotting
>
> * e.g. 'd const(contoured_field, 0, -u)'
>
>
> *------------------------------------------------------------------------------------------------
>
> if(Lon1 < 74.16)
>
>                 'set lon 'Lona' 'Lonb
>
> 'd skip(u_velocity*1.95,50,50);v_velocity*1.95'
>
> endif
>
>
>
>
>
>
>
> Kieren Marsh
>
>
>
> *From:* gradsusr-bounces at gradsusr.org [mailto:
> gradsusr-bounces at gradsusr.org] *On Behalf Of *Anil Kumar Sharma
> *Sent:* 28 January 2014 11:16
> *To:* jma at cola.iges.org; GrADS Users Forum
> *Subject:* [gradsusr] Help on displaying NetCDF data with Grads.
>
>
>
> Hi Jennifer and GrADS Users,
>
>
>
> I have NetCDF file (RTOFS Global<http://nomads.ncep.noaa.gov/pub/data/nccf/com/rtofs/prod/rtofs.20140127/rtofs_glo_2ds_n024_daily_prog.nc>)
> downloaded from NOMADS server<http://nomads.ncep.noaa.gov/pub/data/nccf/com/rtofs/prod/rtofs.20140127/rtofs_glo_2ds_n024_daily_prog.nc>.
> Ncdump of the file is
>
>
> netcdf
> D\:/OceanCurrentData/2014/01/22/20140122_rtofs_glo_2ds_n024_daily_prog {
> dimensions:
>         MT = UNLIMITED ; // (1 currently)
>         Y = 3298 ;
>         X = 4500 ;
>         Layer = 1 ;
> variables:
>         double MT(MT) ;
>                 MT:long_name = "time" ;
>                 MT:units = "days since 1900-12-31 00:00:00" ;
>                 MT:calendar = "standard" ;
>                 MT:axis = "T" ;
>         double Date(MT) ;
>                 Date:long_name = "date" ;
>                 Date:units = "day as %Y%m%d.%f" ;
>                 Date:C_format = "%13.4f" ;
>                 Date:FORTRAN_format = "(f13.4)" ;
>         int Layer(Layer) ;
>                 Layer:units = "layer" ;
>                 Layer:positive = "down" ;
>                 Layer:axis = "Z" ;
>         int Y(Y) ;
>                 Y:point_spacing = "even" ;
>                 Y:axis = "Y" ;
>         int X(X) ;
>                 X:point_spacing = "even" ;
>                 X:axis = "X" ;
>         float Latitude(Y, X) ;
>                 Latitude:standard_name = "latitude" ;
>                 Latitude:units = "degrees_north" ;
>         float Longitude(Y, X) ;
>                 Longitude:standard_name = "longitude" ;
>                 Longitude:units = "degrees_east" ;
>                 Longitude:modulo = "360 degrees" ;
>         float u_velocity(MT, Layer, Y, X) ;
>                 u_velocity:coordinates = "Longitude Latitude Date" ;
>                 u_velocity:standard_name = "eastward_sea_water_velocity" ;
>                 u_velocity:units = "m/s" ;
>                 u_velocity:_FillValue = 1.267651e+030f ;
>                 u_velocity:valid_range = -2.09935f, 2.310735f ;
>                 u_velocity:long_name = " u-veloc. [90.9H]" ;
>         float v_velocity(MT, Layer, Y, X) ;
>                 v_velocity:coordinates = "Longitude Latitude Date" ;
>                 v_velocity:standard_name = "northward_sea_water_velocity" ;
>                 v_velocity:units = "m/s" ;
>                 v_velocity:_FillValue = 1.267651e+030f ;
>                 v_velocity:valid_range = -2.275719f, 2.274807f ;
>                 v_velocity:long_name = " v-veloc. [90.9H]" ;
>         float sst(MT, Y, X) ;
>                 sst:coordinates = "Longitude Latitude Date" ;
>                 sst:standard_name = "sea_surface_temperature" ;
>                 sst:units = "degC" ;
>                 sst:_FillValue = 1.267651e+030f ;
>                 sst:valid_range = -6.057281f, 32.59346f ;
>                 sst:long_name = " sea surf. temp.   [90.9H]" ;
>         float sss(MT, Y, X) ;
>                 sss:coordinates = "Longitude Latitude Date" ;
>                 sss:standard_name = "sea_surface_salinity" ;
>                 sss:units = "psu" ;
>                 sss:_FillValue = 1.267651e+030f ;
>                 sss:valid_range = 1.749605f, 40.75261f ;
>                 sss:long_name = "sea surf. salnity  [90.9H]" ;
>         float layer_density(MT, Layer, Y, X) ;
>                 layer_density:coordinates = "Longitude Latitude Date" ;
>                 layer_density:standard_name =
> "sea_water_potential_density" ;
>                 layer_density:units = "sigma" ;
>                 layer_density:_FillValue = 1.267651e+030f ;
>                 layer_density:valid_range = 0.f, 0.f ;
>                 layer_density:long_name = " density [90.9H]" ;
>
> // global attributes:
>                 :Conventions = "CF-1.0" ;
>                 :title = "HYCOM ATLb2.00" ;
>                 :institution = "National Centers for Environmental
> Prediction" ;
>                 :source = "HYCOM archive file" ;
>                 :experiment = "90.9" ;
>                 :history = "archv2ncdf2d" ;
> }
>
> The dataset has 32 hybrid layers and a horizontal grid size of (4500 x
> 3298) . The grid has an Arctic bi-polar patch north of 47°N and a Mercator
> projection south of 47°N through 78.6°S. More details can be found at link<http://polar.ncep.noaa.gov/global/about/?>.
>
>
> The CTL file Am using is to display variable values :
>
>
>
> dset ^20140122_rtofs_glo_2ds_n024_daily_prog.nc
>
> title HYCOM ATLb2.00
>
> undef 1.26765e+30
>
> dtype netcdf
>
> XDEF 4320 LINEAR 74.16 0.08333
>
> YDEF 2160 LINEAR -90.   0.08333
>
> zdef 1 linear 1 1
>
> tdef 1 linear 00Z31DEC1900 1mn
>
> options template
>
> PDEF 4500 3298 bilin sequential binary-big D:\OceanCurrentData\PDEF\pdef_ncep_global
>
>
> vars 8
>
> Date=>date  0  t  date
>
> Latitude=>latitude  0  y,x  latitude
>
> Longitude=>longitude  0  y,x  longitude
>
> u_velocity=>u_velocity  1  t,z,y,x   u-veloc. [90.9H]
>
> v_velocity=>v_velocity  1  t,z,y,x   v-veloc. [90.9H]
>
> sst=>sst  0  t,y,x   sea surf. temp.   [90.9H]
>
> sss=>sss  0  t,y,x  sea surf. salnity  [90.9H]
>
> layer_density=>layer_density  1  t,z,y,x   density [90.9H]
>
> endvars
>
> The file used for interpolation pdef_ncep_global can be downloaded from
> http://nomad3.ncep.noaa.gov/pub/rtofs_global/20140122/
>
>
>
> When Am displaying current variables u_velocity and v_velocity in GrADS
> with following commands
>
> ga->open
> C:/OceanCurrentData/2014/01/22/20140122_rtofs_glo_2ds_n024_daily_prog.ctl
>
> ga-> set lon -180 180
>
> ga-> set lat -90 90
> ga-> d skip(u_velocity*1.95,50,50);v_velocity*1.95
>
> The output produced with above commands is attached herewith. The output
> shown to grads windows is only for lon 74.16 to 179.95 approx. Understand
> that Longitude starts is set 74.16 in XDEF entry in CTL file (as NetCDF
> file contains rectilinear data from 74.16 onward and data is packed 1/12 th
> the degree)
>
>
>
> XDEF 4320 LINEAR 74.16 0.08333
>
>
>
>
> is defining Start point of LON.
>
>
>
> My Question is : How can I make command d
> skip(u_velocity*1.95,50,50);v_velocity*1.95 working so that plot is on
> entire globe ??? not for just LON 74.16 to 179.65. (Understand that NetCDF
> file has linear data from 74.16 to 434, but How can I make
> these Cartesian coordinate equivalent to geographical coordinates ????)
>
>
>
> Center of Plot is necessarily to be at POINT (0,0) as plot need to be
> overlaid on google map.
>
>
>
> *Any help or guidance would be greatly appreciated.*
>
> *Thanks & Regards*
>
> *Anil Kumar - Sr. Software Developer*
>
> *OceanManager Inc. *| www.oceanmanager.com
>
> Tel: +1 (801)-758-7101, (801)-758-7207
>
> Fax: +1 (801)-758-7101
>
> *OceanManager- Marine Software*
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140129/95c61da7/attachment-0001.html 


More information about the gradsusr mailing list