opendrift icon indicating copy to clipboard operation
opendrift copied to clipboard

Longitude 180°

Open ShamblingCrane opened this issue 7 years ago • 1 comments

When I try to run a simulation where the seeding longitudes span across the longitude discontinuity line (in my intention), e.g. lat=[179, -179], I get the following error during execution:

File "<...>/opendrift/models/basemodel.py", line 2010, in run self.elements_scheduled.lat) File "<...>/opendrift/models/basemodel.py", line 1262, in closest_ocean_points if landgrid.min() == 1 or np.isnan(landgrid.min()): File "<...>/miniconda2/lib/python2.7/site-packages/numpy/core/_methods.py", line 29, in _amin return umr_minimum(a, axis, None, out, keepdims) ValueError: zero-size array to reduction operation minimum which has no identity I have tried both with the automatic basemap reader and with a manually-constructed basemap reader, spanning across the 180° longitude line (with opportune corners). The same problem appears if I keep the seeding latitudes both "to the left" or "to the right" of the 180° longitude line, while having the Basemap spanning across it.

Hypothesis: It may be impossible to build a land reader for this case just as easy as that. I have read that Basemap has problems with the 180° longitude line, with related issues on stackoverflow such as these: https://stackoverflow.com/questions/44759870/basemap-bluemarble-plot-the-opposite-longitudinal-section https://stackoverflow.com/questions/44759870/basemap-bluemarble-plot-the-opposite-longitudinal-section

Is there a specific way to run simulations with opendrift across that line?

ShamblingCrane avatar Oct 17 '18 10:10 ShamblingCrane

Curious to know if you found a workaround for this ? Im having similar issues for global model data that spans across the 180deg West longitude...

simonweppe avatar Mar 08 '19 03:03 simonweppe

Fair bit of work has gone into this. Hopefully works better now.

gauteh avatar Jan 25 '23 09:01 gauteh