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

Create instrument swath outlines as shapefiles #93

Merged
merged 40 commits into from
Jan 8, 2025

Conversation

adybbroe
Copy link
Contributor

@adybbroe adybbroe commented Nov 19, 2024

This PR adds a script to create Satellite instrument swath outlines in shapefile format, e.g. for use in an WMS/WFS service.

Also some re-factoring has been done in this PR.

Adam.Dybbroe added 8 commits October 3, 2024 17:16
…shapefile support

Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
…ine-shapefile

# Conflicts:
#	trollsched/tests/test_satpass.py
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
@adybbroe adybbroe self-assigned this Nov 19, 2024
Adam.Dybbroe added 5 commits November 20, 2024 13:38
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
@adybbroe
Copy link
Contributor Author

Here an example of how the script can be run:
create_shapefiles_from_schedule -s NOAA-21 NOAA-20 -t ./tle-202409060015.txt -x ./2024-09-06-00-45-08-acquisition-schedule-confirmation-nrk.xml -o /data/pass_outlines

@TAlonglong
Copy link
Collaborator

Could you add something like that example you gave to the docs?

Adam.Dybbroe added 3 commits November 20, 2024 16:25
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 81.38528% with 43 lines in your changes missing coverage. Please review.

Project coverage is 60.35%. Comparing base (fccd0a5) to head (6d8344f).
Report is 53 commits behind head on main.

Files with missing lines Patch % Lines
trollsched/combine.py 11.11% 16 Missing ⚠️
trollsched/drawing.py 0.00% 13 Missing ⚠️
trollsched/shapefiles_from_schedule.py 89.39% 7 Missing ⚠️
trollsched/logger.py 77.77% 4 Missing ⚠️
trollsched/utils.py 81.81% 2 Missing ⚠️
trollsched/helper_functions.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   55.71%   60.35%   +4.64%     
==========================================
  Files          14       18       +4     
  Lines        2107     2278     +171     
==========================================
+ Hits         1174     1375     +201     
+ Misses        933      903      -30     

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

Adam.Dybbroe added 2 commits November 22, 2024 13:46
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
@adybbroe
Copy link
Contributor Author

Could you add something like that example you gave to the docs?

Good point, absolutely. I have added a bare minimum at least.

@adybbroe
Copy link
Contributor Author

Here just showing an example of a QGIS display of one shapefile produced by the script above:

Screenshot from 2024-11-22 12-55-39

Adam.Dybbroe added 2 commits November 22, 2024 16:10
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Adam.Dybbroe added 4 commits December 2, 2024 20:48
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
@adybbroe adybbroe requested a review from pnuu December 3, 2024 08:40
trollsched/pass_scheduling_utils.py Outdated Show resolved Hide resolved
trollsched/shapefiles_from_schedule.py Outdated Show resolved Hide resolved
Co-authored-by: Panu Lahtinen <pnuu+git@iki.fi>
@adybbroe
Copy link
Contributor Author

adybbroe commented Dec 3, 2024

I think I should have actually removed the main block in shapefiles_from_schedule.py do you agree @pnuu ?

Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
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.

Wow, thanks a lot for the huge work in cleaning this package up! Looks good in general, but I have a few comments and suggestions/requests inline

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.stickler.yml Outdated Show resolved Hide resolved
docs/usage.rst Outdated Show resolved Hide resolved
.bumpversion.cfg Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
trollsched/graph.py Outdated Show resolved Hide resolved
trollsched/logger.py Outdated Show resolved Hide resolved
trollsched/schedule.py Outdated Show resolved Hide resolved
trollsched/shapefiles_from_schedule.py Outdated Show resolved Hide resolved
trollsched/tests/test_pass_outlines.py Outdated Show resolved Hide resolved
Adam.Dybbroe and others added 9 commits December 4, 2024 10:44
…errors

Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
…nd line args

Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
@adybbroe adybbroe requested review from pnuu and mraspaud December 4, 2024 21:50
@adybbroe
Copy link
Contributor Author

adybbroe commented Jan 6, 2025

I think the issues you raised have been attended to @mraspaud
But it is some time ago now, what do you say, can we accept it as is?
Any other comments from @TAlonglong or others?

"FENGYUN 3A": "FENGYUN-3A",
"FENGYUN 3B": "FENGYUN-3B",
"FENGYUN 3C": "FENGYUN-3C",
"SUOMI NPP": "NPP"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need NOAA-20 and NOAA-21 or are they not needed to translate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure. Maybe not, but you would know better, as you added this @TAlonglong . I suppose we will find out, and then fix it accordingly when/if needed in another PR.

Copy link
Collaborator

@TAlonglong TAlonglong left a comment

Choose a reason for hiding this comment

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

Wow, this was a lot of small fixes and updates.

Nice functionallity, I could also think of output WKT POLYGON string to be used wtih eg a postgis But This is not for this PR!

trollsched/graph.py Outdated Show resolved Hide resolved
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!

Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
@adybbroe adybbroe merged commit 83a32e2 into pytroll:main Jan 8, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Should be possible to store swath outlines as shapefiles
4 participants