avg_fits#
- pyscope.reduction.avg_fits(fnames, pre_normalize=False, mode='0', datatype=<class 'numpy.float32'>, outfile=None, verbose=0)[source]#
Averages a list of FITS images into a single output image.
Averages multiple FITS images into a single output image, with options for pre-normalization, averaging mode, and output data type.
- Parameters:
- fnameslist of
str Paths to FITS files to average.
- pre_normalize
bool, default=`False` Normalize each image by its own mean before combining.
- mode
str, default=`”0”` Averaging mode:
"0"for median,"1"for mean.- datatype
str, default=`”float32”` Data type for the averaged image. Defaults to
"float32"unless pre-normalizing, where"float64"is used.- outfile
str, optional Output path for the averaged image. Defaults to using the first input file name with
"_avg.fts"appended.- verbose
int, default=`0` Logging verbosity level. Use
-vforINFOand-vvforDEBUG.
- fnameslist of
- Returns:
NoneThe averaged FITS image is saved to the specified output file or the default location.
- Raises:
KeyErrorIf required FITS header keywords (e.g.,
FRAMETYP,EXPTIME) are missing.ValueErrorIf the input images have incompatible dimensions or data types.