module documentation

Module to add some functions post-process the data from EGMS, with `EGMStoolkit`

The module adds some functions, required by EGMStoolkit to post-process the EGMS data.

(From EGMStoolkit package)
Changelog:
  • 0.2.11: Fix regarding the input and output directory for data gridding, Aug. 2024, Alexis Hrysiewicz
  • 0.2.9: A correction of typo., Apr. 2024, Alexis Hrysiewicz
  • 0.2.6: Bug fixes regarding the windows system + GDAL version (some information), Feb. 2024, Alexis Hrysiewicz
  • 0.2.5: Add the interpolation processing for the .vrt file + optional function arguments for "duplicate" point and vrt files, Feb. 2024, Alexis Hrysiewicz
  • 0.2.4: Add the possibility to merge the L3 .csv file into a .vrt file and fix the problem with the L2 datasets, Feb. 2024, Alexis Hrysiewicz
  • 0.2.3: Add the possibility to merge the L2 .csv file into a .vrt file (but can fail), Feb. 2024, Alexis Hrysiewicz
  • 0.2.2: Optimisation of clipping based on ogr2ogr, Feb. 2024, Alexis Hrysiewicz
  • 0.2.1: Remove the duplicate points for L2 datasets, Feb. 2024, Alexis Hrysiewicz
  • 0.2.0: Script structuring, Jan. 2024, Alexis Hrysiewicz
  • 0.1.0: Initial version, Nov. 2023
