# [ncl-talk] Longitude Flip in ocean data

Arun Kumar Dwivedi dwivedi.arunkumar at gmail.com
Wed Jan 13 00:40:53 MST 2016

```Dear all,
Thank q for the response
In continuation to my above query the description is given below

Our data is rectilinear data ( data is in rectangular matrix with
un-uniform spacing). '

Our basic data structure is :

Variable: sst
Type: float
Total Size: 4499840 bytes
1124960 values
Number of Dimensions: 4
Dimensions and sizes:    [T1 | 20] x [ZT_K1_1 | 1] x [YT_J | 178] x [XT_I |
316]
Coordinates:
T1: [1005606..1005720]
ZT_K1_1: [ 2.5.. 2.5]
YT_J: [ -79..  79]
XT_I: [   1.. 359]
Number Of Attributes: 4
missing_value :    -1e+34
_FillValue :    -1e+34
long_name :    SST
units :    C

****************************
Our actual problem is we need to plot longitude in the selected range for
eg -90W to 120E then it doesnt accept the -90W value since the longitude
array is from 0 to 360 , the plot comes from 0 to 120E only. (-ve values
not accepted.) . To solve this we used lonflip function so that our
longitude array changes from -180 to 180. but since it is un-uniform data ,
***********************************
After LonFlip , it is

Variable: sstnew
Type: float
Total Size: 4499840 bytes
1124960 values
Number of Dimensions: 4
Dimensions and sizes:    [T1 | 20] x [ZT_K1_1 | 1] x [YT_J | 178] x [XT_I |
316]
Coordinates:
T1: [1005606..1005720]
ZT_K1_1: [ 2.5.. 2.5]
YT_J: [ -79..  79]
XT_I: [-257.75..101.75]
Number Of Attributes: 5
missing_value :    -1e+34
_FillValue :    -1e+34
long_name :    SST
units :    C
lonFlip :    longitude coordinate variable has been reordered via lonFlip

The longitude is originally from 0 to 360 and after LonFlip it is
-257.75..101.75... But when we are plotting in the longitude range (-90,
120) it is coming only in the longitude range (-90, 101)

So what would be the solution for our problem

Thanks & Regards
Arun Kumar Dwivedi,
Project Engineer - II
Computational Earth Science Group
CDAC, Pune - 411 007
Mob :09546189035

On Tue, Jan 12, 2016 at 7:44 PM, Mary Haley <haley at ucar.edu> wrote:

> Arun,
>
> grid? This function only works for rectilinear grids (grids represented by
> 1D lat/lon arrays).
>
> Did you look at your longitude values to make sure there are no issues
> with them before you do lonFlip?
>
> It would help if we could see a "printVarSummary" of the variable you are
> trying to call lonFlip on, and also any error messages.
>
> --Mary
>
>
> On Sun, Jan 10, 2016 at 11:10 PM, Arun Kumar Dwivedi <
> dwivedi.arunkumar at gmail.com> wrote:
>
>> Dear All,
>> I am working on ocean data (MOM and WAM) for global domain. I have issues
>> with longitude, when trying to plot in for particular region. For eg if I
>> want plot with Latitude 0 to 30 and Lon -40 to 100. Then it doesn't
>> recognize the value -40 in the longitude array.
>>
>> For this i have tried using LonFlip function, it works fine with uniform
>> grid but doesn't work with my data set which has varied grid resolution
>> (0.5,1 and 1.5).
>>
>>
>> Thanks & Regards
>> Arun Kumar Dwivedi,
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> 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/20160113/3fbab588/attachment.html
```