A library for adding new science data products to an observatory control system’s science archive. The library handles uploading FITS files into AWS S3, as well as adding records to the science archive’s database containing the searchable metadata of all available FITS files.
Optional prerequisites may be skipped for reduced functionality.
Python >= 3.6
A running science archive
Write access to the same S3 bucket that the running science archive is using
(Optional) A running OpenTSDB for metrics collection
It is highly recommended that you install and run your python code inside a dedicated python virtual environment.
ocs_ingester package to your python environment:
(venv) $ pip install ocs_ingester
AWS and science archive credentials must be set in order to upload data. Science archive configuration as well as the AWS Bucket can be either passed explicitly or set as environment variables. The rest of the configuration must be set as environment variables.
||Science Archive URL||
||Science Archive Authentication Token. This token must be associated with an admin user.||empty string|
||AWS S3 Bucket Name||
||AWS Access Key with write access to the S3 bucket||empty string|
||AWS Secret Access Key||empty string|
||AWS S3 Default Region||empty string|
||OpenTSDB Host to send metrics to||empty string|
||Set to any value to turn off metrics collection||
||A tag set with the collected metrics to identify where the metrics are coming from||
||Optionally submit metrics asynchronously. This option does not apply when the command line entrypoint is used, in which case metrics are always submitted synchronously. Note that some metrics may be lost when submitted asynchronously.||