geopathfinder.naming_conventions namespace¶
Submodules¶
geopathfinder.naming_conventions.acube_naming module¶
ACube file name definition.
- class geopathfinder.naming_conventions.acube_naming.ACubeFilename(fields, ext='.tif', convert=False, compact=False)[source]¶
Bases:
SmartFilenameACube file name definition using SmartFilename class.
- decode_date(string)[source]¶
Decodes a string into a datetime.date object. The format is given by the class.
- decode_time(string)[source]¶
Decodes a string into a datetime.time/datetime.date object. The format is given by the class and the conversion follows the ‘single_date’ setting.
- delimiter = '_'¶
- encode_date(time_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- encode_time(time_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- property etime¶
End time.
- Returns:
End time.
- Return type:
- fields_def = {'algorithm': {'len': 7}, 'direction': {'len': 1}, 'dtime_1': {'len': 8}, 'dtime_2': {'len': 8}, 'grid_name': {'len': 6}, 'pol': {'delim': '', 'len': 2}, 'product': {'delim': '', 'len': 7}, 'sat_name': {'len': 3}, 'tile_name': {'len': 10}, 'var_name': {'len': 9}}¶
- classmethod from_filename(filename_str, convert=False, compact=False)[source]¶
Converts a filename given as a string into an ACubeFilename class object.
- Parameters:
- Returns:
Class representing an ACube file name.
- Return type:
- property ftile¶
Builds the full tile name from other filename attributes (e.g. ‘EU010M_E048N015T1’).
- Returns:
ftile – Full tile name consisting of grid name (e.g., ‘EU10M’) and tile name (e.g., ‘E048N015T1’).
- Return type:
- pad = '-'¶
- property stime¶
Start time.
- Returns:
Start time.
- Return type:
- property time¶
Unified time.
- Returns:
Unified time.
- Return type:
geopathfinder.naming_conventions.bmon_naming module¶
BMon file name definition.
- class geopathfinder.naming_conventions.bmon_naming.BMonFilename(fields, ext='.nc', convert=False, compact=False)[source]¶
Bases:
SmartFilenameBMon file name definition using SmartFilename class.
- decode_timestamp(string)[source]¶
Decodes a string into a datetime.date object. The format is given by the class.
- delimiter = '_'¶
- encode_timestamp(time_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- fields_def = {'sres': {'len': 4, 'start': 17}, 'timestamp': {'len': 14}, 'var_name': {'len': 16}, 'version': {'len': 2}}¶
- classmethod from_filename(filename_str, convert=False, compact=False)[source]¶
Converts a filename given as a string into a BMonFilename class object.
- Parameters:
- Returns:
Class representing a BMON filename.
- Return type:
- pad = '-'¶
geopathfinder.naming_conventions.eodr_naming module¶
eoDR file name definition.
- class geopathfinder.naming_conventions.eodr_naming.EODRFilename(fields, ext='.vrt', convert=False, compact=False)[source]¶
Bases:
SmartFilenameeoDataReaders file name definition using SmartFilename class.
- decode_datetime(string)[source]¶
Decodes a string into a datetime object. The format is given by the class.
- delimiter = '_'¶
- encode_datetime(time_obj)[source]¶
Encodes a datetime object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- property etime¶
” End time.
- Returns:
End time.
- Return type:
- fields_def = {'band': {}, 'counter': {'len': 5}, 'dt_1': {'len': 15}, 'dt_2': {'len': 15}, 'file_num': {}, 'id': {'len': 12}}¶
- classmethod from_filename(filename_str, convert=False, compact=False)[source]¶
Converts a filename given as a string into an EODRFilename class object.
- Parameters:
- Returns:
Class representing an EODR filename.
- Return type:
- pad = '-'¶
- property stime¶
Start time.
- Returns:
Start time.
- Return type:
geopathfinder.naming_conventions.sgrt_naming module¶
SGRT folder and file name definition.
- class geopathfinder.naming_conventions.sgrt_naming.SgrtFilename(fields, ext='.tif', convert=False, compact=False)[source]¶
Bases:
SmartFilenameSGRT file name definition using SmartFilename class.
- decode_date(string)[source]¶
Decodes a string into a datetime.date object. The format is given by the class.
- decode_time(string)[source]¶
Decodes a string into a datetime.time/datetime.date object. The format is given by the class and the conversion follows the ‘single_date’ setting.
- delimiter = '_'¶
- encode_date(time_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- encode_time(time_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is given by the class.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- property etime¶
End time.
- Returns:
End time.
- Return type:
- fields_def = {'dtime_1': {'len': 8}, 'dtime_2': {'len': 8}, 'grid_name': {'len': 6}, 'level': {'delim': '', 'len': 1}, 'mission_id': {'delim': '', 'len': 2}, 'mode_id': {'delim': '', 'len': 2}, 'orbit_direction': {'len': 1}, 'pflag': {'delim': '', 'len': 1}, 'pol': {'delim': '', 'len': 2}, 'product_type': {'delim': '', 'len': 3}, 'relative_orbit': {'len': 3}, 'res_class': {'delim': '', 'len': 1}, 'spacecraft_id': {'delim': '', 'len': 1}, 'tile_name': {'len': 10}, 'var_name': {'len': 9}, 'workflow_id': {'len': 5}}¶
- classmethod from_filename(filename_str, convert=False, compact=False)[source]¶
Converts a filename given as a string into an SgrtFilename class object.
- Parameters:
- Returns:
Class representing an SGRT filename.
- Return type:
- property ftile¶
Builds the full tile name from other filename attributes (e.g. ‘EU010M_E048N015T1’).
- Returns:
ftile – Full tile name consisting of grid name (e.g., ‘EU10M’) and tile name (e.g., ‘E048N015T1’).
- Return type:
- pad = '-'¶
- property product_id¶
Builds product id from other filename attributes (e.g. ‘S1AIWGRDH’).
- Returns:
product_id – Product id consisting of mission id (e.g., ‘S1’), spacecraft id (e.g., ‘A’), mode id (e.g., ‘IW’), product type (e.g., ‘GRD’) and resolution class (e.g., ‘H’).
- Return type:
- property stime¶
Start time.
- Returns:
Start time.
- Return type:
- property time¶
Unified time.
- Returns:
Unified time.
- Return type:
- geopathfinder.naming_conventions.sgrt_naming.sgrt_path(root, mode=None, group=None, datalog=None, product=None, wflow=None, grid=None, tile=None, var=None, qlook=True, make_dir=False)[source]¶
Realisation of the full SGRT folder naming convention, yielding a single SmartPath.
- Parameters:
root (str) – root directory of the path. must contain satellite sensor at toplevel. e.g. “R:Datapool_processedSentinel-1_CSAR”
mode (str) – e.g “IWGRDH”
group (str, optional) – “preprocessed” or “parameters” or “products”
datalog (str, optional) – must be “datasets” or “logfiles”
product (str) – e.g. “ssm”
wflow (str) – e.g. “C1003”
grid (str) – e.g. “EQUI7_EU500M”
tile (str) – e.g. “E048N012T6”
var (str) – e.g. “ssm”
qlook (bool) – if the quicklook subdir should be integrated
make_dir (bool) – if the directory should be created on the filesystem
- Returns:
Object for the path
- Return type:
- geopathfinder.naming_conventions.sgrt_naming.sgrt_tree(root, target_level=None, register_file_pattern=None, subset_level=None, subset_pattern=None, subset_unique=False)[source]¶
Realisation of the full SGRT folder naming convention, yielding a SmartTree(), reflecting all subfolders as SmartPath()
- Parameters:
root (str) – top level directory of the SGRT dataset, which is the sensor name in the SGRT naming convention. E.g.: “R:Datapool_processedSentinel-1_CSAR”
target_level (str, optional) – Can speed up things: Level name of target tree-depth. The SmartTree is only built from directories reaching this level, and only built down to this level. If not set, all directories are built down to deepest depth.
register_file_pattern (str tuple, optional) – strings defining search pattern for file search for file_register e.g. (‘C1003’, ‘E048N012T6’). No asterisk is needed (‘*’)! Sequence of strings in given tuple is crucial! Be careful: If the tree is large, this can take a while!
subset_level (str tuple, optional) – Name of level in tree’s hierarchy where the subset should be applied e.g. (‘tile’). Default level is (‘grid’)
subset_pattern (str tuple, optional) – Strings defining search pattern for subset_level, meaning only paths matching this pattern at “subset_level” will be included in the SmartTree(). Default pattern is (‘EQUI7’). e.g. (‘EQUI7’, ‘500M’), or (‘500M’). No asterisk is needed (‘*’)! Sequence of strings in given tuple is crucial!
subset_unique (bool, optional) –
- defines of the subset will deliver…
- True: just one single subtree that matches uniquely the subset_pattern,
and which is rebased to the subset_level.
False: all subtrees that match the subset_pattern (Default).
- Returns:
Object for the SGRT tree.
- Return type:
geopathfinder.naming_conventions.yeoda_naming module¶
Yeoda folder and file name definition.
- class geopathfinder.naming_conventions.yeoda_naming.YeodaFilename(fields, ext='.tif', convert=False)[source]¶
Bases:
SmartFilenameYeoda file name definition using SmartFilename class.
- decode_datetime(string)[source]¶
Decodes a string into a datetime.datetime object. The format is defined based on the string itself.
- delimiter = '_'¶
- encode_datetime(datetime_obj)[source]¶
Encodes a datetime.datetime/datetime.date object into a string. The format is selected by the input type.
- Parameters:
time_obj (datetime.datetime, datetime.date or object) – Datetime object needed to be encoded to a string.
- Returns:
Original object or str object parsed from the given datetime object.
- Return type:
- encode_extra_field(relative_orbit)[source]¶
Encodes the extra field e.g. a relative orbit number into a string.
- property etime¶
End time.
- Returns:
End time.
- Return type:
- fields_def = {'band': {'len': 0}, 'creator': {'len': 0}, 'data_version': {'len': 0}, 'datetime_1': {'len': 0}, 'datetime_2': {'len': 0}, 'extra_field': {'len': 0}, 'grid_name': {'len': 0}, 'sensor_field': {'len': 0}, 'tile_name': {'len': 0}, 'var_name': {'len': 0}}¶
- classmethod from_filename(filename_str, convert=False)[source]¶
Converts a filename given as a string into an YeodaFilename class object.
- Parameters:
- Returns:
Class representing an Yeoda filename.
- Return type:
- property ftile¶
Builds the full tile name from other filename attributes (e.g. ‘EU010M_E048N015T1’).
- Returns:
ftile – Full tile name consisting of grid name (e.g., ‘EU10M’) and tile name (e.g., ‘E048N015T1’).
- Return type:
- pad = '-'¶
- property stime¶
Start time.
- Returns:
Start time.
- Return type:
- property time¶
Unified time.
- Returns:
Unified time.
- Return type:
- geopathfinder.naming_conventions.yeoda_naming.yeoda_path(root, product, data_version, grid=None, tile=None, qlook=True, make_dir=False)[source]¶
Realisation of the full yeoda folder naming convention, yielding a single SmartPath. If a keyword is not specified, the yeoda_path is shorthanded, until one level above the missing keyword
- Parameters:
root (str) – root directory of the path. must contain satellite sensor at toplevel. e.g. “R:Datapool_processedSentinel-1_CSAR”
product (str) – e.g. “ssm”
grid (str, optional) – e.g. “EQUI7_EU500M”
tile (str, optional) – e.g. “E048N012T6”
qlook (bool, optional) – if the quicklook subdir should be integrated
make_dir (bool, optional) – if the directory should be created on the filesystem
- Returns:
Object for the path
- Return type:
- geopathfinder.naming_conventions.yeoda_naming.yeoda_tree(root, target_level=None, register_file_pattern=None, subset_level='grid', subset_pattern='EQUI7', subset_unique=False)[source]¶
Realisation of the full yeoda folder naming convention, yielding a SmartTree(), reflecting all compatible subfolders as SmartPath()
- Parameters:
root (str) – top level directory of the dataset, which is the sensor name in the SGRT naming convention. E.g.: “R:Datapool_processedSentinel-1_CSAR”
target_level (str, optional) – Can speed up things: Level name of target tree-depth. The SmartTree is only built from directories reaching this level, and only built down to this level. If not set, all directories are built down to deepest depth.
register_file_pattern (str tuple, optional) – strings defining search pattern for file search for file_register e.g. (‘V01R03’, ‘E048N012T6’). No asterisk is needed (‘*’)! Sequence of strings in given tuple is crucial! Be careful: If the tree is large, this can take a while!
subset_level (str tuple, optional) – Name of level in tree’s hierarchy where the subset should be applied e.g. (‘tile’). Default level is (‘grid’)
subset_pattern (str tuple, optional) – Strings defining search pattern for subset_level, meaning only paths matching this pattern at “subset_level” will be included in the SmartTree() Default pattern is (‘EQUI7’). e.g. (‘EQUI7’, ‘500M’), or (‘500M’). No asterisk is needed (‘*’)! Sequence of strings in given tuple is crucial!
subset_unique (bool, optional) –
- defines of the subset will deliver…
- True: just one single subtree that matches uniquely the subset_pattern,
and which is rebased to the subset_level.
False: all subtrees that match the subset_pattern (Default).
- Returns:
Tree object for the yeoda dataset.
- Return type: