Skip to content

Hosting for analysis scripts of the maser monitoring programme of the Metsahovi Compact Array

License

Notifications You must be signed in to change notification settings

JobVorster/MCA_maser_dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCA Maser Monitoring Pipeline

A Python pipeline for processing maser monitoring observations from the Metsähovi Compact Array (MCA). This system automatically generates summary spectra and time series from baseline calibrated single scans, along with goo-quality plots for scientific analysis.

Overview

The MCA Maser Monitoring Programme has evolved from manual observations to daily automated monitoring of 57+ maser sources. This pipeline processes the calibrated data to produce standardized spectral and time series products, along with annotated plots for scientific analysis and monitoring.

Features

  • Automated Data Processing: Batch processing of calibrated observation files
  • Spectral Regularization: Resampling spectra onto common velocity grids
  • Adaptive Time Series: Variable cadence integration based on signal-to-noise ratio
  • Multi-Polarization Support: Handles dual circular polarization (L/R) data
  • Multi-Antenna Processing: Supports MCA1 and MCA2 antenna combinations
  • Standardized Output: Consistent data formats for downstream analysis
  • Automated Plotting: Generates publication-quality spectral and time series plots
  • Feature Annotation: Automatic labeling of maser features with collision detection

Installation

Dependencies

pip install numpy pandas matplotlib

Required Packages

  • numpy: Numerical computations
  • pandas: Data manipulation and rolling averages
  • matplotlib: Plotting and visualization

Quick Start

1. Prepare Your Data Structure

archive/
├── G9.621+0.196/
│   ├── calibrated_scan_001.dat
│   ├── calibrated_scan_002.dat
│   └── ...
├── G12.681-0.182/
│   └── ...

2. Create a Maser Feature Catalogue

# MCA_feature_catalogue.csv
G9.621+0.196,3.0
G9.621+0.196,-1.0
G12.681-0.182,53.4
G12.681-0.182,58.2

3. Configure and Run

# Set your paths
archive_fn = '/path/to/your/archive/'
out_foldername = '/path/to/output/'
catalogue_fn = '/path/to/MCA_feature_catalogue.csv'

# Run the pipeline
python source_summary.py

# Generate plots
python monitoring_plots.py

Usage

Basic Processing

from mca_time_series import *

# Load maser feature catalogue
feature_catalogue = read_maser_catalogue('MCA_feature_catalogue.csv')

# Generate mean spectra for a source
mean_spectra = make_maser_spectra(
    foldername='archive/G9.621+0.196/',
    source_name='G9.621+0.196',
    do_regridding=True,
    dv=0.1  # velocity resolution in km/s
)

# Generate time series with adaptive cadence
time_series = variable_cadence_time_series(
    foldername='archive/G9.621+0.196/',
    source_name='G9.621+0.196',
    feature_catalogue=feature_catalogue,
    SNR_limit=3
)

Advanced Configuration

# Customize spectral regularization
dspectra = get_dynamic_spectra(
    filenames,
    do_regularization=True,
    reg_strategy='MIN',  # or 'MAX'
    dv=0.1,
    pol_filter='L'  # Filter for specific polarization
)

# Apply spectral regularization
regularized_spectra = spectra_regularization(
    dynamic_spectra,
    dv=0.1,
    reg_strategy='MIN'
)

Plotting Configuration

# Configure plotting parameters
plot_separately = False  # Plot mean spectrum vs individual pol/ant
ann_collision_detection = True  # Enable label collision detection

# Run plotting script
python monitoring_plots.py

Output Formats

Mean Spectra (Gxxx_spectrum.dat)

#vel,1Lmean,1Rmean,2Lmean,2Rmean
-10.000000,1.234567e+02,1.345678e+02,1.456789e+02,1.567890e+02
-9.900000,1.234567e+02,1.345678e+02,1.456789e+02,1.567890e+02
...

Time Series (Gxxx_timeseries.dat)

MJD,ant,poln,feature[*abcde],vel[km/s],pwr[],unc[]
560000.0,1,L,a,-2.4,123,12
560001.0,1,L,a,-2.4,125,11
...

