Usage
Configuring variables
mirar has several options for execution. You can pass some of these as arguments, but some e.g tokens or passwords are best included as environment variables.
You can find a full list of variables in env.example:
# This is a sample .env file.
# Duplicate this file as .env in the root of the project
# and update the environment variables to match your
# desired config.
# Data directories
# RAW_DATA_DIR=/path/to/dir
# OUTPUT_DATA_DIR=/path/to/dir
# REF_IMG_DIR=/path/to/dir
# Optional directory for calibration data, if not in RAW_DATA_DIR
# WINTER_CAL_DIRECTORY = /path/to/dir
# ANET_INDEX_DIR=/path/to/anet/index/files
# Credentials and settings for postgres
# DB_USER=<some user like winterdrp>
# DB_PWD=<a secure password perhaps>
# Uncomment variables below if you use a non standard postgres setup
# DB_HOSTNAME=<where the database is>
# DB_NAME=<what the database is called>
# DB_PORT=<which port to access the db>
# DB_SCHEMA=<which schema the tables are located at>
# Admin credentials for postgres user account creation
# PG_ADMIN_USER=<a postgres admin user, often 'postgres' by default on most systems>
# PG_ADMIN_PWD=<password for the user>
# Used by DataframeWriter
# kowalski_user=<username>
# kowalski_pwd=<password>
# Used by SendToFritz
# FRITZ_TOKEN=<token>
# FRITZ_AUTHID=<id>
# Used as default user for ssh/rsyncing in winterdrp/downloader
# SSH_USER=<user>
# Set up emailing
# WATCHDOG_EMAIL=<email_address>
# WATCHDOG_EMAIL_PASSWORD=<password>
# WATCHDOG_EMAIL_RECIPIENTS=<target email address>
# Set maximum number of CPUs to use, with a default of half the available total
# MAX_N_CPU=<integer number of CPUs>
# Set whether to store images in cache, with a default of true
# USE_MIRAR_CACHE=<boolean>
If you have created your own .env file, mirar will try to automatically load the .env file.
You can also set individual variables in the command line:
export RAW_DATA_DIR=/home/astronomer/rawdata
If you have installed mirar via pip, or your .env file is located elsewhere, you can load all of these variables at once using the command line:
set -o allexport
source .env
set +o allexport
Running the code
You can execute mirar via the command line:
python -m mirar -p name-of-pipeline -n night-to-reduce
One example is the following:
python -m mirar -p summer
How can you know which pipelines are available? You can check the documentation here: mirar.pipelines package. Alternatively, you can check via the code:
>>> from mirar.pipelines import Pipeline
>>> print(sorted([x for x in Pipeline.pipelines.keys()]))
['git', 'gmos', 'sedmv2', 'summer', 'wasp', 'winter', 'wirc']
>>> print(sorted([x for x in Pipeline.pipelines.keys()]))
['git', 'gmos', 'sedmv2', 'summer', 'wasp', 'winter', 'wirc']