contrailcirrus / pycontrails

Python library for modeling contrails and other aviation climate impacts
https://py.contrails.org/
Apache License 2.0
59 stars 17 forks source link

Deprecate or remove GeoVectorDataset.attrs["crs"] #151

Closed zebengberg closed 1 month ago

zebengberg commented 9 months ago

Generally, pycontrails assumes all geospatial data is provided in WGS84. In the GeoVectorDataset docstring, we write:

Expect latitude-longitude CRS in WGS 84.

The GeoVectorDataset interface gives an option to set a custom CRS through its attrs. This attribute is not consistently used in geospatial calculations. As a concrete example, Flight.length and Flight.segment_length both check the crs attribute, whereas Flight.segment_angle and Flight.segment_groundspeed do not. In the cases where the CRS is checked, an error is raised when the data is not WGS84 (the default).

The GeoVectorDataset.attrs["crs"] can likely be removed without impacting the end user. It would result in a slightly cleaner code base, slight performance improvements, and simplify some patterns (for example, Fleet constructions).