GRID
CLASS
- class slcode.grid.GRID
The class GRID is used to represent the Gaussian Grid.
Attributes
Note
This grid have no attribute * this might be changed in future version to be used as stand alone. The absence of attribute is the result of the use of this function in TIME_GRID that use that define all parameters used in the init function of GRID.
Methods
Methods
- slcode.grid.GRID.interp_on(self, grd, lon, lat, smoothing=False, grid_type='global', error=False)
The method interp_on interpolate a grid of data on the grid of the model calculated in the init function of GRID. This function is using stripy library to pursue the interpolation (Stripy library).
Attribute
- grdnp.array([m,n])
The grid data over space.
- lonnp.array([m,])
The longitude of the data.
- latnp.array([n,])
The latitude of the data.
- smoothingbool
If a smoothing is applied to the grid before the interpolation, see smooth_on.
- grid_typestr
grid type define if it’s a grid over the whole world or over a small area. This is used to avoid long computation for the interpolation in the case of interpolating small areas over the world. There is two possible ‘global’ and ‘local’. The global interpolation is using stripy.sTriangulaion. The local interpolation is using stripyt.Triangulation.
- errorbool
If true, the method return the error of the interpolation calculated by stripy.
Return
- grdnp.array([maxdeg*2,maxdeg])
The grid interpolated on the model grid.
- slcode.grid.GRID.smooth_on(self, grd, lon, lat)
The method smooth_on is smoothing the grid over the area whith smoothing. This function can be used to correct values before the interpolation over time and space. This way, you can have better results on topographic convergence.
Attribute
- grdnp.array([m,n])
Array containig the grid values over the space.
- latnparray([n,])
latitude.
- lonnparray([m,])
longitude.
Return
- grdnp.array([m,n])
smoothed array with the same shape then the initial grid.
- slcode.grid.GRID.disk(self, lat, lon, radius, high, tx=1)
disk is a method used to create a thickness grid. This grid can be used to test different parameters.
Attribute
- latnparray([1,])
Array contaning the latitudinal coordinate in degree of the center of the disk.
- lonnparray(1,[])
Array containing the longitudinal coordinate in degree of the center of the disk.
- radiusdouble
The radius in degree of the disk in degree.
- highdouble
The thickness in meter of the disk over the considered area.
Return
- grdnp.array([maxdeg*2,maxdeg])
The grid as defined by the GRID class with a disk of thikness high at lon,lat position with the size of radius.
- slcode.grid.GRID.zeros(self, tx=1)
zeros is a method used to generate a zero array with the caracteristics of the grid.
Attribute :
- txint
times the thickness is repeated
Return :
- np.zeros((tx,self.lats.size,self.elons.size))
An array containing only zeros
- slcode.grid.GRID.along_transect(self, coord=('lat_start', 'lon_start', 'lat_stop', 'lon_stop'), point_density=None, point_distance=None)