pytroll / pytroll/pyresample

create_area_def produces area definition with invalid latitudes

Open
#419 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
385
Forks
102
Avg merge
4d 2h
Merged PRs (30d)
9

Description

Code Sample, a minimal, complete, and verifiable piece of code
from pyresample import create_area_def
ar = create_area_def(
        "fribullus_xax", 4326, units="degrees",
        resolution=0.1, center=(0, 90), shape=(5, 5))
print(ar.get_lonlats()[1])
Problem description

The latitudes returned are invalid.

Expected Output
[[89.8 89.8 89.8 89.8 89.8]
 [89.9 89.9 89.9 89.9 89.9]
 [90.  90.  90.  90.  90. ]
 [89.9 89.9 89.9 89.9 89.9]
 [89.8 89.8 89.8 89.8 89.8]]

Or maybe an exception that the operation is invalid.

Actual Result, Traceback if applicable
[[90.2 90.2 90.2 90.2 90.2]
 [90.1 90.1 90.1 90.1 90.1]
 [90.  90.  90.  90.  90. ]
 [89.9 89.9 89.9 89.9 89.9]
 [89.8 89.8 89.8 89.8 89.8]]
Versions of Python, package at hand and relevant dependencies

pyresample v1.22.3-14-ga742fd8

Contributor guide

No contributing guide indexed for this repository

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 at the create_area_def entry point and reproduce the provided example, then inspect how get_lonlats() calculates latitude values for a center at 90 degrees. Done means the result stays within valid latitude bounds and matches the expected output, or the operation raises an exception if the definition is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.