Generated Plots

  • Spectral Plots (Gxxx_spectrum.png): Annotated mean spectra with maser feature identification
  • Time Series Plots (Gxxx_timeseries.png): Multi-feature time series with rolling averages and error bars

Configuration Parameters

Data Processing Settings

# Data paths
archive_fn = '/path/to/archive/'           # Input data directory
out_foldername = '/path/to/output/'        # Output directory
catalogue_fn = '/path/to/catalogue.csv'    # Feature catalogue

# Processing parameters
do_regridding = True                       # Enable spectral regularization
dv = 0.1                                   # Velocity resolution [km/s]
SNR_limit = 3                              # SNR threshold for time series
ADU2Jy = 1                                 # Flux calibration factor

# Regularization strategy
reg_strategy = 'MIN'                       # 'MIN' or 'MAX'

Plotting Settings

# Plotting configuration
plot_separately = False                    # Plot individual pol/ant vs mean
ann_collision_detection = True             # Enable label collision detection

# Plot appearance
figsize = (6, 4)                          # Spectrum plot size
figsize_ts = (10, 4)                      # Time series plot size
dpi = 200                                 # Output resolution

Plot Features

  • Automatic Feature Annotation: Labels maser features from catalogue
  • Collision Detection: Prevents overlapping labels in crowded spectra
  • Multi-Polarization Display: Option to show individual polarizations/antennas
  • Rolling Averages: Time series plots include 20-point rolling means
  • Error Bars: Uncertainty visualization with transparency control

File Structure

mca-time-series/
├── mca_time_series.py           # Core processing library
├── source_summary.py            # Main pipeline wrapper
├── plot_summary.py              # Plotting and visualization
├── MCA_feature_catalogue.csv    # Example feature catalogue
├── README.md                    # This file
└── examples/
    └── sample_data/

Input Data Format

The pipeline expects calibrated .dat files with:

  • Header metadata (observation time, antenna, polarization)
  • Comma-separated columns: frequency, velocity, flux
  • Standardized naming convention

Required Headers

# Observations began = 2025-01-01T12:00:00.000000
# Antennas: MCA1
# Polarisations = L

Scientific Background

This pipeline supports the MCA Maser Monitoring Programme, which:

  • Monitors 57+ methanol maser sources daily
  • Provides automated flare detection capabilities
  • Generates standardized data products for variability studies
  • Supports interferometric observations with MCA1+MCA2
  • Produces publication-ready plots for scientific analysis

Key Features

  • Variable Cadence: Adapts integration time based on source brightness
  • Multi-Epoch Processing: Handles observations spanning multiple years
  • Quality Control: SNR-based filtering and regularization
  • Standardized Outputs: Consistent formats for scientific analysis
  • Automated Visualization: Publication-quality plots with feature annotation

Troubleshooting

Common Issues

Import Errors: Ensure all dependencies are installed

pip install -r requirements.txt

File Not Found: Check that data paths are correct and files exist

Memory Issues: For large datasets, consider processing sources individually

Spectral Artifacts: Try different regularization strategies or velocity resolutions

Plot Generation Issues: Check that both spectrum and time series data files exist

Label Collisions: Enable ann_collision_detection for crowded spectral plots

Performance Tips

  • Adjust dv parameter for optimal velocity resolution
  • Filter polarizations if processing time is excessive
  • Enable collision detection for cleaner spectral plots
  • Use plot_separately=True for detailed multi-polarization analysis

Contributing

This pipeline is part of the MCA Maser Monitoring Programme at Metsähovi Radio Observatory. For questions or contributions, please contact the development team.

Version History

  • v1.0.0 (2025-07-04): Initial production release
    • Core processing pipeline
    • Spectral regularization
    • Variable cadence time series
    • Standardized output formats
    • Automated plotting with feature annotation
    • Publication-quality visualization tools

License

Developed for the Metsähovi Compact Array project. Please cite appropriate references when using this software for scientific publications.

References

  • Holman et al. (2024): Median-frequency-shifted bandpass calibration method
  • MCA Maser Monitoring Programme documentation

Contact

For technical questions or collaboration opportunities, please contact the MCA team at Metsähovi Radio Observatory.

About

Hosting for analysis scripts of the maser monitoring programme of the Metsahovi Compact Array

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages