Installation#

In all cases, it is strongly recommended to install PyGriFE into a new virtual environment, to minimise dependency conflicts (see [Requirements](#requirements)).

Building from Source#

To clone the latest GitHub repository, use this command:

git clone https://github.com/PJ-Watson/PyGriFE.git

To build and install PyGriFE, run (from the root of the source tree):

python -m pip install .

Alternatively, if grizli and sep are not already installed in the environment, they can be installed by running:

python -m pip install .[grizli,sep]

Necessary Files#

PyGriFE is designed to work with pre-processed grism data, specifically the output from grizli. If you do not have the following files, PyGriFe will not be terribly useful:

  • *GrismFLT.fits” and “*GrismFLT.pkl” files, containing the grism exposures, contamination models, blotted segmentation maps, and direct images.

  • The (un-blotted) segmentation map, used to derive the contamination models ( e.g.nis-wfss-ir_seg.fits” ).

  • The direct images used to create the reference catalogue ( e.g.nis-wfss-ir_drz_sci.fits”, “nis-wfss-{f}_drz_sci.fits” for filters f ).

Requirements#

PyGriFE has been tested with Python 3.10, and is developed primarily on Python 3.11. The following packages are required for the most basic installation, and will be installed automatically if using pip.

Additional Dependencies#

In addition to the packages listed above, PyGriFE requires several other packages to function correctly. These are not installed by default to avoid conflicts with existing installations, but can be given as an option to pip (see Building from Source).

Grizli#

To extract objects, a working installation of grizli is required. PyGriFE modifies some of the grizli class methods in order to extract arbitrary regions, and cannot be guaranteed to work with every version (if PyGriFE encounters any compatibility problems, please raise an issue here, rather than bothering the grizli developers). The current tested version is grizli==1.11.

SEP#

Both PyGriFE and grizli rely on SEP, the Python implementation of Source Extractor (Bertin & Arnouts 1996). Unfortunately, since the original repository no longer appears to be maintained, it is necessary to install the fork maintained at PJ-Watson/sep. This includes several bug fixes, and the functionality necessary to rebuild a catalogue from an existing segmentation map.

GUI#

To run the GUI, the following packages are required:

To install the latest versions automatically during the build process for PyGriFE, run

python -m pip install .[GUI]