Skip to content

Fvcom reader to handle non-geographic coordinates#36

Open
mikebedington wants to merge 6 commits into
mainfrom
fvcom_reader_cartesian
Open

Fvcom reader to handle non-geographic coordinates#36
mikebedington wants to merge 6 commits into
mainfrom
fvcom_reader_cartesian

Conversation

@mikebedington

Copy link
Copy Markdown
Collaborator

FVCOMReader was setup to assume geographic coordinates, so added handling of cartesian. The projection code is either passed when initiated, or found in the file in the 'CoordinateProjection' global attribute - FVCOM doesn't actually write this itself but it seems a sensible place to store it. Assumes EPSG codes of format 'EPSG:xxxx' or 'xxxx'. Now raises an error if a projection isn't provided for cartesian grids, as the reader is setup to always populate the lon/lat fields. Arguably this shouldn't be needed as idealised grids often are cartesian only, but this preserves the existing approach and a dummy code can be provided without any problems.

Comment thread pyfvcom2/fvcom_reader.py
bdy_types = None

return MeshData(triangles, nodes, x1, x2, x3, bdy_types, open_bdy_node_lists)
return MeshData(triangles, nodes, x1, x2, x3, bdy_types, open_bdy_node_lists), coordinate_system

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the function output args to be tuple[MeshData, str]

Comment thread pyfvcom2/fvcom_reader.py
# Build the time index mapping for multiple files
self._build_time_index_mapping()

if projection is None and hasattr(self._metadata_dataset,'CoordinateProjection'):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing there is never the case where projection is None but self._metadata_dataset doesn't have CoordinateProjection as an attribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants