Hi Ryo,
I think that this has to do with the logic of "subspan modulo"
longitudes, which lets us work with axes shorter than the modulo
length by introducing a fake "void point" to complete the wrapping
around the globe, so that such an axis can be used along with a
full modulo axis in expressions or refer to points using west
longitude and so on. Here the void point is at 45W. This shows it
in a bit more detail,
yes? set data tmp.nc
yes? show axis `sst,return=xaxis`
!-> sh axis COADSX56_60
name axis # pts start end
COADSX56_60 LONGITUDE 5mr 131E 139E
Axis span (to cell edges) = 10 (modulo length = 360)
yes? list sst[x=225w:215w],
xbox[gx=sst,x=225w:215w], xboxlo[gx=sst,x=225w:215w],
xboxhi[gx=sst,x=225w:215w]
DATA SET: ./tmp.nc
LONGITUDE: 135E to 145E
LATITUDE: 19N
TIME: 16-JAN 06:00
Column 1: SST is SEA SURFACE TEMPERATURE (Deg C)
Column 2: XBOX is XBOX (axis COADSX56_60)
Column 3: XBOXLO is XBOXLO (axis COADSX56_60)
Column 4: XBOXHI is XBOXHI (axis COADSX56_60)
SST XBOX XBOXLO XBOXHI
135E / 3: 26.13 2.0 134.0 136.0
137E / 4: 26.31 2.0 136.0 138.0
139E / 5: 26.39 2.0 138.0 140.0
45W / 6: .... 350.0 140.0 490.0
It seems the extra points are included when the requested range
is outside the range given by the lower limit of the first grid
point actually on the axis and the upper limit of the last point.
As you suggest, these points should not be included in the listings or in the listings or the new file.
Ansley
Dear Ferret users,
I was surprised that a construct like temp[x=120:150] refers to strange longitudes when 120 or 150 is out of the actual defined range. A self-contained example is pasted below.
This is problematic when you save a subset of data because the longitude axis of the new dataset will include these strange longitude points unless you carefully specify the longitude range when saving it.
Is this an expected behavior or is it something that should be fixed in a future release?
Ryo----! PyFerret v7.63 (optimized)
! Darwin 19.6.0 - 12/10/21yes? set data coads_climatology
yes? save/clobber/file=tmp.nc SST[x=130:140,y=20,L=1]
LISTing to file tmp.nc
yes? set data tmp.nc
yes? list sst[x=120:135]
[ . . . ]
45W / 0: ....
131E / 1: 25.68
133E / 2: 25.90
135E / 3: 26.13
yes? list sst[x=135:140]
[ . . . ]
135E / 3: 26.13
137E / 4: 26.31
139E / 5: 26.39
yes? list sst[x=135:145]
[ . . .]
135E / 3: 26.13
137E / 4: 26.31
139E / 5: 26.39
45W / 6: ....
yes? save/file=tmp-new.nc sst[x=120:145] ! acquires strange longitudes.
yes? set data tmp-new.nc
yes? plot sst