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

Fix 'viirs_edr' renaming two sets of dimensions to the same names #2707

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Dec 21, 2023

So this wasn't actually a problem until xarray 2023.9.0 where something changed to be more strict about dimensions and coordinates. This also wasn't failing in tests because my tests assume the ideal case of the file metadata. The real files however seem to have incorrect coordinates for some variables:

        short \750m\ Surface\ Reflectance\ Band\ M10(Along_Track_750m, Along_Scan_750m) ;
                \750m\ Surface\ Reflectance\ Band\ M10:scale_factor = 0.0001f ;
                \750m\ Surface\ Reflectance\ Band\ M10:add_offset = 0.f ;
                \750m\ Surface\ Reflectance\ Band\ M10:coordinates = "Latitude_at_375m_resolution, Longitude_at_375m_resolution" ;

Obviously the 750m data should not be pointing to the 375m lon/lat variables as coordinates. This was made worse by my renaming in __init__ from both sets of dimensions (375m and 750m) to the same name "y" and "x". This PR switches that renaming to happen per DataArray. Note I am not testing this particular case with bad coordinate names because I believe the algorithm developers have been told and the file coordinates should get fixed...hopefully.

  • Closes #xxxx
  • Tests added
  • Fully documented

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (989d9f0) 95.39% compared to head (ad08950) 95.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2707   +/-   ##
=======================================
  Coverage   95.39%   95.39%           
=======================================
  Files         371      371           
  Lines       52690    52695    +5     
=======================================
+ Hits        50263    50268    +5     
  Misses       2427     2427           
Flag Coverage Δ
behaviourtests 4.16% <0.00%> (-0.01%) ⬇️
unittests 96.00% <100.00%> (+<0.01%) ⬆️

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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7290181451

  • 14 of 14 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 95.956%

Totals Coverage Status
Change from base Build 7251760451: 0.001%
Covered Lines: 50394
Relevant Lines: 52518

💛 - Coveralls

@djhoese
Copy link
Member Author

djhoese commented Jan 5, 2024

I need these recent PRs I've made to continue my work and I'm not sure I can wait any longer. If someone wants to do a post-merge review I'll address any issues then.

@djhoese djhoese merged commit d7f0af6 into pytroll:main Jan 5, 2024
18 of 19 checks passed
@djhoese djhoese deleted the bugfix-viirs-edr-dimrename branch January 5, 2024 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants