Skip to content

[FEAT] New NAC reader#134

Merged
isaschmitz merged 2 commits into
AMOCcommunity:mainfrom
isaschmitz:issue129-isa-nac
May 7, 2026
Merged

[FEAT] New NAC reader#134
isaschmitz merged 2 commits into
AMOCcommunity:mainfrom
isaschmitz:issue129-isa-nac

Conversation

@isaschmitz
Copy link
Copy Markdown
Collaborator

This commit features a new reader for North Atlantic current (NAC) transport estimates by M. Lankhorst (2025).

Description:

The new reader is set up with nac.py, which loads the data, nac.yml which holds the metadata and variable mapping and test_nac.py which tests the new reader.

Also, other files were changed to account for the new reader: __init__.py, read.py, readers.py, standardise.py.

In addition to that, the demo.ipynb was extended to load and show both transport estimates: TRANS_NAC which is derived from satellite and float observations and TRANS_NAC_PROXY which is derived just from satellite altimetry.

Changes were also made in plotters.py. Now data products which have a coarser resolution than 1 month can be plotted in a desired color as well, when resample_monthly is set to False.

The change in utilities.py accounts for an error which was given, when a loaded dataset has a TIME coordinate stored as datetime64, but also carries valid_min and/or valid_max metadata that is numeric. Therefore the masking code from function utilities.mask_invalid_values() now skips datetime variables.

Related Issues / Pull Requests:

Link any related issues, pull requests, or discussions:

This commit features a new reader for North Atlantic current (NAC) transport estimates ba M. Lankhorst (2025).

The new reader is set up with `nac.py`, which loads the data, `nac.yml` which holds the metadata and variable mapping and `test_nac.py` which tests the new reader.

Also, other files were changed to account for the new reader: `__init__.py`, `read.py`, `readers.py`, `standardise.py`.

In addition to that the `demo.ipynb` was extended to load and show both transport estimates: `TRANS_NAC` which is derived from satellite and float observations and `TRANS_FBC_PROXY` which is derived just from satellite altimetry.

Changes were also made in `plotters.py`. Now data products which have a coarser resolution than 1 month can be plotted in a desired color as well, when `resample_monthly` is set to `False`.

The change in `utilities.py` accounts for an error which was given, when a loaded dataset has a `TIME` coordinate stored as `datetime64`, but also carries `valid_min` and/or `valid_max` metadata that is numeric. Therefore the masking code from function `utilities.mask_invalid_values()` now skips datetime variables.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the Lankhorst (2025) North Atlantic Current (NAC) transport time series as a new AMOCatlas datasource, including YAML-driven standardization metadata and integration into the public read/load APIs. Also includes a small plotting behavior tweak and a utilities fix to avoid masking errors on datetime variables with numeric valid_min/valid_max attrs.

Changes:

  • Introduce a new NAC reader (amocatlas/data_sources/nac.py) plus YAML metadata/variable mapping (amocatlas/metadata/nac.yml) and basic tests.
  • Wire the new reader into the package entrypoints (data_sources/__init__.py, readers.py, read.py) and extend the demo notebook.
  • Update plotting behavior for raw series coloring when resample_monthly=False, and skip datetime variables in mask_invalid_values().

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_nac.py Adds basic structural tests for the new NAC reader module.
notebooks/demo.ipynb Demonstrates loading/plotting NAC transport and proxy variables.
amocatlas/utilities.py Skips datetime variables during valid-range masking to avoid type errors.
amocatlas/standardise.py Adds deprecated standardise_nac() wrapper for compatibility.
amocatlas/readers.py Registers nac reader in the internal reader dispatch.
amocatlas/read.py Exposes read.nac() and includes NAC in the public API and __all__.
amocatlas/plotters.py Adjusts raw plotting color/alpha/linewidth behavior when not resampling monthly.
amocatlas/metadata/nac.yml Adds NAC global + per-file metadata and variable mapping for standardization.
amocatlas/data_sources/nac.py Implements the NAC reader and associated constants/metadata.
amocatlas/data_sources/init.py Re-exports read_nac at the amocatlas.data_sources package level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread amocatlas/data_sources/nac.py Outdated
Comment thread amocatlas/data_sources/nac.py Outdated
Comment thread amocatlas/data_sources/nac.py
Comment thread tests/test_nac.py Outdated
Comment thread tests/test_nac.py
Comment thread amocatlas/standardise.py
Comment thread amocatlas/plotters.py Outdated
Comment thread amocatlas/utilities.py
Minor changes to `standardise.py`, `plotters.py` regarding formatting issues.

Adjustments in `nac.py` to account for new data file name, which results from the url, when loading the dataset off of the website. Changed the `test_nac.py` accrodingly.

Implemented an extension of the test in `test_utilities.py`, called `test_mask_invalid_values()`, to account for the changes commited earlier regarding datetime64 objects.
@isaschmitz isaschmitz merged commit ad1de66 into AMOCcommunity:main May 7, 2026
4 checks passed
@isaschmitz isaschmitz deleted the issue129-isa-nac branch May 7, 2026 16:22
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.

Add Lankhorst NAC time series

2 participants