MetisWISE is the client software for the METIS AIT archive.
It contains a Python library, called metiswise, to connect to the METIS AIT database and to retrieve data from the METIS AIT data server.
MetisWISE uses dependencies from OmegaCEN which are in the process of being made open source. For the moment the dependencies are only only available through a password protected pip channel. The login credentials for that channel can be found on the METIS AIT Archive page on the METIS wiki.
First create your Python environment through your favorite means, for example using venv.
export OMEGACEN_CREDENTIALS=login:password
pip install \
--extra-index-url https://ftp.eso.org/pub/dfs/pipelines/libraries \
--extra-index-url https://ivh.github.io/pycpl/simple/ \
--extra-index-url https://${OMEGACEN_CREDENTIALS}@pip.entropynaut.com/packages/ \
metiswiseA full development environment for MetisWISE can be setup through podman containers. This will create a local PostgreSQL database to play with. See the [METIS_Environmens repository(https://github.com/AstarVienna/METIS_Environments)
Here are several examples of using the METIS Archive from Python
# First import all DataItem classes.
from metiswise.main.aweimports import *
# Create a Python instance of a simulated raw exposure.
my_raw_flat = LM_FLAT_LAMP_RAW(filename="my_simulated_raw.fits")
# Store the FITS file on the data server.
my_raw_flat.store()
# Commit the metadata to the database.
my_raw_flat.commit()# First import all DataItem classes.
from metiswise.main.aweimports import *
# Search for a raw flat.
all_my_raw_flats = LM_FLAT_LAMP_RAW.filename == "my_simulated_raw.fits"
# Check how many there are.
print(len(all_my_raw_flats))
# Get the first one.
my_raw_flat = all_my_raw_flats[0]
# Retrieve the FITS file from the data server
my_raw_flat.retrieve()# First import all DataItem classes.
from metiswise.main.aweimports import *
# Select all raw flats
all_my_raw_flats = LM_FLAT_LAMP_RAW.select_all()
print(len(all_my_raw_flats))
# Query flats on DIT and NDIT
my_interesting_raws = LM_FLAT_LAMP_RAW.det_ndit == 1 && LM_FLAT_LAMP_RAW.det_dit > 10
print(len(all_my_raw_flats))Updating the full METIS AIT Archive goes as follows.
- Ensure the passwords on the wiki are still correct; update if needed.
- Update and publish
commonwise.. - Update and publish
dataserverwise.. - Update and publish MetisWISE; see below.
- Update the METIS_Environments.
- Upgrade the production database. TODO.
- Upgrade the database viewer and data server software. TODO.
- Update the METIS Data Reduction Server Setup.
-
Set the version in
pyproject.tomlto the desired version. -
Build
python3 -m build -
Upload
dist/metiswise-*.tar.gzto https://pip.entropynaut.com/packages/metiswise/