Function convertcsv Interpolation of the data into a .tif raster
Function dataclipping Clip the datasets
Function datagridding Interpolation of the data into a .tif raster
Function datamergingcsv Merge the datasets in csv format
Function datamergingtiff Merge the datasets in tiff format (only for L3 level)
Function filemergingcsv Sub-function to merge the data in .csv format
Function filemergingcsvvrt Sub-function to merge the data in .csv format by using the .vrt format (only for L2a/L2b datasets and constant headers)
Function filemergingtiff Sub-function to merge the geotiff data
Function listtodictmerged Sub-function to conver the list of a merged dictionary
Function removerawdata Delete the raw dataset(s) from EGMS
Variable latlon_to_meter Pyproj class Lat/lon (epsg:4326) to meter (epsg:3035)
Variable meter_to_latlon Pyproj class meter (epsg:3035) to Lat/lon (epsg:4326)
Variable source_crs Source CRS.
Variable target_crs Target CRS.
def convertcsv(outputdir: Optional[str] = '.'+os.sep+'Output', inputdir: Optional[str] = '.'+os.sep+'Output', namefile: Optional[Union[bool, None]] = 'all', format: Optional[Union[bool, None]] = 'ESRI Shapefile', verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Interpolation of the data into a .tif raster

Parameters
outputdir:str, OptionalOutput directory [Default: './Ouput']
inputdir:str, OptionalInput directory [Default: './Ouput']
namefile:strFile name for interpolation [Default: 'all']
format:strFormat of the output file [Default: 'ESRI Shapefile']
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
def dataclipping(outputdir: Optional[str] = '.'+os.sep+'Output', inputdir: Optional[str] = '.'+os.sep+'Output', namefile: Optional[str] = 'all', shapefile: Optional[str] = 'bbox.shp', __clipuseogr2ogr__: Optional[bool] = False, verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Clip the datasets

Parameters
outputdir:str, OptionalInput directory [Default: './Ouput']
inputdir:str, OptionalInput directory [Default: './Ouput']
namefile:str, OptionalName of the selected file [Default: 'all']
shapefile:str, OptionalShapefile of the ROI [Default: 'bbox.sph']
__clipuseogr2ogr__:bool, optionalUse ogr2ogr for clipping [Default: False]
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
def datagridding(paragrid, outputdir: Optional[str] = '.'+os.sep+'Output', inputdir: Optional[str] = '.'+os.sep+'Output', namefile: Optional[Union[bool, None]] = 'all', verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Interpolation of the data into a .tif raster

Parameters
paragrid:dictDictionnary of the interpolation parameters
outputdir:str, OptionalOutput directory [Default: './Ouput']
inputdir:str, OptionalInput directory [Default: './Ouput']
namefile:strFile name for interpolation [Default: 'all']
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
def datamergingcsv(outputdir: Optional[str] = '.'+os.sep+'Output', inputdir: Optional[str] = '.'+os.sep+'Output', paratosave: Optional[any] = 'all', mode: Optional[str] = 'onlist', infoEGMSdownloader: Optional[any] = None, __removeduplicate__: Optional[bool] = True, __length_threshold__: Optional[int] = 1000, __usevrtmerging__: Optional[bool] = False, verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Merge the datasets in csv format

Parameters
outputdir:str, OptionalInput directory [Default: './Ouput']
inputdir:str, OptionalInput directory [Default: './Ouput']
paratosave:str, OptionalSelected parameters [Default: 'all']
mode:str, OptionalMode on selection. Can be 'onlist' or 'onfiles' [Default: 'onlist']
infoEGMSdownloader:str, OptionalClass of EGMSdownloader. Can be 'onlist' or 'onfiles' [Default: None]
__removeduplicate__:boolRemove the duplicate points [Default: True]
__length_threshold__:intLength for the concave hull [Default: 1000]
__usevrtmerging__:boolUse the vrt for merging [Default: False]
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
def datamergingtiff(outputdir: Optional[str] = '.'+os.sep+'Output', inputdir: Optional[str] = '.'+os.sep+'Output', paratosave: Optional[any] = 'all', mode: Optional[str] = 'onlist', infoEGMSdownloader: Optional[any] = None, verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Merge the datasets in tiff format (only for L3 level)

Parameters
outputdir:str, OptionalInput directory [Default: './Ouput']
inputdir:str, OptionalInput directory [Default: './Ouput']
paratosave:str, OptionalSelected parameters [Default: 'all']
mode:str, OptionalMode on selection. Can be 'onlist' or 'onfiles' [Default: 'onlist']
infoEGMSdownloader:str, OptionalClass of EGMSdownloader. Can be 'onlist' or 'onfiles' [Default: None]
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
def filemergingcsv(inputdir, outputdir, name, listfile, paratosave, mode_duplicate, length_duplicate, verbose, log): (source)

Sub-function to merge the data in .csv format

Parameters
inputdir:strInput directory
outputdir:strInput directory
name:strName of the selected file
listfile:listList of files
paratosave:listLists of saved parameters
mode_duplicate:boolMode to remove the duplicate points
length_duplicate:intLength for concave hull
verbose:boolVerbose
log:str or NoneLog file
def filemergingcsvvrt(inputdir, outputdir, name, listfile, paratosave, mode_duplicate, length_duplicate, verbose, log): (source)

Sub-function to merge the data in .csv format by using the .vrt format (only for L2a/L2b datasets and constant headers)

Warning: there is a bug with the raw .csv files if the duplicate mode is False and all parameters are saved.

Parameters
inputdir:strInput directory
outputdir:strInput directory
name:strName of the selected file
listfile:listList of files
paratosave:listLists of saved parameters
mode_duplicate:boolMode to remove the duplicate points
length_duplicate:intLength for concave hull
verbose:boolVerbose
log:str or NoneLog file
def filemergingtiff(inputdir, outputdir, name, listfile, verbose, log): (source)

Sub-function to merge the geotiff data

Parameters
inputdir:strInput directory
outputdir:strInput directory
name:strName of the selected file
listfile:listList of files
verbose:boolVerbose
log:str or NoneLog file
def listtodictmerged(list): (source)

Sub-function to conver the list of a merged dictionary

Parameters
list:listList of files
Returns
filedict (dict) release (str) level (str) track (str) L3compall (str)
def removerawdata(inputdir: Optional[str] = '.'+os.sep+'Output', forcemode: Optional[bool] = False, verbose: Optional[bool] = True, log: Optional[Union[str, None]] = None): (source)

Delete the raw dataset(s) from EGMS

Parameters
inputdir:str, OptionalInput directory [Default: './Ouput']
forcemode:bool, OptionalForce mode [Default: False]
verbose:bool, OptionalVerbose [Default: True]
log:str or None, OptionalLog file [Default: None]
latlon_to_meter = (source)

Pyproj class Lat/lon (epsg:4326) to meter (epsg:3035)

meter_to_latlon = (source)

Pyproj class meter (epsg:3035) to Lat/lon (epsg:4326)

source_crs: str = (source)

Source CRS.

target_crs: str = (source)

Target CRS.