Installation

Installing the package

You need to install the package itself. The code is built using python. We suggest creating a dedicated conda environment, but you could also use a virtual environment.

Prerequisite: Creating a conda environment

In most cases, you can do the following:

conda create -n mirar python=3.11
conda activate mirar
pip install --upgrade pip

However, if you are using a new Mac with an arm chip, you might run into trouble. Instead, we suggest:

conda create -n mirar
conda activate mirar
conda config --env --set subdir osx-64
conda install python=3.11
pip install --upgrade pip

Option 1: Installing via pip

The easiest way to install mirar is via pip:

pip install mirar

This will install the latest version of mirar from PyPI.

This method is recommended if you just want to use mirar without making changes.

Option 2: Installing via git

Downloading

You can alternatively grab the latest version of the code from github:

git clone git@github.com:winter-telescope/mirar.git
cd mirar

This method is recommended if you want to contribute to the code.

Installing python dependencies

Next you need to actually install mirar. We use poetry to manage dependencies:

pip install poetry
poetry install

Lastly, you need to install the pre-commit hooks (see Contributing Guide for more info about what these do):

pre-commit install

Now you should have installed mirar. You can check it worked by opening up python and trying to import it:

python
>>> from mirar.paths import PACKAGE_NAME
>>> print(f"This is the {PACKAGE_NAME} package")
This is the mirar package

Non-python dependencies

Finally you meed to install any optional dependencies that you might want to use. We again recommend using conda. Whether you need these dependencies depends on your intended usage of mirar.

Dependencies include:

PostgreSQL is relatively straightforward to install via the official website. The other packages might be more complicated, and will depend on your platform.

In general, you can install these packages in any way you like. We provide you with a few tips below, but if the packages are already available on your system, you should not need to install them again.

Astrometry.net

To run astrometry solutions with Astrometry.net (the default for SEDMv2), you’ll need to download Astrometry.net locally, as outlined here. Once you have a local version, there should be an astrometry-net folder somewhere on your machine. If you used Homebrew, it should be here:

/opt/homebrew/Cellar/astrometry-net/

Then, make sure to also grab index files from this directory and save them under

.../astrometry-net/<version>/data

astromatic software with apt-get (Linux only)

You can use apt-get if you are running Debian-based Linux:

sudo apt-get update
sudo apt-get install -y sextractor scamp swarp psfex
sudo ln -s /usr/bin/source-extractor /usr/bin/sex
sudo ln -s /usr/bin/SWarp /usr/bin/swarp

The latter two lines are to ensure that source-extractor/swarp can be called from the command line in the way expected by mirar.

astromatic software with conda (Linux, Mac or Windows)

You can try installing things via conda:

conda install -c conda-forge astromatic-source-extractor astromatic-scamp astromatic-swarp astromatic-psfex