Comments (3)
From jakob.malm on May 19, 2010 10:25:19
Would grid.get_image_from_lonlats do this? I tried the code below, but my area_def
may be completely wrong. I have a rotated lon/lat NWP field, tsur, obtained using
pygrib. The grid is defined in the GRIB file by the following:
first grid point (lon: -22.6°, lat: -31.0°)
last grid point (lon: 38.4°, lat: 30.0°)
southern pole (lon: -10°, lat: -30°)
angle of rotation: 0°
In mind, the following python code should return an array with values very similar to
tsur.values, because tsur.latlons() fills the grid. Instead, the values have a much
reduced range.
area_def = pyresample.utils.get_area_def('hirl', 'HIRLAM NWP area', 'rotated_ll',
'+proj=ob_tran +o_proj=longlat +lon_0=-10 +o_lat_p=-30', 306, 306, (-23, -31, 38, 30))
lons = tsur.latlons()[1]
lats = tsur.latlons()[0]
tsur_resampled = pyresample.grid.get_image_from_lonlats(lons, lats, area_def,
tsur.values)
Another, even simpler, test, which should also return the same values:
tsur_resampled = pyresample.grid.get_resampled_image(area_def, area_def, tsur.values)
Instead of the same values, the resulting array is built of many tiles, and the value
range is much reduced in this case too.
Is it perhaps not possible to use rotated lon/lat projections with these functions?
from pyresample.
From [email protected] on June 01, 2010 12:57:16
[The answer here is purely informative since we solved the problem together with Jakob.]
In your case, you should use pyresample.swath.resample_* instead:
You have the input lons and lats, and the target lons and lats, so for example:
result_array = pyresample.swath.resample_nearest(lons.ravel(), lats.ravel(),
mydata.ravel(), target_area_def, 5e4)
where target_area_def is a stack of both lons and lats.
Martin
from pyresample.
From [email protected] on June 21, 2010 01:05:34
The API has changed in 0.6.0 in order to make this use-case more transparent. Please refer to the documentation.
Status: Fixed
from pyresample.
Related Issues (20)
- Time for spherical intersection almost doubled in recent version of pyresample
- `get_neighbour_info` slows down significantly when working with large target rasters using many segments HOT 3
- `gradient_search` fails when resampling Himawari data HOT 7
- EWA resampling in 1.27 slows down four times than 1.26.1 HOT 69
- Refactor boundary creation logic
- area definition for a rotated pole coordinate system HOT 24
- Index Error when calling `boundary` with non full disk geos ara HOT 5
- Bug where boundary coordinates wrap around 180 degrees when geostationary AreaDefinition extends beyond 180 degrees HOT 7
- Upgrade to Cython 3.0 and check annotations
- Compatibility with libproj v9.3 HOT 23
- How should this warning be addressed? HOT 2
- Catch or fix pyproj UserWarning when loading an AreaDefinition from a netCDF/CF file HOT 1
- Make a Swath definition subclass for interpolated data HOT 4
- The finding of the optimal radius of influence makes assumption on the ordering of the dimensions in the longitude array HOT 4
- Wrong coordinates returned by `AreaDefintion.get_lonlats` for some projections in out-of-Earth locations HOT 6
- dump DynamicAreaDefinition to YAML
- errors in area definition should not be silently ignored HOT 1
- Resampling GOES mesoscale data to my area gives blank data HOT 10
- Remove Configobj as Dependency Due To Security Vulnerability and No Longer Maintaned HOT 3
- YAML area configuration does not allow to specify the dtype and dtype is ignored in equality comparisons HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyresample.