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

Resampling to EPSG:4326 produces unexpected results #218

Closed
pnuu opened this issue Mar 9, 2018 · 3 comments · Fixed by pytroll/pyresample#117
Closed

Resampling to EPSG:4326 produces unexpected results #218

pnuu opened this issue Mar 9, 2018 · 3 comments · Fixed by pytroll/pyresample#117

Comments

@pnuu
Copy link
Member

pnuu commented Mar 9, 2018

Code Sample, a minimal, complete, and verifiable piece of code

Area definition

REGION: EPSG4326 {
   NAME:    Global equal latitude/longitude grid for global sphere
   PCS_ID:  EPSG:4326
   PCS_DEF: init=EPSG:4326
   XSIZE: 8192
   YSIZE: 4096
   AREA_EXTENT:  (-180.0, -90.0, 180.0, 90.0)
};
import glob
import sys
from satpy import Scene

def test_msg(composite):
    fnames = glob.glob("/home/lahtinep/data/satellite/geo/H*MSG3*201801110900*")
    glbl = Scene(reader='hrit_msg', filenames=fnames)
    glbl.load([composite])
    lcl = glbl.resample('EPSG4326')
    lcl.save_dataset(composite, '/tmp/%s_msg.tif' % composite)

def main():
    composite = sys.argv[1]
    test_msg(composite)

if __name__ == "__main__":
    main()

Problem description

Resampling SatPy scenes to global lat/lon grid (EPSG:4326) produces a row of tiny images along the equator.

Expected Output

Single image located at the correct place.

cloud_overview_msg_maint08_scaled

Actual Result, Traceback if applicable

cloud_overview_msg_develop_scaled

Versions of Python, package at hand and relevant dependencies

  • Doesn't work with any SatPy xarray/dask branch, e.g. develop
  • Works with maint/0.8 branch
  • All of the other packages stay the same, only SatPy branch is changed
@pnuu
Copy link
Member Author

pnuu commented Mar 9, 2018

I had a look in to the code, but can't figure out what is causing this. I think it's either something in resample.py in SatPy, or pyresample.kd_tree.XArrayResamplerNN class that is used in develop branch to handle resampling.

@djhoese
Copy link
Member

djhoese commented Mar 9, 2018

And you're sure it isn't anything in the reader? You mentioned on slack that you've seen this issue in past versions of mpop/satpy but it was fixed at some point, right? Does it happen for non-composites? Does it happen for all resolutions?

@pnuu
Copy link
Member Author

pnuu commented Mar 9, 2018

Can't see how reader updates would affect, resampling to other areas (e.g. EPSG:3035) work fine. It might have been something about the poles being part of the area definition the last time. @mraspaud does that ring a bell? I tried with a single channel that wasn't defined as a composite (IR_108), same thing. Also smaller images have the same issue, tried with 800x400 resolution.

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

Successfully merging a pull request may close this issue.

2 participants