LSL Configuration Manager¶
Module for managing configuration parameters for LSL
- lsl.config.LSL_CONFIG = <config.LSLConfigContainer filename=/home/docs/.lsl/lsl.cfg, _param_changed=True, _version_changed=True, _parameters=OrderedDict([('observing.observer_name', <config.LSLConfigParameter name=observing.observer_name, value=None, help=Observer name for auto-filling Observer classes, is_optional=True>), ('observing.observer_id', <config.LSLConfigParameter name=observing.observer_id, value=None, help=Observer ID number for auto-filling Observer classes, is_optional=True>), ('observing.project_name', <config.LSLConfigParameter name=observing.project_name, value=None, help=Project name for auto-filling Project classes, is_optional=True>), ('observing.project_id', <config.LSLConfigParameter name=observing.project_id, value=None, help=Project ID for auto-filling Project classes, is_optional=True>), ('ldp.drx_buffer_size', <config.LSLConfigParameter name=ldp.drx_buffer_size, value=20, help=DRX ring buffer size in timestamps, is_optional=False>), ('ldp.drx_autofill_size', <config.LSLConfigParameter name=ldp.drx_autofill_size, value=50, help=maximum DRX gap in timestamps that can be auto-filled with zeros without throwing a timetag error/warning, is_optional=False>), ('ldp.tbx_buffer_size', <config.LSLConfigParameter name=ldp.tbx_buffer_size, value=25, help=TBX ring buffer size in timestamps, is_optional=False>), ('ldp.cor_buffer_size', <config.LSLConfigParameter name=ldp.cor_buffer_size, value=5, help=COR ring buffer size in timestamps, is_optional=False>), ('astro.leapsec_url', <config.LSLConfigParameter name=astro.leapsec_url, value=https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat, help=URL for accessing leap second information, is_optional=False>), ('ionosphere.igs_url', <config.LSLConfigParameter name=ionosphere.igs_url, value=ftps://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/, help=primary URL for accessing the IGS data products, is_optional=False>), ('ionosphere.igs_mirror', <config.LSLConfigParameter name=ionosphere.igs_mirror, value=ftp://gssc.esa.int/gnss/products/ionex/, help=mirror URL for accessing the IGS data products, is_optional=True>), ('ionosphere.jpl_url', <config.LSLConfigParameter name=ionosphere.jpl_url, value=ftps://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/, help=primary URL for accessing the JPL data products, is_optional=False>), ('ionosphere.jpl_mirror', <config.LSLConfigParameter name=ionosphere.jpl_mirror, value=ftp://gssc.esa.int/gnss/products/ionex/, help=mirror URL for accessing the JPL data products, is_optional=True>), ('ionosphere.emr_url', <config.LSLConfigParameter name=ionosphere.emr_url, value=ftps://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/, help=primary URL for accessing the EMR data products, is_optional=False>), ('ionosphere.emr_mirror', <config.LSLConfigParameter name=ionosphere.emr_mirror, value=ftp://gssc.esa.int/gnss/products/ionex/, help=mirror URL for accessing the EMR data products, is_optional=True>), ('ionosphere.uqr_url', <config.LSLConfigParameter name=ionosphere.uqr_url, value=ftps://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/, help=primary URL for accessing the UQR data products, is_optional=False>), ('ionosphere.uqr_mirror', <config.LSLConfigParameter name=ionosphere.uqr_mirror, value=ftp://gssc.esa.int/gnss/products/ionex/, help=mirror URL for accessing the UQR data products, is_optional=True>), ('ionosphere.code_url', <config.LSLConfigParameter name=ionosphere.code_url, value=ftps://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/, help=primary URL for accessing the CODE data products, is_optional=False>), ('ionosphere.code_mirror', <config.LSLConfigParameter name=ionosphere.code_mirror, value=ftp://gssc.esa.int/gnss/products/ionex/, help=mirror URL for accessing the CODE data products, is_optional=True>), ('ionosphere.ustec_url', <config.LSLConfigParameter name=ionosphere.ustec_url, value=http://www.ngdc.noaa.gov/stp/iono/ustec/products/, help=primary URL for accessing the USTEC data products, is_optional=False>), ('ionosphere.ustec_mirror', <config.LSLConfigParameter name=ionosphere.ustec_mirror, value=None, help=mirror URL for accessing the USTEC data products, is_optional=True>), ('ionosphere.glotec_url', <config.LSLConfigParameter name=ionosphere.glotec_url, value=https://s ervices.swpc.noaa.gov/experimental/products/glotec/geojson_2d_urt/ , help=primary URL for accessing the GloTEC data products, is_optional=False>), ('ionosphere.glotec_mirror', <config.LSLConfigParameter name=ionosphere.glotec_mirror, value=None, help=mirror URL for accessing the GloTEC data products, is_optional=True>), ('ionosphere.max_cache_size', <config.LSLConfigParameter name=ionosphere.max_cache_size, value=-1, help=maximum cache size in MB; <= 0 disables cache size limiting, is_optional=False>), ('telemetry.enabled', <config.LSLConfigParameter name=telemetry.enabled, value=True, help=whether or not LSL telemetry reporting is enabled, is_optional=False>), ('telemetry.max_entries', <config.LSLConfigParameter name=telemetry.max_entries, value=100, help=maximum number of entries to accumlate before reporting, is_optional=False>), ('telemetry.timeout', <config.LSLConfigParameter name=telemetry.timeout, value=30, help=upload timeout in seconds, is_optional=False>), ('download.block_size', <config.LSLConfigParameter name=download.block_size, value=8192, help=download block size in bytes, is_optional=False>), ('download.timeout', <config.LSLConfigParameter name=download.timeout, value=120, help=download timeout in seconds, is_optional=False>), ('download.refresh_age', <config.LSLConfigParameter name=download.refresh_age, value=14, help=data cache refresh age in days, is_optional=False>)])>¶
The LSLConfigContainer that users should use
Data Access and Download Utilities¶
- lsl.common.data_access.DataAccess = <lsl.common.data_access._DataAccess object>¶
DataAccess instance for accessing LSL software data
- lsl.common.data_access.check_url(url, byte_range=None, verbose=True)¶
Given a URL poll the server for the corresponding file’s size and last modification time and return those as a two-element tuple:
the remote size as reported by ‘Content-Length’,
the URL modification time as reported by the ‘Last-Modified’ HTTP header.
Both will be 0 if there was a problem polling the file.
Note
If byte_range is not None then only the portion of the file between [start_byte, end_byte] is downloaded.
- lsl.common.data_access.download_file(url, filename_or_fh, byte_range=None, verbose=True)¶
Given a URL and either a filename or open file handle, download the URL and write the data. Returns a three-element tuple:
the remote size as reported by ‘Content-Length’,
the number of bytes received, and
the URL modification time as reported by the ‘Last-Modified’ HTTP header.
All three will be 0 if there was a problem downloading the file.
Note
If byte_range is not None then only the portion of the file between [start_byte, end_byte] is downloaded.