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

Use area definition names to check sunlight coverage #67

Merged
merged 16 commits into from
Nov 24, 2019

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Nov 21, 2019

This PR changes the behaviour of check_sunlight_coverage() so that it will use the name of area definitions instead of individual composite/channel areas read from resampled scene attributes. This way the filtering can be done before loading and resampling. If the data are not to be projected (area defined as null in the config), the area is read from the dataset attributes and the plugin needs to be after the data is loaded with load_composites.

Closes pytroll/pyresample#228

  • Tests adjusted and added
  • Tests passed
  • Passes flake8 trollflow2
  • Fully documented

@pnuu pnuu self-assigned this Nov 21, 2019
@pnuu pnuu added the enhancement New feature or request label Nov 21, 2019
@codecov
Copy link

codecov bot commented Nov 21, 2019

Codecov Report

Merging #67 into master will increase coverage by 0.11%.
The diff coverage is 92.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage   92.13%   92.25%   +0.11%     
==========================================
  Files          10       10              
  Lines        1449     1523      +74     
==========================================
+ Hits         1335     1405      +70     
- Misses        114      118       +4
Impacted Files Coverage Δ
trollflow2/tests/test_trollflow2.py 99.84% <100%> (+0.01%) ⬆️
trollflow2/plugins/__init__.py 90.81% <82.5%> (-0.52%) ⬇️

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 dc847c7...6809d0f. Read the comment docs.

@pnuu pnuu requested a review from mraspaud November 21, 2019 09:52
@pnuu pnuu marked this pull request as ready for review November 21, 2019 09:52
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this, allow the sunlight coverage to run without loading data is really nice.
I just have one question.

prod = scn[product]
except KeyError:
try:
prod = scn[list(scn.keys())[0]]
Copy link
Member

Choose a reason for hiding this comment

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

What happens if some of the datasets aren't complete (like 3a or 3b on avhrr ?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess then the user could move the plugin to be run after resampling.

@pnuu
Copy link
Member Author

pnuu commented Nov 21, 2019

I've now tested this wih live data using an named area definition, and directly saving to satellite projection (area set to null in yaml).

@pnuu
Copy link
Member Author

pnuu commented Nov 21, 2019

The coverage calculation doesn't work for projections where the area has space in it, like the full disk geos projection for MSG/SEVIRI, Himawari-8/AHI and GOES/ABI. I'll see if I can find a workaround for this case.

@pnuu
Copy link
Member Author

pnuu commented Nov 21, 2019

Ok, found a solution and it seems to work. I'll check the status in the morning.

@pnuu
Copy link
Member Author

pnuu commented Nov 22, 2019

Yes, works nicely.

@pnuu
Copy link
Member Author

pnuu commented Nov 22, 2019

The ZMQ and crash handling commits should have been in a different branch -> reverted.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM

@pnuu pnuu merged commit 4caca38 into pytroll:master Nov 24, 2019
@pnuu pnuu deleted the feature-early-sunlight-coverage branch November 24, 2019 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Area definition boundaries where space pixels are excluded
2 participants