[ncl-talk] change lat lon

Vanúcia Schumacher vanucia-schumacher at hotmail.com
Mon Oct 8 05:24:29 MDT 2018


Hi NCL users,


How can I get a variable with latitude and longitude of another variable?
For example, I want var2 to have the same lat and lon of var1, without changing resolution.

I tried this way, but don't work


  minlat     = -37.44693
  maxlat    = -31.94739
  minlon    = -73.65259
  maxlon   = -66.7254

 var2_zoom  = var2(:,minlat:maxlat,minlon:maxlon)

fatal:Illegal subscript. Subscripts must be integer when not using coordinate indexing


Variable: var2
Type: float
Total Size: 4570560 bytes
            1142640 values
Number of Dimensions: 3
Dimensions and sizes: [time | 240] x [latitude | 69] x [longitude | 69]
Coordinates:
            time: [ 369..174945]
            latitude: [-37.44693..-31.94739]
            longitude: [-73.65259..-66.7254]
Number Of Attributes: 5
  units : mm
  lon2d : <ARRAY of 4761 elements>
  lat2d : <ARRAY of 4761 elements>
  time : (    0,    6,   12,   18 )
  description : Total Precipitation

Variable: var1
Type: float
Total Size: 19319040 bytes
            4829760 values
Number of Dimensions: 3
Dimensions and sizes: [time | 240] x [latitude | 156] x [longitude | 129]
Coordinates:
            time: [370.5..174946.5]
            latitude: [-35.31664..-33.92255]
            longitude: [-70.89447..-69.48352]
Number Of Attributes: 5
  units : mm
  lon2d : <ARRAY of 20124 elements>
  lat2d : <ARRAY of 20124 elements>
  time : (    0,    3,    6,    9,   12,   15,   18,   21 )
  description : Total Precipitation




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181008/e544cac7/attachment.html>


More information about the ncl-talk mailing list