HERA strip: A tool for simulating and visualizing diffuse sky models for HERA observations.
Project description
HERA Strip
HERA Strip is an interactive visualization tool for simulating and visualizing the observable sky strip for the Hydrogen Epoch of Reionization Array (HERA) radio telescope. It creates interactive Bokeh plots showing diffuse sky models, point source catalogs, and antenna beam patterns projected onto celestial coordinates.
Features
- Diffuse Sky Models: Visualize Global Sky Models (GSM2008, GSM2016, LFSS, Haslam) at any frequency
- Point Source Catalogs: Load and display point sources from pyradiosky
.skyh5files - Antenna Beam Overlay: Project HERA beam patterns from FITS files onto the sky map with power contours
- Observable Strip: Highlight the region of sky visible to HERA during a given time range or LST range
- Interactive Plots: Zoom, pan, and hover over sources to see coordinates and flux values
- Flexible Coordinate Systems: Display in Right Ascension (RA) or Local Sidereal Time (LST)
- Multiple Background Modes: Full GSM with hover, reference-only GSM, or white background
Installation
From PyPI
pip install hera-strip
From Source
git clone https://github.com/RRI-interferometry/hera_strip.git
cd hera_strip
pip install -e .
Dependencies
Required packages:
numpyastropyhealpypygdsmbokehmatplotlibscipypyradiosky- For.skyh5file support (point sources and healpix maps)pyuvdata- For beam FITS file support
Install all dependencies:
pip install -r requirements.txt
Quick Start
Basic Usage with LST Range
# Visualize sky strip from LST 1.25h to 5.75h at HERA location
python -m herastrip --location="-30.7,21.4" --lst-range="1.25-5.75" --frequency=80 --use-lst
With Point Source Catalog
# Overlay point sources from a skyh5 catalog
python -m herastrip --location="-30.7,21.4" --lst-range="1.25-5.75" \
--skyh5=./catalog.skyh5 --background=reference --use-lst
With Beam Overlay
# Add HERA beam pattern centered at LST 18h
python -m herastrip --location="-30.7,21.4" --lst-range="1.25-5.75" \
--skyh5=./catalog.skyh5 --background=reference --use-lst \
--add-beam=./beam.fits --beam-lst=18
Command Line Interface
python -m herastrip [OPTIONS]
Required Arguments
| Argument | Description |
|---|---|
--location LAT,LON |
Observer location as latitude,longitude in degrees (e.g., -30.7,21.4 for HERA) |
Plus one of:
| Argument | Description |
|---|---|
--lst-range START-END |
LST range in hours (e.g., 1.25-5.75) |
--start TIME --duration SEC |
ISO time and duration in seconds |
Optional Arguments
Sky Model Options
| Argument | Default | Description |
|---|---|---|
--frequency FREQ |
76 | Observing frequency in MHz |
--model MODEL |
gsm2008 | Sky model: gsm2008, gsm2016, lfss, haslam |
--skyh5 PATH |
None | Path to .skyh5 file (overrides --model) |
--fov DEGREES |
Auto | FOV radius in degrees (auto-calculated from HERA beam if not set) |
Display Options
| Argument | Default | Description |
|---|---|---|
--background MODE |
gsm | Background mode: gsm (full with hover), reference (GSM as reference, source colorbar), none (white) |
--scale SCALE |
log | Color scale for point sources: log or linear |
--use-lst |
False | Display x-axis as LST (hours) instead of RA (degrees) |
--max-sources N |
1000 | Maximum number of point sources to display |
Beam Overlay Options
| Argument | Default | Description |
|---|---|---|
--add-beam PATH |
None | Path to beam FITS file (pyuvdata UVBeam format) |
--beam-lst HOURS |
Center | LST in hours where to center the beam |
--beam-vmin DB |
-40 | Minimum power level in dB for beam colormap |
--beam-vmax DB |
0 | Maximum power level in dB for beam colormap |
Output Options
| Argument | Default | Description |
|---|---|---|
--output DIR |
None | Output directory for saving HTML plot |
Sky Models
HERA Strip supports multiple diffuse sky models via pygdsm:
| Model | Frequency Range | Description |
|---|---|---|
gsm2008 |
10 MHz - 100 GHz | Global Sky Model 2008 (de Oliveira-Costa et al.) |
gsm2016 |
10 MHz - 5 THz | Global Sky Model 2016 (Zheng et al.) |
lfss |
10 - 408 MHz | LWA1 Low Frequency Sky Survey (Dowell et al.) |
haslam |
10 MHz - 100 GHz | Haslam 408 MHz map with spectral scaling |
Python API
Basic Usage
from astropy.coordinates import EarthLocation
from herastrip import HeraStripSimulator
# HERA location
location = EarthLocation(lat=-30.7, lon=21.4)
# Create simulator with LST range
simulator = HeraStripSimulator(
location=location,
frequency=80, # MHz
lst_range=(1.25, 5.75), # LST hours
use_lst=True, # Display in LST
background_mode="gsm", # Full GSM background
)
# Run and display
simulator.run_simulation()
With Point Sources
from herastrip import HeraStripSimulator
simulator = HeraStripSimulator(
location=location,
frequency=80,
lst_range=(1.25, 5.75),
skyh5_path="./catalog.skyh5", # Point source catalog
max_sources=500, # Show top 500 brightest
background_mode="reference", # GSM as visual reference
use_lst=True,
)
simulator.run_simulation(save_simulation_data=True, folder_path="./output")
With Beam Overlay
from herastrip import HeraStripSimulator
simulator = HeraStripSimulator(
location=location,
frequency=80,
lst_range=(1.25, 5.75),
skyh5_path="./catalog.skyh5",
background_mode="reference",
use_lst=True,
beam_path="./NF_HERA_Vivaldi_efield_beam.fits",
beam_lst=18.0, # Center beam at LST 18h
beam_vmin=-40, # dB range for colormap
beam_vmax=0,
)
simulator.run_simulation()
Using Individual Components
from herastrip import (
SkyMapGenerator,
PointSourceCatalog,
BeamProcessor,
Plotter,
calculate_hera_fov_radius,
)
from astropy.coordinates import EarthLocation
# HERA location
location = EarthLocation(lat=-30.7, lon=21.4)
# Generate sky map
sky_gen = SkyMapGenerator(frequency=80, model="gsm2008")
projected_map = sky_gen.generate_projected_map(nside=1024)
# Load point sources
catalog = PointSourceCatalog("./catalog.skyh5", frequency=80)
sources = catalog.get_sources(max_sources=500)
# Load beam
beam = BeamProcessor("./beam.fits", frequency_mhz=80)
beam_data = beam.transform_to_radec(location, lst_hours=18.0)
# Calculate FOV for a given frequency
fov_radius = calculate_hera_fov_radius(frequency_mhz=80)
print(f"FOV radius at 80 MHz: {fov_radius:.1f}°")
HERA Beam Physics
The FOV radius is automatically calculated using HERA's dish parameters:
FWHM = k × λ / D
Where:
k = 1.17 (beam coefficient, calibrated to HERA measurements)
λ = c / frequency (wavelength)
D = 14m (HERA dish diameter)
Reference: Fagnoni et al. 2021, measured FWHM ~10° at 150 MHz
| Frequency | FWHM | FOV Radius |
|---|---|---|
| 50 MHz | 28.1° | 14.0° |
| 80 MHz | 17.6° | 8.8° |
| 100 MHz | 14.0° | 7.0° |
| 150 MHz | 9.4° | 4.7° |
| 200 MHz | 7.0° | 3.5° |
Output Description
Plot Elements
- Background: Diffuse sky model (Inferno colormap, 40th percentile threshold)
- Observable Strip: Red/blue shaded region showing HERA's FOV during the observation
- Declination Lines: Dotted horizontal lines at FOV boundaries with Dec labels
- Strip Boundaries: Dashed vertical lines at LST/RA start and end
- Point Sources: Blue-to-white colored dots (brighter = higher flux)
- Top 5 Sources: Yellow highlighted sources with rank labels (1-5)
- Beam Overlay (optional): RdBu_r colored hemisphere with -3dB and -10dB contours
- Colorbars: Left (beam dB), Right (flux Jy or GSM brightness)
Interactive Features
- Hover: Display coordinates and flux for point sources
- Zoom: Scroll to zoom, double-click to reset
- Pan: Click and drag to pan
- Save: Use Bokeh toolbar to save as PNG
File Formats
skyh5 Files (pyradiosky)
HERA Strip supports two types of .skyh5 files:
-
Point Source Catalogs (
component_type="point")- Contains RA, Dec, and Stokes I flux for each source
- Multiple frequencies supported
-
HEALPix Maps (
component_type="healpix")- Full-sky diffuse maps in HEALPix format
- Supports RING or NESTED ordering
Beam FITS Files (pyuvdata)
Beam files should be in UVBeam format with:
- E-field or power beam data
- Azimuth/Zenith angle coordinate system
- Multiple frequencies supported
Module Architecture
herastrip/
├── __init__.py # Package exports
├── __main__.py # Entry point for python -m herastrip
├── main.py # CLI argument parsing and orchestration
├── simulation.py # HeraStripSimulator class, HERA beam physics
├── sky_model.py # SkyMapGenerator, PointSourceCatalog, SkyH5MapGenerator
├── beam.py # BeamProcessor for antenna beam overlay
└── plotting.py # Plotter class, Bokeh visualization
Key Classes
| Class | Module | Description |
|---|---|---|
HeraStripSimulator |
simulation.py | Main simulation orchestrator |
SkyMapGenerator |
sky_model.py | Generate projected maps from pygdsm models |
SkyH5MapGenerator |
sky_model.py | Load HEALPix maps from skyh5 files |
PointSourceCatalog |
sky_model.py | Load point sources from skyh5 files |
BeamProcessor |
beam.py | Load and transform beam patterns |
Plotter |
plotting.py | Create interactive Bokeh visualizations |
Examples
Example 1: Galactic Center Region
# View the Galactic Center (transits at LST ~17.75h)
python -m herastrip --location="-30.7,21.4" --lst-range="16-20" \
--frequency=150 --use-lst --model=gsm2008
Example 2: Point Sources with Beam
# Overlay GLEAM catalog with beam at Galactic Center
python -m herastrip --location="-30.7,21.4" --lst-range="1-6" \
--skyh5=./gleam.skyh5 --background=reference --max-sources=300 \
--use-lst --add-beam=./hera_beam.fits --beam-lst=18
Example 3: Time-Based Observation
# 2-hour observation starting at specific UTC time
python -m herastrip --location="-30.7,21.4" \
--start="2024-04-06T22:00:00" --duration=7200 --frequency=80
Example 4: Save Output
python -m herastrip --location="-30.7,21.4" --lst-range="1.25-5.75" \
--frequency=80 --use-lst --output=./plots/
# Saves to ./plots/sky_strip.html
Coordinate Systems
Right Ascension (RA) Mode
- X-axis: RA in degrees (-180° to 180°)
- Centered at RA = 0° (vernal equinox)
Local Sidereal Time (LST) Mode (--use-lst)
- X-axis: LST in hours (displayed as 0h-24h)
- Internally centered at LST = 0h (-12h to 12h)
- LST = RA / 15 (hours = degrees / 15)
Declination
- Y-axis: Dec in degrees (-90° to 90°)
- HERA at latitude -30.7° sees Dec from ~-90° to ~+60°
Troubleshooting
"No module named 'X'"
Install all required dependencies:
pip install -r requirements.txt
Beam overlay not visible
- Check
--beam-lstis within the plot's LST range - Increase
--beam-vmin(e.g., -30 instead of -40) for more visibility
Plot appears blank
- Ensure frequency is within the model's valid range
- Check that skyh5 file exists and is readable
References
- HERA: https://reionization.org/
- Fagnoni et al. 2021 - HERA beam measurements
- de Oliveira-Costa et al. 2008 - GSM2008
- Zheng et al. 2017 - GSM2016
- Dowell et al. 2017 - LFSS
- Haslam et al. 1982 - 408 MHz all-sky survey
Author
Kartik Mandar Email: kartik4321mandar@gmail.com
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hera_strip-1.0.1.tar.gz.
File metadata
- Download URL: hera_strip-1.0.1.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c11b41ac393cf2bb9060d45725a79b07702fe88b2d119c2d8d9167c1f6b3d062
|
|
| MD5 |
1b7738e6aa46d21449c069a5960a0b8c
|
|
| BLAKE2b-256 |
952f74ebd49c9059f4b6c7b54bfa1da7bfa81b6a419602e9e4fae55a761c7416
|
File details
Details for the file hera_strip-1.0.1-py3-none-any.whl.
File metadata
- Download URL: hera_strip-1.0.1-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c37e640520e2a0a8fc5a90e5fda2fdf167e7a492d6e361e112337a55e1d10a
|
|
| MD5 |
8e21c4cf798dcb8383fd39792bce5712
|
|
| BLAKE2b-256 |
4a89012c551e16b4fdf2400e194d40a866d902b75a0a7e4f6b579f1a14872c72
|