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

get_geostationary_bounding_box* contains duplicated vertices at the equator #474

Closed
ghiggi opened this issue Nov 15, 2022 · 0 comments · Fixed by #475
Closed

get_geostationary_bounding_box* contains duplicated vertices at the equator #474

ghiggi opened this issue Nov 15, 2022 · 0 comments · Fixed by #475

Comments

@ghiggi
Copy link
Contributor

ghiggi commented Nov 15, 2022

The get_geostationary_bounding_box returns duplicated vertices at the equator.
The code snippet below shows the "bad" behaviour.

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

from pyresample import AreaDefinition
from pyresample.geometry import (
    get_geostationary_bounding_box_in_proj_coords,
    get_geostationary_bounding_box_in_lonlats
)
# Define geostationary projection
proj_dict_geostationary = {
        'proj_id': "dummy_geo_projection",
        "area_id" : 'dummy_geo_projection',
        "description" : 'geostationary projection',
        "projection" : {'a': 6378169.00,  'b': 6356583.80, 'h': 35785831.00, 'lon_0': 0, 'proj': 'geos'},
        "area_extent" : (-5500000., -5500000., 5500000., 5500000.),
        "width" : 100,
        "height" : 100,
}
areadef = AreaDefinition(**proj_dict_geostationary)
geos_area = areadef

#### If nb_points is 4, it requires only 2 points at the equator
nb_points = 4
x, y = get_geostationary_bounding_box_in_proj_coords(geos_area=geos_area,
                                                     nb_points=nb_points) 
print(x)
print(y) # all 0 

lons, lats = get_geostationary_bounding_box_in_lonlats(geos_area=geos_area,
                                                       nb_points=nb_points)
print(lons)
print(lats) # all 0 

#### get_geostationary_bounding_box_in_proj_coords  returns duplicated values at the equator 
lons, lats = get_geostationary_bounding_box_in_lonlats(geos_area=geos_area,
                                                       nb_points=6)
print(lons)
print(lats)  
lons[2:4] # [79.23372832, 79.23372832]
lats[2:4]  # [-0.00000000e+00, 0.00000000e+00]

Expected Output

The get_geostationary_bounding_box functions in case nbpoints=4 should return the top, left, bottom and right "extent" of the geo disk, instead of the current left and right duplicates.

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.

1 participant