Generate Roman APT observation files from spreadsheets.
All core tools are in the tools/ folder:
Populate a Roman APT seed XML with dark/cal observations (CFA, flat, dark, tuning). Clones the seed's PassPlan once per input table, with one Observation per VISIT_NUMBER group. Supports multi-band input with automatic LED substitution (Band1→Band2/Band3).
python tools/populate_darkcal_apt.py --seed seeds/CFA_seed.apt --input data.csv --out output.apt
python tools/populate_darkcal_apt.py --input data.xlsx --sheet 'Results' --seed seeds/tuning_seed.apt --out tuning.aptPopulate a Roman APT seed XML for LOLO (lamp-on-lamp-off) observations with target and fiducial overrides. Supports grouping multiple rows into multi-LED CRNL observations by (PASSPLAN_LABEL, OBSERVATION_NUMBER).
python tools/populate_lolo_apt.py --seed seeds/LOLO_seed.apt --input lolo_data.csv --out lolo.aptGenerate a Roman WFI OPUP (Observation Plan Upload Package) as a .tgz tarball from dark/cal sequences (CFA, flat, dark). Merges rows by VISIT_NUMBER and generates OPS/VST files with proper directory structure. Note: Use APT files directly for LOLO observations.
python tools/generate_darkcal_gopup.py --csv examples/cfa/data.csv --opup_name 2026334010112_2026169141359 \
--prog 123 --exec 1 --pass_num 1 --seg 1Helper library for constructing APT strings from TPT review CSVs. Provides utilities for reading review tables, generating LampState strings, and formatting output. Used by populate_apt.py and populate_lolo_apt.py.
Diagnostic tool that correlates a TPT review CSV with the MA-table reference YAML to compute timing and count diagnostics. Outputs effective exposure time, read patterns, and total counts per row.
python tools/diagnose_csv.py --csv data.csv --yaml reference/ma_table_ref_revG.yaml# Dark/cal observations (CFA, flat, dark, tuning)
python tools/populate_darkcal_apt.py --seed seeds/CFA_seed.apt --input examples/cfa/data.csv --out output.apt
# LOLO observations (lamp-on-lamp-off calibration)
python tools/populate_lolo_apt.py --seed seeds/LOLO_seed.apt --input examples/lolo/data.csv --out output.apt
# With Excel sheet selection
python tools/populate_darkcal_apt.py --seed seeds/tuning_seed.apt --input examples/tuning/260615_sRCS_WFI_flight_tuning_CFA_APT.xlsx --out output.apt
tools/ Core APT population and diagnostic scripts
seeds/ Seed APT template files (.apt)
examples/ Example inputs and outputs
├── cfa/ CFA example data and outputs
│ └── data/ CFA CSV diagnostic files
├── lolo/ LOLO example data and outputs
└── tuning/ Tuning example data and outputs
reference/ Documentation and reference data
├── ma_table_ref_revG.yaml Multi-accumulate table reference
└── sRCS_precharge_explainer.html Precharge calculation explanation
notebooks/ Jupyter notebooks for analysis and exploration
helpers/ Experimental utilities (not maintained)
backups/ APT backup files (.aptbackup)
VISIT_NUMBER— observation groupingNEXP— number of exposuresRESULTANTS_PER_EXPOSURE— resultants per exposure (emitted asR=value)MA_TABLE— multi-accumulate tableSRCS_LEDB1,SRCS_LEDB2— LED names or empty (empty = dark)SRCS_LEDB1_FLUX,SRCS_LEDB2_FLUX— LED fluxesSRCS_LEDB1_PRECHARGE_DURATION,SRCS_LEDB1_PRECHARGE_FLUX— precharge (B1)SRCS_LEDB2_PRECHARGE_DURATION,SRCS_LEDB2_PRECHARGE_FLUX— precharge (B2)WFI_SRCS_LEDB1_CLEANUP,WFI_SRCS_LEDB2_CLEANUP— cleanup flags (YES/NO)
PASSPLAN_LABEL— PassPlan grouping (e.g., "F087-NGC-6819-1")OBSERVATION_NUMBER— sequence within PassPlan (1, 2, 3)OBSERVATION_TYPE— "dark", "lit", or "crnl"TARGET— target number or "NONE"OPTICAL_ELEMENT— filter (e.g., "F087", "F184")FIDUCIAL_APERTURE— aperture override (e.g., "WFI01_FULL") or empty
Multiple rows with same PASSPLAN_LABEL + OBSERVATION_NUMBER aggregate into one observation:
F087-NGC-6819, 3, crnl, ..., LED16, 2, 30, 111.8, NO
F087-NGC-6819, 3, crnl, ..., LED16, 20, 30, 865.4, NO
Generates:
1, R=13, LED16=2.0 (pre=30,111.8)
2, R=13, LED16=20.0 (pre=30,865.4)
Use the precharge calculator from ../roman-rcs-tools/:
precharge-calculator --side B --target-flux 500 --duration 30The output is the precharge flux value to use in the CSV/spreadsheet columns SRCS_LEDB*_PRECHARGE_FLUX.
See examples/ folder for input data and outputs:
examples/cfa/260615_sRCS_WFI_flight_tuning_CFA_APT.xlsx— Flight tuning inputexamples/cfa/CFA_all_bands.apt— Example output with all bandsexamples/cfa/CFA_ladder_stacked.png— CFA ladder visualization
examples/lolo/lolo_input_example.csv— Basic LOLO exampleexamples/lolo/lolo_input_MRT12c.csv— MRT 12c exampleexamples/lolo/lolo_MRT12c.apt— Example LOLO outputexamples/lolo/APT_1024_LOLO.csv— APT 1024 LOLO input
examples/tuning/260605_sRCS_WFI_flight_tuning_2hr_APT_upstep.xlsx— Flight tuning inputexamples/tuning/tuning.apt— Example tuning output
- Python ≥ 3.9
- pandas, numpy, openpyxl