Function reference

FITS files and headers

Read images, select files, and maintain observation metadata.

fitsmgmt.io.load_ccd Load one FITS image, with optional uncertainty and mask extensions.
fitsmgmt.io.load_ccds Load multiple FITS files with load_ccd.
fitsmgmt.io.write2fits Write data and a header to a FITS file via ~astropy.nddata.CCDData.
fitsmgmt.io.inputs2list Normalize file, table, and CCD-like inputs to a list.
fitsmgmt.table.fits_summary Extract summary rows from FITS headers.
fitsmgmt.table.df_selector Select rows from a summary table.
fitsmgmt.table.group_fits Organize the group_by and type_key for select_fits
fitsmgmt.table.select_fits Stacks the FITS files specified in fitslist
fitsmgmt.naming.fits_newpath Give the new path of a FITS file from header values.
fitsmgmt.naming.fitsrenamer Rename a FITS file using header values.
fitsmgmt.header.hedit Edit FITS header keyword values.
fitsmgmt.header.hdrval Get a value by priority: value > header[key] > default.
fitsmgmt.header.cmt2hdr Add HISTORY/COMMENT entries, optionally with a timestamp.
fitsmgmt.header.update_process Update the process history keyword in the header.
fitsmgmt.header.midtime_obs Calculate the mid-observation time.

Image operations and combination

Transform CCDData images and combine calibrated exposures.

imutil.imarith.imarith Similar to IRAF IMARITH
imutil.imcopy.imcopy Copy FITS images or sections, similar to IRAF IMCOPY.
imcombine A FITS-file helper for imcombiners.ndcombine.
imutil.imcombine.group_combine Combine sub-groups of FITS files from the given input.
imutil.imcombine.group_save Saves the group_combine results.
imutil.ccdops.bin_ccd Bins the given ccd.
imutil.ccdops.imcut Return a fast 2-D rectangular image cutout without metadata handling.
imutil.ccdops.imslice Slice the ~astropy.nddata.CCDData using one of trimsec, bezels, or slices.
imutil.ccdops.trim_overlap Trim only the overlapping regions of the two CCDs
imutil.ccdops.propagate_ccdmask Propagate the ~astropy.nddata.CCDData’s mask and additional mask.
imutil.imstat.errormap Propagate independent detector and calibration errors through a flat.
imutil.imstat.give_stats Calculates simple statistics.
imutil.pixels.fixpix Interpolate the masked location (N-D generalization of IRAF PROTO.FIXPIX)
imutil.pixels.find_satpix Finds saturated pixel values excluding masked pixels.

Calibration and cosmic rays

Apply calibration frames and identify image defects.

reduction.preproc.biascor Subtract a master bias frame.
reduction.preproc.darkcor Subtract a master dark frame, optionally scaled by exposure time.
reduction.preproc.flatcor Divide by a master flat frame.
reduction.preproc.frincor Subtract a master fringe frame, optionally scaled to the image.
reduction.preproc.ccdred Run the basic CCD calibration sequence.
reduction.crrej.crrej Do cosmic-ray rejection using L.A.Cosmic default parameters.
reduction.crrej.medfilt_bpm Find bad pixels from median filtering technique (non standard..?)

Photometry and backgrounds

Define apertures, estimate sky, refine centers, and measure flux.

phot.aperture.circ_ap_an Return circular aperture and annulus objects.
phot.aperture.ellip_ap_an Return elliptical aperture and annulus objects.
phot.aperture.rect_ap_an Return rectangular aperture and annulus objects.
phot.aperture.pill_ap_an Return pill aperture and annulus objects.
phot.apphot.apphot_annulus Measure aperture fluxes with an optional annular sky estimate.
phot.background.sky_fit Estimate sky values from an image or one or more annuli.
phot.background.mmm_dao Estimate a sky value with the iterative MMM-DAO algorithm.
phot.background.quick_sky_circ Estimate sky in a circular annulus using quick presets.
phot.center.find_centroid Find the intensity-weighted centroid iteratively.
phot.center.find_center_2dg Find the center of the image by 2D Gaussian fitting.
phot.center.center_sep Find an object’s center by iterated SEP detection.
phot.radprof.radial_profile Calculate an annular radial profile of an image.
phot.radprof.radcum_profile Calculate a cumulative radial profile with circular apertures.
phot.radprof.ee_radius Find the radius enclosing a fraction of the total image flux.

Comet image enhancement

Reveal coma structure with radial and azimuthal filters.

viz.enhance.enhance_rho Compensate a radial brightness profile proportional to rho**power.
viz.enhance.azimuthal_normalize Divide polar rings by a mean, median, mode estimate, or custom statistic.
viz.enhance.azimuthal_renormalize Map each ring’s location plus/minus sample deviations to zero and one.
viz.enhance.annular_normalize Divide original pixels by statistics in explicit radial intervals.
viz.enhance.NormStats Describe normalization estimates and support for each radial bin.
viz.enhance.EnhancementResult Return an enhanced image with its normalization statistics.
viz.rvsf.radially_variable_filter Apply CometCIEF’s radially variable eight-neighbor filter.
viz.larson.larson_sekanina Subtract two oppositely rotated, radially shifted coma images.

Coordinates and observing geometry

Inspect WCS, derive local transforms, and compute airmass.

fitsmgmt.wcs.center_radec Returns the central ra/dec from header or ~astropy.wcs.WCS.
fitsmgmt.wcs.fov_radius Calculates the rough radius (cone) of the (square) FOV using ~astropy.wcs.WCS.
fitsmgmt.wcs.pixel_scale Calculates the rough pixel scale using ~astropy.wcs.WCS.
fitsmgmt.wcs.local_cd_matrix Estimate the local CD matrix (deg/pixel) of a WCS at one pixel position.
fitsmgmt.wcs.make_linear_wcs Create a purely linear (no SIP) TAN WCS from a CD matrix.
fitsmgmt.wcs.make_zoomed_wcs Resample a linear WCS onto a finer pixel grid covering the same sky.
fitsmgmt.wcs.wcsremove Remove most ~astropy.wcs.WCS related keywords from the header.
fitsmgmt.airmass.calc_airmass Calculate airmass by nonrefracting radially symmetric atmosphere model.
fitsmgmt.airmass.airmass_obs Calculate effective airmass during an exposure.