Closed ThomasHaine closed 10 months ago
I will take a look at this during the week.
I finally had some time to figure out a way to get around this. The issue is likely due to the coarse resolution of ECCO and the interpolation near the edge of the dataset after performing a cutout.
In ECCO and similar LLC datasets, there is no edge/boundary, and so this shouldn't be an issue. However, the reason it's happening is because you are doing a double cutout to get the survey station. By default, when performing a survey_station
(or mooring_array
) subsampling there is an internal call to cutout. During this internal call, XRange
and YRange
are byX_surv
and Y_surv
, along with a narrow horizontal boundary Hbdr
increase.
Because of default behavior, there is no need to first manually perform acutout
and then survey_station
(or mooring_array
if that were the case), since oceanspy is already doing that for you. When you do a cutout first, you reduce the domain to the size of the survey track, and when you then compute the survey_station
, the coarse interpolation then interacts with the edge of the dataset (I still need to spend some time to better understand this), which results in nans or zeros at the right edge of the track.
Keeping everything in your example the same except that when computing the survey you do so from the original od.
# Extract survey stations
od_surv = od.subsample.survey_stations(
Xsurv=lons,
Ysurv=lats,
varList=varList,
ZRange=[0, -4000], # controls deepest depth on plots
delta=20 # survey station spacing in km
)
Then you plot
ax1 = cut_od.plot.horizontal_section(varName="YC", cmap='Greys_r')
Xm, Ym = od_surv.dataset['XC'].values, od_surv.dataset['YC'].values
ax1.plot(Xm, Ym, 'r', lw=3, marker='d', markersize=5);
you get
Great! All works as expected now.
I'm having an issue with the
ECCO
dataset, possibly related to the landmask. If I make acutout
then usesurvey_stations
withLLC4320
orEGshelfIIseas2km_ASR_full
and then inspect theXC, YC
coordinates, all makes sense. WithECCO
, I get trailing zeros onXC, YC
, however. See the SciServer MWE below. What's going on?