SatResample.jl
is a package for gridding and resampling satellite data with the focus on ease of use.
Grid(projection, xlimits, ylimits, resolution)
projection
: aProj4.Projection
instance, can be create from a proj4 string or an EPSG asProj4.Projection(proj4.epsg[#])
(see Proj4.jl)xlimits
: a tuple with the minimum and maximum value of the first projection coordinate.ylimits
: like xlimits buy for the second coordinate.resolution
: the grid resolution in projection coordinates.
A common case is when some satellite data comes in swath files or granules and one has the lat and lon values for each point and want to put several of these together on a map.
llresample(lon, lat, data, grid, maxdist, nneighbor)
lon
,lat
: longitudes and latitudes in 1d array or list. It does not need to be geographically sorted.data
: the data to be resampled, can either be- a1d array of the same size of
lat
andlon
or - a collection of 1d arrays with with each having the same length fo
lat
andlon
. This is for gridding several datasets with the same inputlat
andlon
combinations to a common grid, e.g., several spectral channels.
- a1d array of the same size of
grid
: aGrid
instance of the desired target grid.maxdist
: the maximum distance allowed to each grid point.nneighbor
: the maximum number of neighbors to be taken into account.
For convenience, a grid constructor (stereograpic projection) can be used to create local grids where the cartesian coordanes are in meters like
gen_ps_grid(clon, clat, width, height, resolution, rotation)
clon
: center longitude of the gridclat
: center latitude of the gridwidth
: width of the grid in the local grid coordinates, i.e., meters.height
: height of the grid in metersresolution
: grid resolution in metersrotation
: the rotation, 0° means North is up.
This package uses NearestNeighbors.jl for resampling.