Skip to content

Commit

Permalink
Pull PSF mask files directly from CRDS
Browse files Browse the repository at this point in the history
  • Loading branch information
kammerje committed Jun 27, 2024
1 parent 66967e9 commit 4753265
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 1 addition & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ With the Anaconda environment created, move to the cloned directory and install
pip install -r requirements.txt
pip install -e .

Note that installing git-lfs from pip does not work as of 25 June 2024. NEW AS OF 1 JUNE 2023: you also need to make the custom PSF mask files before running spaceKLIP for the first time:

::

cd spaceKLIP/
python make_psfmasks.py
Note that installing git-lfs from pip does not work as of 25 June 2024.

Finally, and very importantly, you will need to download the reference files and set the environment variables supporting the functioning of :code:`webbpsf` and :code:`webbpsf_ext`. Instructions to do this can be found at the respective package websites (`WebbPSF <https://webbpsf.readthedocs.io/en/latest/installation.html#installing-the-required-data-files>`_, `WebbPSF_ext <https://github.com/JarronL/webbpsf_ext>`_). Ensure that if you edit your .bashrc file, close and reopen your terminal to fully apply the changes (:code:`source ~/.bashrc` or :code:`source ~/.zshrc` may also work).

Expand Down
12 changes: 8 additions & 4 deletions spaceKLIP/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from astropy.table import Table
from jwst.pipeline import Detector1Pipeline, Image2Pipeline, Coron3Pipeline
from stdatamodels.jwst import datamodels

from .utils import nircam_apname, get_nrcmask_from_apname, get_filter_info

Expand Down Expand Up @@ -485,10 +486,13 @@ def read_jwst_s012_data(self,
maskfile = allpaths[ww][j].replace('.fits', '_psfmask.fits')
if not os.path.exists(maskfile):
if EXP_TYPE[ww][j] == 'NRC_CORON':
maskpath = APERNAME[ww][j] + '_' + FILTER[ww][j] + '.fits'
maskfile = os.path.join(maskbase, maskpath)
if not os.path.exists(maskfile):
maskfile = 'NONE'
# maskpath = APERNAME[ww][j] + '_' + FILTER[ww][j] + '.fits'
# maskfile = os.path.join(maskbase, maskpath)
# if not os.path.exists(maskfile):
# maskfile = 'NONE'
pipeline = Detector1Pipeline()
input = datamodels.open(allpaths[ww][j])
maskfile = pipeline.superbias.get_reference_file(input, 'psfmask')
elif EXP_TYPE[ww][j] == 'MIR_4QPM' or EXP_TYPE[ww][j] == 'MIR_LYOT':
if APERNAME[ww][j] == 'MIRIM_MASK1065':
maskpath = 'JWST_MIRI_F1065C_transmission_webbpsf-ext_v2.fits'
Expand Down

0 comments on commit 4753265

Please sign in to comment.