Re: Question about coordinates

From: Evelyn Grell <Evelyn.Grell_at_nyahnyahspammersnyahnyah>
Date: Thu, 04 Dec 2008 09:44:22 -0700

Erik,
I think the problem is simply that the WRF dimensions can not be
directly converted to lat/lon using the {} notation, because lat and lon
are 2d arrays. You can specify a range using the actual grid points, but
the value of -10 won't work.
I'm sure Mary, Dennis and the others could provide an elegant fix, but I
just wanted to help you understand the error.
Evelyn

Erik Noble wrote:
> Dear NCL,
> Could I please have help with getting over this hurdle? It is still
> tough to comprhend.
> I need help understanding the proper way to get read this variable
> with specific coordinates. My simple goal is to have a rain variable
> at between the coordinate range {5:15},{-10:10} so that I can have
> fun, plot it, perhaps, make a time vs. longitude plot, etc... :-).
>
> When I use this command on one file, it works:
> f = addfile ("TRMM_HDF-Daily_precip.nc","r")
> r=f->precipitation
> rain = r(:,{5:15},{-10:10})
>
> Yet when I do this for another file (a WRF file) I get the error
> a = addfile(“wrfout.nc”,”r”)
> nc = a->RAINNC(:,{5:15},{-10:10})
> fatal:Dimension (west_east) of file (wrfout_d01_2006-09-01_00:00:00)
> does not have an associated coordinate variable
> fatal:Execute: Error occurred at or near line 114
>
> I don’t know how to read this using standard subscripting because I
> don’t know the indices. I understand, using printVarSummary command,
> that its coordinates are not 1D “lat” and “lons” but 3D XLAT and XLONG
> (indicated below). But how can I call in the variable or at least get
> the variable between the coordinates above? Do I have to specifically
> name the coordinates?
>
> Any advice will be appreciated and I will be forever grateful, mainly
> because the misunderstanding of this concept has been the source of
> most of mytalk questions.
> Sincerely,
> Erik
>
> Ncl 131> nc = a->RAINNC
> ncl 132> printVarSummary(nc)
>
>
> Variable: nc
> Type: float
> Total Size: 1047200 bytes
> 261800 values
> Number of Dimensions: 3
> Dimensions and sizes: [Time | 17] x [south_north | 110] x [west_east |
> 140]
> Coordinates:
> Number Of Attributes: 6
> FieldType : 104
> MemoryOrder : XY
> description : ACCUMULATED TOTAL GRID SCALE PRECIPITATION
> units : mm
> stagger :
> coordinates : XLONG XLAT
>
>
> cl 141> xlat= a->XLAT
> ncl 142> printVarSummary(xlat)
>
>
> Variable: xlat
> Type: float
> Total Size: 1047200 bytes
> 261800 values
> Number of Dimensions: 3
> Dimensions and sizes: [Time | 17] x [south_north | 110] x [west_east |
> 140]
> Coordinates:
> Number Of Attributes: 5
> FieldType : 104
> MemoryOrder : XY
> description : LATITUDE, SOUTH IS NEGATIVE
> units : degree_north
> stagger :
>
> ncl 143> xlong = a->XLONG
> ncl 144> printVarSummary(xlong)
>
>
> Variable: xlong
> Type: float
> Total Size: 1047200 bytes
> 261800 values
> Number of Dimensions: 3
> Dimensions and sizes: [Time | 17] x [south_north | 110] x [west_east |
> 140]
> Coordinates:
> Number Of Attributes: 5
> FieldType : 104
> MemoryOrder : XY
> description : LONGITUDE, WEST IS NEGATIVE
> units : degree_east
> stagger :
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 04 2008 - 09:44:22 MST

This archive was generated by hypermail 2.2.0 : Thu Dec 11 2008 - 03:51:46 MST