auromat.resample module

This module resamples mappings in a given resolution in the plate carree projection, relative to either geodetic or MLat/MLT coordinates.

auromat.resample.ResampleProvider(provider, **kw)[source]

Wrap the given mapping provider by resampling every returned mapping.

Parameters:provider – the provider to wrap

See resample() for masking parameters.

auromat.resample.fixedGrid(pxPerDeg, latMin, latMax, lonMin, lonMax)[source]

Aligns the given bounding box to a fixed plate carree grid as defined by pxPerDeg.

Parameters:lonMin,lonMax – must NOT contain the discontinuity
auromat.resample.plateCarreeResolution(boundingBox, arcsecPerPx)[source]

Approximates the latitude and longitude resolution of a plate carree projection from the given spherical resolution for the area given by the bounding box. The approximation is calculated for the bounding box center.

Parameters:arcsecPerPx – spherical resolution
Return type:tuple (latPxPerDeg, lonPxPerDeg)
auromat.resample.resample(mappingOrCollection, pxPerDeg=25, arcsecPerPx=None, containsPole=None, method='mean')[source]

Returns a new mapping (or collection) where the colors and elevation are resampled into a regular latitude/longitude grid (plate carree projection) with y=latitude and x=longitude.

If ‘mean’ binning is used as resampling method then take into account that this will lead to holes for low elevation angles if a high resampling resolution is used. This is because binning does not interpolate when there are zero data points in a given bin. Mask the mapping by elevation (e.g. 10deg) to get rid of the areas with holes.

Parameters:
  • mappingOrCollection
  • pxPerDeg (None|number|tuple) – tuple (latPxPerDeg, lonPxPerDeg) or a number if both are the same
  • arcsecPerPx (None|number) – spherical resolution, used to approximate pxPerDeg, has precedence over pxPerDeg
  • containsPole (None|bool) – specify True|False to skip pole checking algorithm
  • method – binning: ‘mean’; interpolation: ‘nearest’, ‘linear’, ‘cubic’; Note that linear and cubic take considerably longer and use much more memory while they don’t bring any benefit over ‘nearest’ if the goal is downsampling.
Return type:

a subclass of BaseMapping or MappingCollection

auromat.resample.resampleMLatMLT(mapping, **kw)[source]

Resamples a mapping such that MLat/MLT become regular grids.

See resample() for parameters.