HST Calibration Reference Data System (CRDS)


Using CRDS from the Command Line


CRDS uses command line tools or calibration software to identify and automatically download required reference files.

Working with CRDS references typically involves one or more of the following:

Installing CRDS

The current preferred approach is to install CRDS as part of Astroconda.

Configuring UNIX

Onsite users can use shared CRDS files in /grp/crds/cache. No downloads or CRDS configuration are required. Reference environment variables must be pointed at CRDS files:

setenv CRDS_PATH /grp/crds/cache
setenv iref  ${CRDS_PATH}/references/hst/
setenv jref  ${CRDS_PATH}/references/hst/
setenv oref  ${CRDS_PATH}/references/hst/
setenv lref  ${CRDS_PATH}/references/hst/
setenv nref  ${CRDS_PATH}/references/hst/
setenv uref  ${CRDS_PATH}/references/hst/

sh syntax:

export CRDS_PATH="/grp/crds/cache"
export iref="${CRDS_PATH}/references/hst/"
export jref="${CRDS_PATH}/references/hst/"
export oref="${CRDS_PATH}/references/hst/"
export lref="${CRDS_PATH}/references/hst/"
export nref="${CRDS_PATH}/references/hst/"
export uref="${CRDS_PATH}/references/hst/"

For personal or offsite use, configuration requires defining:

setenv CRDS_PATH $HOME/crds_cache
setenv CRDS_SERVER_URL https://hst-crds.stsci.edu
setenv iref  ${CRDS_PATH}/references/hst/iref/
setenv jref  ${CRDS_PATH}/references/hst/jref/
setenv oref  ${CRDS_PATH}/references/hst/oref/
setenv lref  ${CRDS_PATH}/references/hst/lref/
setenv nref  ${CRDS_PATH}/references/hst/nref/
setenv uref  ${CRDS_PATH}/references/hst/uref/

sh syntax:

export CRDS_PATH="$HOME/crds_cache"
export CRDS_SERVER_URL="https://hst-crds.stsci.edu"
export iref="${CRDS_PATH}/references/hst/iref/"
export jref="${CRDS_PATH}/references/hst/jref/"
export oref="${CRDS_PATH}/references/hst/oref/"
export lref="${CRDS_PATH}/references/hst/lref/"
export nref="${CRDS_PATH}/references/hst/nref/"
export uref="${CRDS_PATH}/references/hst/uref/"

This defines where personal copies of CRDS files are stored and which CRDS server is used.

Non-standard onsite configurations (TEST, I&T, DEV) require similar setup and designation of the appropriate server and cache area.

Assigning, obtaining, and caching reference files.

For HST, CRDS has a command line tool that assigns best references to the FITS headers and can also download and cache the best reference files.

crds bestrefs --update-bestrefs --sync-references=1 --files *.fits

Since the files are cached, re-running the tool later will only download those files which have been updated.

Other Notes

Once initialized, CRDS can operate from cache when not connected to the Internet. In this disconnected mode CRDS runs normally but can only assign the best reference files known to the local cache.

CRDS creates and maintains your CRDS cache. Direct edits to files in the cache should be avoided.

Recalibrating to utilize new references should not require redownloading your datasets or previously cached reference files.