A Python tool for parsing NASA Roman Space Telescope OPUP (Observation Plan Upload) files and generating interactive HTML reports with sky plots and visit file syntax highlighting.
The OPUP Visit Parser extracts observation data from compressed OPUP archives (.tar.gz), SCF (Spacecraft File) files, and individual visit files (.vst). It generates:
- Interactive HTML tables with exposure metadata
- Sky plots showing target positions and Sun avoidance zones
- Syntax-highlighted visit files with clickable links
- Statistics dashboards with instrument breakdowns
- CSV exports for further analysis
- π¦ Multiple input formats: OPUP archives, SCF files, or individual visit files
- π Interactive sky visualization: Auto-generated sky plots with target positions
- π¨ STOL syntax highlighting: Color-coded visit file display with VS Code dark theme
- π Statistics dashboard: Visit counts, exposure totals, duration summaries
- π Clickable visit links: View raw visit file contents directly from HTML table
- π Instrument breakdown: Per-instrument statistics and duration calculations
- π Sun avoidance zones: Automatic Sun position calculation for visit dates
- πΎ Flexible output: CSV, HTML, or both formats
pip install pandas numpy argparse pathlibThe tool can generate sky plots if roman_plotter.py is present in the same directory.
# Parse OPUP file(s)
python visit_parser.py -opup path/to/opup_file.tar.gz
# Parse SCF file(s)
python visit_parser.py -scf path/to/scf_file.tar.gz
# Parse individual visit file(s)
python visit_parser.py -visit path/to/visit_file.vst
# Multiple inputs
python visit_parser.py -opup file1.tar.gz file2.tar.gz -scf scf1.tar.gz| Argument | Short | Description | Default |
|---|---|---|---|
--opup_filepath |
-opup |
Path(s) to OPUP file(s) | [] |
--scf_filepath |
-scf |
Path(s) to SCF file(s) | [] |
--visit_filepath |
-visit |
Path(s) to visit file(s) | [] |
--output_dir |
-odir |
Output file directory | Same as input |
--keep_GW |
Keep Guide Window information | False |
|
--format |
Output format: csv, html, or both |
html |
# Generate both CSV and HTML outputs
python visit_parser.py -opup my_observations.tar.gz --format both
# Specify custom output directory
python visit_parser.py -opup obs.tar.gz -odir ./results/
# Keep guide window data
python visit_parser.py -visit visit_001.vst --keep_GW
# HTML only (default)
python visit_parser.py -scf spacecraft_file.tar.gzCompressed archive containing:
- SCF files (spacecraft files)
- Visit files (
.vst) - Manifest files (
.man) - Observation definition files (
.json)
Contains visit files and operation files:
- Visit files (
.vst) - Operation files (
.ops)
STOL (Spacecraft Test and Operations Language) formatted files containing:
- Visit metadata
- Group/sequence/activity hierarchy
- Exposure commands and parameters
Interactive report featuring:
- Filterable/sortable data table
- Clickable visit file names
- Embedded visit file viewer with syntax highlighting
- Statistics dashboard
- Instrument breakdown
- Links to sky plotter
Interactive celestial sphere visualization showing:
- Target positions (RA/Dec)
- Sun position and avoidance zones
- Visit footprints
- Ecliptic plane
*_csv.csv- Full exposure metadata*_skyplot.csv- Unique visit positions for plotting
The tool provides VS Code dark theme-style syntax highlighting for STOL visit files:
- Keywords:
VISIT,GROUP,SEQ,ACT(purple/pink) - Visit IDs: Highlighted identifiers (gold)
- Commands: Function names (yellow)
- Parameters: Key-value pairs (cyan/orange)
- Numbers: Numeric values (light green)
- Strings: Quoted strings (orange)
- Comments:
;@prefixed lines (green italic)
The tool extracts and organizes the following exposure metadata:
| Field | Description |
|---|---|
Visit_ID |
Unique visit identifier |
SCI_ID |
Science exposure ID |
Visit_File_Name |
Source visit file |
Science_Instrument |
WFI, etc. |
EXPTIME |
Exposure duration (seconds) |
FILTER |
Optical filter used |
RA |
Right Ascension (degrees) |
DEC |
Declination (degrees) |
Duration |
Total visit duration |
GROUP, SEQUENCE, ACTIVITY |
Hierarchical indices |
Plus many more instrument-specific parameters extracted from visit files.
parse_OPUP()- Parse entire OPUP archiveparse_SCF()- Parse SCF fileparse_visit_file()- Parse individual visit fileparse_visit_lines()- Parse STOL syntax
generate_html_report()- Create interactive HTML tablesyntax_highlight_visit_content()- Apply STOL syntax highlightingexport_unique_visits_for_plotter()- Generate sky plotter data
get_SCF_from_OPUP()- Extract SCF files from OPUPget_visits_from_SCF()- Extract visit files from SCFget_visit_content()- Read visit file from archive
When roman_plotter.py is available, the tool automatically:
- Extracts unique visit positions (RA/Dec)
- Calculates Sun position for observation date
- Generates interactive sky plot with:
- Target positions
- Sun avoidance zones
- Clickable visit markers
- Cross-links between data table and sky plot
Issue: No columns returned for visit file
Solution: Check that visit file contains valid STOL syntax with exposure commands
Issue: Sky plotter not generated
Solution: Ensure roman_plotter.py is in the same directory
Issue: Visit file content not displaying
Solution: Verify OPUP archive structure and visit file paths
- Designed for NASA Roman Space Telescope observation planning files
- Handles nested
.tar.gzarchives automatically - Supports both day-of-year and standard date formats
- Automatically prioritizes important columns in output
- Calculates visit durations and instrument statistics
This tool is designed for NASA Roman Space Telescope operations. For enhancements or bug reports, contact your mission operations team.
NASA Open Source - Internal Use
Last Updated: 2026-03-31