[ncl-talk] lonPivot
Alan Brammer
abrammer at albany.edu
Thu Feb 12 08:17:54 MST 2015
Not sure if this is really a bug as such.
You're longitude data does not exactly fall on the pivot point you
request. (/.... -0.75,-0.25, 0.25, 0.75 .... /) . NCL is finding the
nearest point through coordinate subscripting and as they are equally far
from 0 it is choosing -0.25.
The line in question from the function is ` indP =
ind(xlon.eq.xlon({pivotLon})) ; must be exact ` because it's not exact it
will find the nearest location. Given two values the same distance away,
NCL will pick the first one.
Redefining the longitude as you do is not the correct solution, your data
will be offset 0.5degrees from the grid it was actually on. Instead change
your pivot point 0.25 or a point that your longitude data includes.
Good luck,
Alan.
On Thu, Feb 12, 2015 at 8:40 AM, gibies george <gibies at tropmet.res.in>
wrote:
>
> Dear NCL support team,
>
> Here I am reporting a probable bug in the lonPivot function.
>
> Hope the following script and its output are self-explanatory.
>
> Regards
>
> Gibies
>
> ________________Script_________________
>
> printVarSummary(hcst_sst)
> hcst_sst=lonPivot(hcst_sst,0)
> printVarSummary(hcst_sst)
> *lonnew=fspan(0.25,359.75,720)*
> *hcst_sst&lon=lonnew*
> printVarSummary(hcst_sst)
> _________________________Output________
>
>
> Variable: hcst_sst
> Type: float
> Total Size: 273945600 bytes
> 68486400 values
> Number of Dimensions: 4
> Dimensions and sizes: [year | 29] x [month | 8] x [lat | 410] x [lon |
> 720]
> Coordinates:
> year: [1981..2009]
> month: [2..9]
> lat: [-80.75..89.75]
> lon: [-279.75..79.75]
> Number Of Attributes: 1
> _FillValue : -1e+10
>
> Variable: hcst_sst
> Type: float
> Total Size: 273945600 bytes
> 68486400 values
> Number of Dimensions: 4
> Dimensions and sizes: [year | 29] x [month | 8] x [lat | 410] x [lon |
> 720]
> Coordinates:
> year: [1981..2009]
> month: [2..9]
> lat: [-80.75..89.75]
> lon:* [-0.25..-0.75]*
> Number Of Attributes: 2
> lonPivot : reordered via lonPivot [NCL]: pivotLon=0
> _FillValue : -1e+10
>
> Variable: hcst_sst
> Type: float
> Total Size: 273945600 bytes
> 68486400 values
> Number of Dimensions: 4
> Dimensions and sizes: [year | 29] x [month | 8] x [lat | 410] x [lon |
> 720]
> Coordinates:
> year: [1981..2009]
> month: [2..9]
> lat: [-80.75..89.75]
> lon: [0.25..359.75]
> Number Of Attributes: 2
> lonPivot : reordered via lonPivot [NCL]: pivotLon=0
> _FillValue : -1e+10
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150212/1cd78ec8/attachment.html
More information about the ncl-talk
mailing list