orca.transform.image_sub

Image subtraction utilities for FITS images.

Provides functions for subtracting pairs or lists of FITS images and computing image statistics within specified regions.

Originally written by Marin Anderson.

Functions

rot_ellipse(→ numpy.ndarray)

Compute the ellipse equation value for a rotated ellipse.

image_sub(→ str)

Image subtraction for single image for lists of images. When the input is a list, it co-adds first before

getimrms(filepath[, radius])

Compute RMS, median, and frequency for a list of FITS images.

Module Contents

orca.transform.image_sub.rot_ellipse(x: numpy.ndarray, y: numpy.ndarray, x0: float, y0: float, sigmax: float, sigmay: float, theta: float) numpy.ndarray[source]

Compute the ellipse equation value for a rotated ellipse.

Points where the return value <= 1 are inside the ellipse.

Parameters:
  • x – X coordinates.

  • y – Y coordinates.

  • x0 – Ellipse center X coordinate.

  • y0 – Ellipse center Y coordinate.

  • sigmax – Semi-major axis in X direction.

  • sigmay – Semi-minor axis in Y direction.

  • theta – Rotation angle in radians.

Returns:

Array of ellipse equation values at each (x, y) point.

orca.transform.image_sub.image_sub(file1: str | List[str], file2: str | List[str], out_dir, out_prefix='diff_', ref_index: int = 0) str[source]
Image subtraction for single image for lists of images. When the input is a list, it co-adds first before

subtracting. Subtraction is file2 - file1. Output file is based on the basename of file1 with a prefix.

Parameters:
  • file1 – Previous image or list of images to be co-added

  • file2 – Next image or list of images to be co-added.

  • out_dir – Output directory

  • out_prefix – Output file prefix.

  • ref_index – If the input is a list, the index for the reference fits file from which the header for the output is extracted.

Returns:

Output file path.

orca.transform.image_sub.getimrms(filepath: List[str], radius: int = 0)[source]

Compute RMS, median, and frequency for a list of FITS images.

Calculates image statistics either from a central 1000x1000 pixel box or from a circular aperture of specified radius centered on the image.

Parameters:
  • filepath – List of paths to FITS image files.

  • radius – Aperture radius in pixels. If 0, uses central 1000x1000 box.

Returns:

Tuple of (rms_array, median_array, frequency_array, dateobs_array).