[ncl-talk] change lat lon

Guido Cioni guidocioni at gmail.com
Mon Oct 8 05:28:09 MDT 2018


I'm not sure I understand your question...you may rephrase it and indicate why are you trying to do this.

But if you want to use coordinate indexing you have to use the { } parentheses. 

> On 8. Oct 2018, at 13:24, Vanúcia Schumacher <vanucia-schumacher at hotmail.com> wrote:
> 
> 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
> 
> 
> 
> 
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>

Guido Cioni
www.guidocioni.it

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


More information about the ncl-talk mailing list