acdc.utils.utils

Functions

bin_coords

Given a list of coordinates in X & Y, transform them into the superdark's binned (and possibly offset) coordinate system.

get_background_regions

get_binning_pars

For a given superdark, return the binning information in the spatial directions and PHA.

get_psa_wca

Determine the rows that correspond to the PSA and WCA apertures for a given segment, cenwave, and lifetime position.

sql_to_df

timefunc

Decorator to wrap and time functions.

unbin_coords

Given a list of binned coordinates in X & Y, transform them into the the unbinned, native coordinate system.

unbin_image

bin_coords(xs, ys, bin_x, bin_y, xstart=0, ystart=0, make_int=False, as_float=False)[source]

Given a list of coordinates in X & Y, transform them into the superdark’s binned (and possibly offset) coordinate system.

get_binning_pars(af)[source]

For a given superdark, return the binning information in the spatial directions and PHA.

get_psa_wca(segment, cenwave, lp, binning, pad_psa=[0, 0], pad_wca=[0, 0])[source]

Determine the rows that correspond to the PSA and WCA apertures for a given segment, cenwave, and lifetime position. Return the row indices in the binned superdark coordinate system.

Parameters:
  • segment (str) – Get PSA/WCA regions for this segment.

  • cenwave (str) – Get PSA/WCA regions for this cenwave.

  • lp (str) – Get PSA/WCA regions for this lifetime position.

  • binning (dict) – Dictionary that describes the binning information in both the spatial and PHA dimensions.

Returns:
  • excluded_rows (array) – List of rows to exclude. Corresponds to the PSA and WCA regions.

  • apertures (dict) – The excluded rows for each aperture, PSA and WCA.

timefunc(func)[source]

Decorator to wrap and time functions.

Parameters:

func (func) – Function to be timed

Returns:

wrapper (func) – Timed version of the function

unbin_coords(xs, ys, bin_x, bin_y, xstart=0, ystart=0)[source]

Given a list of binned coordinates in X & Y, transform them into the the unbinned, native coordinate system.