You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While writing a structured netCDF reader for Delft3D-Flow outputs, I found out that the pixel size and bounding box are calculated wrong due to the masked coordinates.
Delft3D-Flow places masks not only on the variables but in the coordinates where the domain is not defined.
Possible causes
The x, y max min is changed inside structured.py (line 57) based on self.lon and self.lat shapes ignoring the mask. This overrides the setting of the extreme pixels inside the delft3d reader. Plus, it seems to switch the coordinate dimensions.
Because opendrift is looking for a bounding box of a masked array, some of the bounding box values can be mapped into the closest NaN by scipy.ndmimage.map_coordinates.
Test files
The delft3d-flow reader can be found here. You may want to look at the standard variable mapping at the top of the module so that you are able to extract the correct variables from the netCDF files that you can find here for the unprojected wgs84 and here for the projected in epgsg:28992
The text was updated successfully, but these errors were encountered:
But it remains to deal with the lon- and lat- arrays containing 0 values where they should be masked.
OpenDrift does presently not handle lon- lat arrays with masked values, but perhaps this could be implemented in a delft-reader, overriding existing methods in parent reader classes.
Later, and ideally, these features/changes could be moved to the parent classes, removing the need for a dedicated Delft-reader.
Framing
While writing a structured netCDF reader for Delft3D-Flow outputs, I found out that the pixel size and bounding box are calculated wrong due to the masked coordinates.
Delft3D-Flow places masks not only on the variables but in the coordinates where the domain is not defined.
Possible causes
The x, y max min is changed inside
structured.py
(line 57) based onself.lon
andself.lat
shapes ignoring the mask. This overrides the setting of the extreme pixels inside the delft3d reader. Plus, it seems to switch the coordinate dimensions.Because opendrift is looking for a bounding box of a masked array, some of the bounding box values can be mapped into the closest
NaN
byscipy.ndmimage.map_coordinates
.Test files
The delft3d-flow reader can be found here. You may want to look at the standard variable mapping at the top of the module so that you are able to extract the correct variables from the netCDF files that you can find here for the unprojected wgs84 and here for the projected in epgsg:28992
The text was updated successfully, but these errors were encountered: