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

Reprojected image cut off at 180E #3000

Open
crazyapril opened this issue Nov 22, 2024 · 4 comments
Open

Reprojected image cut off at 180E #3000

crazyapril opened this issue Nov 22, 2024 · 4 comments

Comments

@crazyapril
Copy link

Describe the bug
I have a flat night light map (in EPSG:4326), and I want to reproject it to a satellite view. However, the reprojected image gets cut off at 180E. Obviously it's not wanted.
image

What could go wrong?

To Reproduce

from satpy.resample import get_area_def
from satpy.scene import Scene

blackmarble = Scene(reader="generic_image",
                    filenames=["recipes/BlackMarble.tiff"])
blackmarble.load(["image"])
res = blackmarble.resample(get_area_def("himawari9"), resampler="nearest")
res.save_dataset("image", "recipes/h9-night.tif", writer="geotiff")

And area def himawari9:

himawari9:
  description: Himawari-9 B03
  projection:
    proj: geos
    lon_0: 140.7
    h: 35785863
    x_0: 0
    y_0: 0
    a: 6378137
    rf: 298.257024882273
    no_defs: null
    type: crs
  shape:
    height: 22000
    width: 22000
  area_extent:
    lower_left_xy: [-5499999.968358421, -5499999.96835842]
    upper_right_xy: [5499999.968358421, 5499999.968358421]
    units: m
@djhoese
Copy link
Member

djhoese commented Nov 22, 2024

I'm surprised by your results, but more than likely this would be helped by the work described here:

pytroll/pyresample#627

I just haven't had the time lately to play around with it. Sorry.

@crazyapril
Copy link
Author

crazyapril commented Nov 23, 2024

I added pm: 180 into the area def and got this:
image

Maybe we need more tweaks?
And when I changed lon_0 to -39.3 I just got the same result with the initial one.

@pnuu
Copy link
Member

pnuu commented Nov 24, 2024

Try adding reduce_data=False to the .resample() call in your original code.

@crazyapril
Copy link
Author

My original map is exceptionally large (40,000x20,000), and adding reduce_data=False causes my 128GB of memory to be completely used up. I can confirm it works for smaller maps, but I’m wondering if there’s a way to handle this using just satpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants