ocssw
V2022
|
Functions | |
def | get_hdf4_content (filename) |
def | get_hdf5_header_plaintext (filename) |
def | get_hdf5_header_xml (filename) |
def | get_mime_data (filename) |
def | is_ascii_file (filename) |
def | is_hdf4 (mime_data) |
def | is_netcdf4 (mime_data) |
def | is_tar_file (file_path) |
def | is_metadata_file (mime_data) |
def | dump_metadata (filename) |
def | readMetadata (filename) |
def | get_attr (text) |
def | get_hdf5_attr (header_text) |
def | get_odl_attr (metatext) |
def | add_xml_group (group, attr) |
def | get_xml_attr (metaxml) |
def | parse_odl (text) |
def | get_value (text, items=None) |
def | set_type (value) |
def | prune_odl (metadict) |
Detailed Description
Routines to parse file metadata.
Function Documentation
◆ add_xml_group()
def seadasutils.MetaUtils.add_xml_group | ( | group, | |
attr | |||
) |
add xml attributes to attr and decend groups
Definition at line 489 of file MetaUtils.py.
◆ dump_metadata()
def seadasutils.MetaUtils.dump_metadata | ( | filename | ) |
Dump file metadata: Call functions to get HDF 4 and HDF 5 header data read ASCII header from MERIS N1 files
Definition at line 130 of file MetaUtils.py.
◆ get_attr()
def seadasutils.MetaUtils.get_attr | ( | text | ) |
:param text: Text containing metadata to be parsed. :return: A dictionary containing metadata attributes.
Definition at line 392 of file MetaUtils.py.
◆ get_hdf4_content()
def seadasutils.MetaUtils.get_hdf4_content | ( | filename | ) |
Returns the header content from an HDF 4 file, which is obtained via 'hdp dumpsds'.
Definition at line 13 of file MetaUtils.py.
◆ get_hdf5_attr()
def seadasutils.MetaUtils.get_hdf5_attr | ( | header_text | ) |
Returns a Python dictionary containing the file metadata passed from header_text. The dictionary keys will the attribute names and the values will be the data values for the attributes.
Definition at line 420 of file MetaUtils.py.
◆ get_hdf5_header_plaintext()
def seadasutils.MetaUtils.get_hdf5_header_plaintext | ( | filename | ) |
Returns the header content plain text from an HDF 5 file which is obtained via 'h5dump -H'.
Definition at line 30 of file MetaUtils.py.
◆ get_hdf5_header_xml()
def seadasutils.MetaUtils.get_hdf5_header_xml | ( | filename | ) |
Returns the header content as XML from an HDF 5 file which is obtained via 'h5dump -Au'.
Definition at line 48 of file MetaUtils.py.
◆ get_mime_data()
def seadasutils.MetaUtils.get_mime_data | ( | filename | ) |
Returns the mime data for the file named in filename as found by running the file command
Definition at line 68 of file MetaUtils.py.
◆ get_odl_attr()
def seadasutils.MetaUtils.get_odl_attr | ( | metatext | ) |
get interesting bits from ODL formatted metadata
Definition at line 454 of file MetaUtils.py.
◆ get_value()
def seadasutils.MetaUtils.get_value | ( | text, | |
items = None |
|||
) |
Interpret text as key/value pairs, if possible.
Definition at line 536 of file MetaUtils.py.
◆ get_xml_attr()
def seadasutils.MetaUtils.get_xml_attr | ( | metaxml | ) |
parse xml formatted metadata
Definition at line 505 of file MetaUtils.py.
◆ is_ascii_file()
def seadasutils.MetaUtils.is_ascii_file | ( | filename | ) |
Returns True if the given file is an ASCII file, False otherwise.
Definition at line 78 of file MetaUtils.py.
◆ is_hdf4()
def seadasutils.MetaUtils.is_hdf4 | ( | mime_data | ) |
Return True when the mime data is from netCDF4/HDF 5 file.
Definition at line 96 of file MetaUtils.py.
◆ is_metadata_file()
def seadasutils.MetaUtils.is_metadata_file | ( | mime_data | ) |
Return True when the mime data is from xml, Landsat L1 file or MSI L1C file.
Definition at line 124 of file MetaUtils.py.
◆ is_netcdf4()
def seadasutils.MetaUtils.is_netcdf4 | ( | mime_data | ) |
Return True when the mime data is from netCDF4/HDF 5 file.
Definition at line 102 of file MetaUtils.py.
◆ is_tar_file()
def seadasutils.MetaUtils.is_tar_file | ( | file_path | ) |
This function is deprecated. Using it is discouraged. Please call tarfile.is_tarfile directly. Returns a boolean telling if the file is a tar archive file.
Definition at line 108 of file MetaUtils.py.
◆ parse_odl()
def seadasutils.MetaUtils.parse_odl | ( | text | ) |
Recursively extract ODL groups and objects.
Definition at line 516 of file MetaUtils.py.
◆ prune_odl()
def seadasutils.MetaUtils.prune_odl | ( | metadict | ) |
Definition at line 556 of file MetaUtils.py.
◆ readMetadata()
def seadasutils.MetaUtils.readMetadata | ( | filename | ) |
Returns a dictionary containing the metadata for the file named by filename.
Definition at line 201 of file MetaUtils.py.
◆ set_type()
def seadasutils.MetaUtils.set_type | ( | value | ) |
Parse string value into correct type
Definition at line 548 of file MetaUtils.py.