Skip to content

autoproc_depend.py

Epzack edited this page Aug 27, 2021 · 7 revisions

autoproc_depend.py Functions

  • findcals - Locates calibration files.
  • write_fits - Creates a FITS file.
  • findsexobj - Find sextractor objects with optional inputs. Estimates seeing from stars found.
  • calc_zpt - Find zeropoint using robust scatter.
  • robust_scat - Calculate robust scatter and set the weight of those above this limit to 0.
  • identify_matches - Use a kd-tree (3d) to match two lists of stars, using full spherical coordinate distances.

Function Details

findcals

findcals(pipevar, file_format_str)

Locates calibration files of a specified type. Files must be in pipevar['caldir'], pipevar['datadir'], or pipevar['imworkingdir'].

Params

  • pipevar {dict}: Input pipeline parameters.
  • file_format_str {str}: String designating the type of calibration (bias*.fits, dark*.fits, flat*.fits).

write_fits

write_fits(filename, data, header):

Creates a FITS file with the specified parameters.

Params

  • filename {str}: Name of file being created.
  • data {list}: Data of FITS file.
  • header {list}: Header information of FITS file.

findsexobj

<> findsexobj(file, sigma, pipevar, [masksfx=None, zeropt=25.0, maptype='MAP_WEIGHT', wtimage=None, fwhm=1.5, pix=0.3787, aperture=5.0, elong_cut=1.5, quite=0])

Finds sextractor objects with optional inputs. Estimates seeing from stars found.

Params

  • file {str}: Absolute path to FITS file to run sextractor on.
  • sigma {float}: Detection threshold and analysis threshold for sextractor.
  • pipevar {dict}: Input pipeline parameters.
  • masksfx {str, optional}: Identifier for sextractor CHECKIMAGE_NAME.
  • zeropt {float, optional}: Input value for sextractor MAG_ZEROPOINT.
  • wtimage {str, optional}: Absolute file for input for sextractor WEIGHT_IMAGE.
  • fwhm {float, optional}: Input value for sextractor SEEING_FWHM.
  • pix {float, optional}: Input value for sextractor PIXEL_SCALE.
  • aperture {float, optional}: Input value for sextractor PHOT_APERTURES.
  • elong_cut {float, optional}: Cutoff limit for FWHM calculation of elongation to eliminate non-stars.
  • quiet {bool, optional}: Disable output from sextractor.

Example & Usage

See autoproc_steps.py (autopipestack) at line 745, line 935 and line 944.

calc_zpt

<> calc_zpt(catmag, obsmag, wts, [sigma=3.0, plotter=None])

Find zeropoint using robust scatter.

Params

  • catmag {list}: 2d array with catalog magnitudes catmag[nobs,nstar].
  • obsmag {list}: 2d array with catalog magnitudes obsmag[nobs,nstar].
  • wts {list}: 2d array with weights wts[nobs,nstar].
  • sigma {float, optional}: Sigma value for how far values can be from robust scatter value.
  • plotter {str, optional}: Absolute path to save zeropoint plot.

Output

  • z2 - Zeropoint correction.
  • scats - Robust scatter of each observation.
  • rmss - Standard deviation (without bad weight points) of each observation.

Example & Usage

See autoproc_steps.py (autopipestack) at line 844, and line 1039.

robust_scat

<> robust_scat(diff, wts, nobs, nstars, sigma)

Calculate robust scatter and set the weight of those above this limit to 0.

Params

  • diff {list}: Values to calculate robust scatter over.
  • wts {list}: Weights (0 is bad).
  • nobs {int}: Number of observations to iterate over.
  • nstars {int, optional}: Number of stars to iterate over.
  • sigma {float, optional}: Sigma*robust scatter that is acceptable.

Output

  • scats - robust scatter of each observation.
  • rmss - standard deviation (without bad weight points) of each observation.

Example & Usage

See autoproc_depend.py (calc_zpt) at line 829.

identify_matches

<> identify_matches(queried_stars, found_stars, [match_radius=3.0])

Use a kd-tree (3d) to match two lists of stars, using full spherical coordinate distances.

Params

  • queried_stars {list}: Numpy arrays of [ [ra,dec],[ra,dec], ... ] (all in decimal degrees).
  • found_stars {list}: Numpy arrays of [ [ra,dec],[ra,dec], ... ] (all in decimal degrees).
  • match_radius {float, optional}: Max distance (in arcseconds) allowed to identify a match between two stars.

Example & Usage

See autoproc_steps.py (autopipestack) at line 790, and line 988.