Registry / data / crds
library13.2.5pypypi✓ verified 85d ago

CRDS (Calibration Reference Data System) manages calibration reference files for HST, JWST, and Roman telescopes. It provides tools for selecting, downloading, and validating reference files. Version 13.1.16 supports Python >=3.7 and is actively maintained with regular releases aligned with telescope operations.

pip install crds
INSTALL
IMPORT
SIG · CRDS
C
crds
datapythonv13.2.5
Install
8.4s avg
Import
2890ms
Disk
182MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v13.2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.970s · 173.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.4s · import 2.810s · 174MB
182MB installed
● package 182MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

crds
import crds
Main module. Submodules like crds.client, crds.core are imported as needed.
BestReferences
from crds import BestReferences
from crds.client import BestReferences
BestReferences is imported from the top-level crds module, not from crds.client.

Basic usage: set server, create BestReferences with a context and observation parameters, then retrieve reference file mappings.

import crds from crds import BestReferences # Set server URL (optional, defaults to CRDS server) crds.set_server_url(os.environ.get('CRDS_SERVER_URL', 'https://crdsserver.stsci.edu')) # Get best references for an observation context = 'jwst_ops.pmap' # or use a specific context id obs = {'INSTRUMENT': 'NIRCam', 'DETECTOR': 'NRCA1', 'FILTER': 'F090W', 'DATE-OBS': '2023-01-01'} refs = BestReferences(context, obs) print(refs.get_references())
crds --version
Debug
Known issues
breakingCRDS 11.x dropped Python 2 support. Current versions require Python >=3.7.
fix
Upgrade to latest crds and use Python 3.7+. If you need Python 2 compatibility, stay on legacy versions (not recommended).
affects: <11.0
deprecatedThe function `crds.getreferences()` is deprecated. Use `BestReferences` class instead.
fix
Replace calls to crds.getreferences() with BestReferences context manager or direct instantiation.
affects: >=10.0
gotchaCRDS requires internet access to fetch reference files unless you set up a local cache. Without cache, it downloads files on demand.
fix
Set the environment variable CRDS_PATH to a local directory to cache downloaded files. Use CRDS_SERVER_URL to specify a mirror.
affects: all
gotchaWhen using BestReferences, the observation dictionary must include exact header keywords (case-sensitive). Missing keys cause KeyError.
fix
Always provide required keys: INSTRUMENT, DETECTOR, DATE-OBS, and any filter/grating/band specific to the instrument. Check instrument documentation.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'BestReferences' from 'crds'
Outdated crds version (before 10.0) that doesn't have BestReferences class.
fix
Upgrade crds to latest: pip install --upgrade crds
crds.core.exceptions.CrdsNetworkError: Unable to connect to CRDS server
No internet access or incorrect CRDS_SERVER_URL. CRDS defaults to public STScI server; if blocked, set a mirror.
fix
Check network, set CRDS_SERVER_URL to a reachable server (e.g., https://crdsserver.stsci.edu), or use a local mirror.
KeyError: 'INSTRUMENT'
Observation dictionary missing required key 'INSTRUMENT'.
fix
Include all required keys: INSTRUMENT, DETECTOR, DATE-OBS. Example: obs = {'INSTRUMENT': 'NIRCam', 'DETECTOR': 'NRCA1', 'DATE-OBS': '2023-01-01'}
crds.core.exceptions.CrdsLookupError: No matching reference file found
No reference file for the given context and observation parameters. Could be obsolete context or incorrect parameters.
fix
Use a more recent context (pmap) or check that observation parameters match available reference files. Try context = 'jwst_ops.pmap' for latest.
Upgrade
Version history
13.2.5latest on PyPI · released Jun 18, 2026
Audit
Dependencies
requestsrequiredHTTP requests to CRDS server
astropyoptionalFITS file handling and table operations
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
crds — pip install crds · libregistry