Skip to content

AstarVienna/MetisWISE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetisWISE

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.

Installation

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/ \
    metiswise

Podman

A 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)

MetisWISE in Python

Here are several examples of using the METIS Archive from Python

Storing an existing file in the archive

# 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()

Retrieving data from the database

# 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()

Querying using the Python prompt

# 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))

Building and Publishing

Updating the full METIS AIT Archive goes as follows.

  1. Ensure the passwords on the wiki are still correct; update if needed.
  2. Update and publish commonwise..
  3. Update and publish dataserverwise..
  4. Update and publish MetisWISE; see below.
  5. Update the METIS_Environments.
  6. Upgrade the production database. TODO.
  7. Upgrade the database viewer and data server software. TODO.
  8. Update the METIS Data Reduction Server Setup.

MetisWISE

  1. Set the version in pyproject.toml to the desired version.

  2. Build

    python3 -m build
    
  3. Upload dist/metiswise-*.tar.gz to https://pip.entropynaut.com/packages/metiswise/

About

MetisWISE is the software for the METIS AIT Archive

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors