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

samirpokhrel samir at tropmet.res.in
Fri Jul 16 00:55:09 MDT 2021



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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210716/084b24b4/attachment.html>


More information about the ncl-talk mailing list