pytroll / pytroll/satpy

Reprojected image cut off at 180E

Open
#3,000 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.2k
Forks
335
Avg merge
1d 18h
Merged PRs (30d)
10

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the shown Scene.resample call, the get_area_def("himawari9") area definition, and the nearest resampler with the provided EPSG:4326 image. Reproduce the GeoTIFF output using the commands and Himawari-9 YAML in the issue; done means the reprojected image is no longer cut off at 180E.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.