Reputation: 1
I am using pyresample to reproject a CONUS GOES-16 file from geostationary to equidistant cylindrical, but the resulting lat/lon grid has a periodic "flaw" (bug?) in it. The variations are small, but reveal themselves in use as an underlying grid for (e.g.) lat/lon lines.
I have posted an issue on the pyresample GitHub, which includes more setup code and a link to sample data, but am also hoping for some timely response(s) here.
The "core" of the code is below. This all functions properly (in its context), but the result is my concern.
# Define 'eqc' parameters proj_dict = {'a': str(EARTH_RADIUS), 'units': 'm', 'proj': 'eqc', 'lat_0': str(lat_0), 'lon_0': str(lon_0)}
`# Get area def for both projections RectDef = get_area_def('eqc', 'eqc', 'eqc', proj_dict, x_size, y_size, area_extent) SwathDef = SwathDefinition(lats=lats[row1:rown, col1:coln], lons=lons[row1:rown, col1:coln])
repro_lat = resample_nearest(SwathDef, lats[row1:rown, col1:coln], RectDef, radius_of_influence=RADIUS_OF_INFLUENCE, epsilon=1)`
# Plot any latitude "row" to illustrate the problem plt.plot(repro_lat[500,:])
`
The issue is shown in the included plot.
Why is this periodic discrepancy in the results?
An examination of the repro_lat
(and lon in the full code) variable shows the flaw throughout the resulting array.
Admittedly, the amplitude is small, but I would expect a row of the lat array to be constant. I see similar issues (though higher in "frequency") in the longitudes. It suggests to me (FWIW) that the "chunking" of the data in pyresample is not handling the chunk "boundaries" correctly?
The problem is revealed when I overlay a lat/lon grid using the results, and the lines show the "wobble" in the underlying lat/lon data. An example graphic is also included.
Again, my concern is that pyresample has a "bug"...
I am confident that the input lat/lon grid is "clean". Larger values of the ROI and epsilon do not change the outcome. I am using conda environments, and both Python 3.9 and 3.11 pull in pyresample 1.26.1.
Is this a bug? I appreciate any feedback and assistance!
Upvotes: 0
Views: 51