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 infinite coordinates failing to be equal #441

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Jul 6, 2022

The equality between two infinite coordinates was removed in 5079259 through the unwrapping of the longitude returning a NaN instead of Inf in that case. This PR restores the previous behaviour.

  • Tests added
  • Tests passed

Example of failing script:

    from satpy import Scene
    from glob import glob
    import os
    from satpy.utils import debug_on
    debug_on()
    datadir = "/home/a001673/data/satellite/Meteosat-11/seviri/lvl1.5/2018/02/28/HRIT"

    scn = Scene(filenames=glob(os.path.join(datadir, "*")),
                reader='seviri_l1b_hrit',
                )
    composite = "overview"
    scn.load([composite])
    newscn = scn.resample("moll")
    newscn.save_datasets(base_dir='/tmp', tiled=True, blockxsize=512, blockysize=512, driver='COG', overviews=[])

@mraspaud mraspaud added the bug label Jul 6, 2022
@mraspaud mraspaud self-assigned this Jul 6, 2022
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #441 (764da79) into main (119f9ad) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #441   +/-   ##
=======================================
  Coverage   94.24%   94.24%           
=======================================
  Files          68       68           
  Lines       12294    12300    +6     
=======================================
+ Hits        11586    11592    +6     
  Misses        708      708           
Flag Coverage Δ
unittests 94.24% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
pyresample/spherical.py 98.21% <100.00%> (+0.01%) ⬆️
pyresample/test/test_spherical.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 119f9ad...764da79. Read the comment docs.

@mraspaud mraspaud requested a review from djhoese July 6, 2022 12:44
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 94.089% when pulling 764da79 on mraspaud:fix-unwrap-scoord into 119f9ad on pytroll:main.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

I'm guessing this logic shouldn't be part of unwrap_radians for some reason? I'm OK with that, but just want to make sure. Feel free to merge.

@djhoese djhoese merged commit bc26674 into pytroll:main Jul 6, 2022
@mraspaud mraspaud deleted the fix-unwrap-scoord branch July 7, 2022 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants