orca.transform.cutout

Target photometry with ionospheric-aware search and confusing source masking.

Ported from ExoPipe/cutout.py into the orca package for use with the Celery pipeline. All pipeline_config imports are replaced by orca.resources.subband_config.

Attributes

CASA_AVAILABLE

DETECTION_SIGMA

MIN_ELEVATION

BEAM_SEARCH_MULTIPLIER

IONOSPHERE_PAD_ARCSEC_85MHZ

IONOSPHERE_REF_FREQ_MHZ

DEFAULT_BEAM_ARCSEC

CUTOUT_SIZE

FIT_SIGMA_THRESHOLD

Functions

get_timestamp_from_header(header)

get_beam_size_arcsec(header)

robust_measure_flux(data, cutout_wcs, sky_coord, ...)

Measure flux at source position and find peak within beam + ionospheric padding.

find_all_images(run_dir[, fallback_dir])

Find all image sets for target cutouts.

find_image_pairs(run_dir[, fallback_dir])

Legacy wrapper: returns list of (freq, i_path, v_path) for deep images only.

process_target(run_dir, target_name, coord, ...[, ...])

Extract cutouts for a target from deep and 10min images.

load_targets(filepath)

Load targets from CSV. Returns list of (name, coord, detection_stokes, confusers).

Module Contents

orca.transform.cutout.CASA_AVAILABLE = True[source]
orca.transform.cutout.DETECTION_SIGMA = 5.0[source]
orca.transform.cutout.MIN_ELEVATION = 30.0[source]
orca.transform.cutout.BEAM_SEARCH_MULTIPLIER = 1.0[source]
orca.transform.cutout.IONOSPHERE_PAD_ARCSEC_85MHZ = 120.0[source]
orca.transform.cutout.IONOSPHERE_REF_FREQ_MHZ = 85.0[source]
orca.transform.cutout.DEFAULT_BEAM_ARCSEC = 300.0[source]
orca.transform.cutout.CUTOUT_SIZE[source]
orca.transform.cutout.FIT_SIGMA_THRESHOLD = 3.0[source]
orca.transform.cutout.get_timestamp_from_header(header)[source]
orca.transform.cutout.get_beam_size_arcsec(header)[source]
orca.transform.cutout.robust_measure_flux(data, cutout_wcs, sky_coord, beam_arcsec, freq_mhz, fits_path=None, confusing_sources=None)[source]

Measure flux at source position and find peak within beam + ionospheric padding.

Parameters:
  • data – 2D numpy array (cutout pixel data, already in memory)

  • cutout_wcs – astropy WCS (celestial, 2D) from Cutout2D

  • sky_coord – SkyCoord of the target

  • beam_arcsec – Beam FWHM in arcseconds

  • freq_mhz – Observing frequency in MHz (for ionospheric scaling)

  • fits_path – Optional path to cutout FITS for CASA imfit

  • confusing_sources – Optional list of SkyCoord for known confusing sources to mask within one beam FWHM before measurement.

Returns dict with keys:

src_flux, peak_flux, peak_coord, offset_arcmin, rms, fit_flux, fit_err, method, n_confusers_masked

orca.transform.cutout.find_all_images(run_dir, fallback_dir=None)[source]

Find all image sets for target cutouts.

Returns dict with:

‘freq’: float, ‘deep_i’: path, ‘deep_v’: path, ‘snapshots_10min’: list of (i_path, v_path, interval_tag) tuples

Or empty dict if deep pair not found.

orca.transform.cutout.find_image_pairs(run_dir, fallback_dir=None)[source]

Legacy wrapper: returns list of (freq, i_path, v_path) for deep images only.

orca.transform.cutout.process_target(run_dir, target_name, coord, sample_name, base_out_dir, detections_dir, fallback_dir=None, detection_stokes='IV', confusing_sources=None)[source]

Extract cutouts for a target from deep and 10min images.

Deep Stokes I: uses confusing source masking if sources specified. 10min Stokes I: uses (10min - deep) difference image — no masking needed. Stokes V: measured directly for both deep and 10min.

orca.transform.cutout.load_targets(filepath)[source]

Load targets from CSV. Returns list of (name, coord, detection_stokes, confusers).