[ncl-talk] Error in selecting box using coordinate subscripting

samirpokhrel samir at tropmet.res.in
Mon Jul 19 01:18:02 MDT 2021


Thanks Adam and Rashed, 

Its confusing, As LonPivot is just re-arranging the the order of Longitude start and end point, but the basic range is similar to that of the models original grid (i.e -279 to 80). 
Is it not possible to arrange the longitudes in the way its easy i.e positive means east and negative means west longitudes. 
Is re-gridding data the only solution? 

regards 
Samir 

From: "Adam Phillips" <asphilli at ucar.edu> 
To: "samirpokhrel" <samir at tropmet.res.in> 
Cc: "ncl-talk" <ncl-talk at ucar.edu> 
Sent: Friday, July 16, 2021 11:21:32 PM 
Subject: Re: [ncl-talk] Error in selecting box using coordinate subscripting 

Rashed is right, lonPivot is definitely one way to get around this issue. Another possibility is to just specify the area like this: 
temp_et = temp({30:60},{-240:-170}) 
Hope that helps! 
Adam 

On Fri, Jul 16, 2021 at 11:46 AM Rashed Mahmood via ncl-talk < [ mailto:ncl-talk at mailman.ucar.edu | ncl-talk at mailman.ucar.edu ] > wrote: 



lonFlip assumes that the central longitude is either Greenwich meridian (0) or 180 which is not the case in your data. Maybe "lonPivot" could do the job? 
[ https://www.ncl.ucar.edu/Document/Functions/Contributed/lonPivot.shtml | https://www.ncl.ucar.edu/Document/Functions/Contributed/lonPivot.shtml ] 
Or regriding the data could be another option. 





On Fri, Jul 16, 2021 at 8:55 AM samirpokhrel via ncl-talk < [ mailto:ncl-talk at mailman.ucar.edu | ncl-talk at mailman.ucar.edu ] > wrote: 

BQ_BEGIN



Dear NCL Users, 




I am having problem while selecting a specific region within model output global data. Model data Longitudes varies from -279.75 to 79.75. The printVarSummary of the model data is as follows 

------- 

Variable: temp 

Type: double 

Number of Dimensions: 2 

Dimensions and sizes: [YT_OCEAN | 410] x [XT_OCEAN | 720] 

Coordinates: 

YT_OCEAN: [-80.75..89.75] 

XT_OCEAN: [-279.75..79.75] 

--------- 

When I am trying to Select the region 120 E to 170W and 30N to 60N by using coordinate subscripting viz. 




temp_et = temp({30:60},{120:-170}) 




It is giving error like 




fatal:NclOneDValGetRangeIndex: start coordinate index out of range, can't continue 

fatal:Could not obtain coordinate indexes, unable to perform subscript 




Thereafter I have performed the lonFlip function 




temp_new = lonFlip(temp) 

temp_et = temp_new({30:60},{120:-170}) 




and the error is solved and the printVarSummary now looks like 




--------------------------- 

Variable: temp_et 

Type: double 

Number of Dimensions: 2 

Dimensions and sizes: [YT_OCEAN | 40] x [XT_OCEAN | 440] 

Coordinates: 

YT_OCEAN: [30.2501..59.75] 

XT_OCEAN: [119.75..-99.75] 

---------------------------- 




This is incorrect as my data is 0.5 degree resolution and X dimension should be 140 size rather than 440 size 




Please let me know where I am going wrong 




Thanking you in advance 




Regards 
_______________________________________________ 
ncl-talk mailing list 
[ mailto:ncl-talk at mailman.ucar.edu | ncl-talk at mailman.ucar.edu ] 
List instructions, subscriber options, unsubscribe: 
[ https://mailman.ucar.edu/mailman/listinfo/ncl-talk | https://mailman.ucar.edu/mailman/listinfo/ncl-talk ] 



_______________________________________________ 
ncl-talk mailing list 
[ mailto:ncl-talk at mailman.ucar.edu | ncl-talk at mailman.ucar.edu ] 
List instructions, subscriber options, unsubscribe: 
[ https://mailman.ucar.edu/mailman/listinfo/ncl-talk | https://mailman.ucar.edu/mailman/listinfo/ncl-talk ] 

BQ_END



-- 
Adam Phillips 
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR 
[ http://www.cgd.ucar.edu/staff/asphilli/ | www.cgd.ucar.edu/staff/asphilli/ ] 303-497-1726 

[ http://www.cgd.ucar.edu/staff/asphilli ] 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210719/7b31bb2b/attachment.html>


More information about the ncl-talk mailing list