Telescope Profiles#
Telescope profiles define how FITS keywords are mapped to canonical field names, what unit conversions to apply, and observatory metadata.
Profile Format#
Profiles are YAML files in the profiles/ directory:
name: ccat
version: 2
match_rules:
- TELESCOP: "CCAT"
- TELESCOP: "FYST"
keyword_map:
mjd: MJD-OBS
elevation: ELEVATIO
azimuth: AZIMUTH
signal_freq: OBSFREQ
sobsmode: SOBSMODE
otf_lon_base: LAMOFF
otf_lon_pixel: PIXOFFX
otf_lat_base: BETOFF
otf_lat_pixel: PIXOFFY
unit_conversions:
signal_freq: MHz_to_Hz
elevation: deg_to_rad
otf_lon: arcsec_to_deg
inject:
observatory: CCAT
site_latitude_deg: -22.9586
site_longitude_deg: -67.7875
site_altitude_m: 5612.0
defaults:
freq_off: 0.0
tcold: 77.0
atm_table:
freq_min_ghz: 200.0
freq_max_ghz: 1200.0
freq_step_mhz: 1.0
pwv_low_mm: 0.05
pwv_high_mm: 0.50
Profile Auto-Detection#
When no --profile override is given, profiles are tested against
the first FITS file’s header in alphabetical order. The first profile
whose match_rules all match is selected. If none match,
generic.yaml is used as fallback.
Embedded Profiles#
Profiles are embedded at compile time via include_str! in
zarr-fits-core/src/embedded_profiles.rs. This means the binary
works without an external profiles/ directory.
Current profiles:
ccat.yaml— CCAT/FYST telescopesofia_upgreat.yaml— SOFIA/upGREAT airborne observatorygeneric.yaml— fallback for unknown telescopes
Adding a New Telescope#
Create
profiles/<telescope_name>.yamlDefine
match_rulesfor auto-detection from FITS headersMap all required keywords in
keyword_mapSet
injectfields for observatory metadataAdd the file to
embedded_profiles.rs:pub const NEW_TELESCOPE_YAML: &str = include_str!("../../../profiles/new_telescope.yaml"); pub const ALL: &[(&str, &str)] = &[ ("sofia_upgreat.yaml", SOFIA_UPGREAT_YAML), ("ccat.yaml", CCAT_YAML), ("new_telescope.yaml", NEW_TELESCOPE_YAML), // ← add ("generic.yaml", GENERIC_YAML), ];
Rebuild and test with sample FITS data
Implementation: zarr-fits-core/src/profile.rs