Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection support #38

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

observingClouds
Copy link
Contributor

@observingClouds observingClouds commented Nov 13, 2024

eventually fixes #33

Main changes:

  • add optional projections attribute to dataset input section (see example.danra.yaml)
  • projections section will accept crs_wkt, single-value projection attributes or both, with crs_wkt being prioritized
  • add tests to ensure projections are identical across datasets and variables (only one common projection will be supported for now)
  • projection information written to output dataset

Off-topic-changes (though required for better testing):

  • adding doctests to CI (this allows to run examples given in docstrings as tests)
  • change the VALID_EXAMPLE_CONFIG_YAML to point to online datasets and no longer use non-implemented flatten-method

Questions:

  • does it make sense to give any of the output variables a grid_mapping attribute, e.g. static and others which depend on the grid_index which can map to x and y? Is there a standard for this?

created with
```
globe=ccrs.Globe(semimajor_axis=6367470,semiminor_axis=6367470)
4:41
ccrs.LambertConformal(central_longitude=proj_inf[‘LoV’]/1e6,standard_parallels=(proj_inf[‘Latin1’]/1e6,proj_inf[‘Latin2’]/1e6), central_latitude=((proj_inf[‘Latin1’]/1e6+proj_inf[‘Latin2’]/1e6))/2 ,false_easting=0, false_northing=0, globe=globe).to_cf()
```
@observingClouds observingClouds force-pushed the projection_support_stage1 branch 3 times, most recently from c8d6ed0 to 5946210 Compare November 14, 2024 08:34
Comment on lines +209 to +211
# TODO: generalize the retrieval of x and y coords
# coords = (dataarrays_by_target[target_output_var][0]['x'], dataarrays_by_target[target_output_var][0]['y'])
# lon, lat = get_latitude_longitude_from_projection(projection, coords)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ealerskans this would be my current proposal for you on where and how you could generate the lats and lons from x and y.

This is obviously per projection in each dataset and because we only accept one projection for now, you might just skip this step for all following datasets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the function is available from from .ops.projection

Copy link

@SimonKamuk SimonKamuk left a comment

Choose a reason for hiding this comment

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

Great work! Only some small comments from me :)

CHANGELOG.md Outdated Show resolved Hide resolved
example.danra.yaml Show resolved Hide resolved
mllam_data_prep/create_dataset.py Show resolved Hide resolved
mllam_data_prep/ops/projection.py Outdated Show resolved Hide resolved
@leifdenby leifdenby added this to the v0.6.0 (proposed) milestone Nov 20, 2024
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.

Make mllam-data-prep aware of geographical coordinates (by introducing projection info)
3 participants