Skip to content

ADD: IMD Reader#367

Merged
syedhamidali merged 8 commits intoopenradar:mainfrom
syedhamidali:feat/imd-reader
Apr 23, 2026
Merged

ADD: IMD Reader#367
syedhamidali merged 8 commits intoopenradar:mainfrom
syedhamidali:feat/imd-reader

Conversation

@syedhamidali
Copy link
Copy Markdown
Member

@syedhamidali syedhamidali commented Apr 23, 2026

Summary

Add a new xarray backend (IMDBackendEntrypoint, engine="imd") for reading India Meteorological Department (IMD) radar NetCDF files, which use a NetCDF4 container with an IRIS-inspired variable layout. IMD radars store one sweep per file; this PR adds:

  • open_imd_datatree() — reads a single file or a list of files and assembles a multi-sweep volume as a CfRadial2-compatible DataTree
  • group_imd_files() — groups a directory of mixed IMD files into per-volume file lists by filename stem
  • open_imd_volumes() — batch-processes directories into a nested DataTree with vcp_NN volume nodes

Moments are mapped to CfRadial2/FM 301 names (TDBTH, ZDBZH, VVRADH, WWRADH, ZDR, HCLASS) with canonical attributes. Unit conversions are applied where needed (pulseWidth μs→s, waveLength cm→frequency Hz).

Code ported from radarx with improvements for xradar integration.

Test Data

IMD sample files (Jaipur S-band, 2 volumes × 10 sweeps) added to open-radar-data v0.7.0 under the IMD/ prefix. Requires open-radar-data>=0.7.0.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Copy Markdown
Collaborator

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

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

@syedhamidali Nice to see this landing in xradar! ❤️ Thank you for working through this.

It would be great to have the test data in open_radar_data to use in the test suite. The notebook need to move to myst markdown. Some dates in file headers needs adjustment, too.

Comment thread docs/notebooks/IMD.ipynb Outdated
Comment thread tests/conftest.py Outdated
@kmuehlbauer
Copy link
Copy Markdown
Collaborator

CI didn't kick in, I'm going to close/reopen.

@kmuehlbauer kmuehlbauer reopened this Apr 23, 2026
@kmuehlbauer
Copy link
Copy Markdown
Collaborator

Had to fix the merge conflict. Now CI did run.

@kmuehlbauer
Copy link
Copy Markdown
Collaborator

@syedhamidali Please pin open-radar-data to >=0.7.0. We'll have to wait for conda-forge, though.

@syedhamidali syedhamidali self-assigned this Apr 23, 2026
@syedhamidali syedhamidali added the enhancement New feature or request label Apr 23, 2026
@kmuehlbauer
Copy link
Copy Markdown
Collaborator

@syedhamidali Thanks, follow-up here: conda-forge/open-radar-data-feedstock#21. After this get's merged, the package should be available after another hour or two.

…atting

- Remove IMD.ipynb; update IMD.md myst notebook to use DATASETS.fetch()
  with Jaipur S-band sample data from open-radar-data
- Update test fixtures to use open-radar-data instead of pooch from GitHub
- Remove needs_network decorator from all IMD tests
- Fix black formatting in imd.py and test_imd.py
- Fix copyright dates (2024-2025 → 2024-2026)
- Add Development section to history.md
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 99.11111% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.15%. Comparing base (230dbf5) to head (06a3a7a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
xradar/io/backends/imd.py 99.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   93.94%   94.15%   +0.21%     
==========================================
  Files          28       29       +1     
  Lines        6191     6416     +225     
==========================================
+ Hits         5816     6041     +225     
  Misses        375      375              
Flag Coverage Δ
notebooktests 0.00% <0.00%> (ø)
unittests 94.15% <99.11%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

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

@syedhamidali Thanks, this looks really good.

@syedhamidali
Copy link
Copy Markdown
Member Author

syedhamidali commented Apr 23, 2026

@kmuehlbauer Thank you for reviewing it!

@kmuehlbauer
Copy link
Copy Markdown
Collaborator

@syedhamidali Please merge at your discretion.

@syedhamidali syedhamidali merged commit ec70eab into openradar:main Apr 23, 2026
11 checks passed
@syedhamidali syedhamidali deleted the feat/imd-reader branch April 23, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

ADD: Support for India Meteorological Department (IMD) radar NetCDF format

2 participants