getimages.h

Overview

These are higher-level functions, with specializations for reading in mask, noise, and PSF images; they make use of the functions in image_io.h.

API

Files: core/getimages.h, core/getimages.cpp

Functions for reading in (and checking) various images (other than main data image): mask, error, PSF, and oversampled PSF images. For use with makeimage, imfit, and imfit-mcmc.

Functions

std::tuple<double*, int> GetAndCheckImage(const string imageName, const string imageType, int nColumns_ref, int nRows_ref)

Main utility function: reads in image from FITS file imageName and checks dimensions against reference values (if latter are nonzero)

Main utility function: reads in image from FITS file imageName and checks dimensions against reference values (if latter are nonzero). Returns (nullptr, -1) if unable to read image-data from file; returns -2 (and frees allocated memory) if image dimensions do not match references dimensions (unless latter are both 0).

std::tuple<double*, double*, int> GetMaskAndErrorImages(int nColumns, int nRows, string &maskFileName, string &errorFileName, bool &maskPixelsAllocated, bool &errorPixelsAllocated)

Reads in mask and/or noise/error images.

Function which retrieves and checks dimensions for mask and/or noise/error images. Returns tuple of (maskPixels, errorPixels, status), where maxPixels and errorPixels are double * (and are = nullptr when image in question was not requested). In case of errors in retrieving image data &#8212; or if image dimensions do not match reference dimensions nColumns, nRows &#8212; then (nullptr, nullptr, -1) is returned. Return values: status = 1: mask image loaded, but no error image specified status = 2: error image loaded, but no mask image was specified status = 3: both images specified & loaded

std::tuple<double*, int, int, int> GetPsfImage(const string &psfFileName)

Reads in PSF image, returning dimensions as well.

Function which reads and returns data corresponding to requested PSF image, along with PSF image dimensions: tuple of (psfPixels, nColumns_psf, nRows_psf, status). In case of errors in retrieving image data, return value is (nullptr, 0, 0, -1)

int GetOversampledPsfInfo(const std::shared_ptr<OptionsBase> options, int xOffset, int yOffset, vector<PsfOversamplingInfo*> &psfOversamplingInfoVect)

Reads in multiple oversampled PSF images, storing them (along with user-specified info like oversampling scale and image regions for oversampling) in a vector of (pointers to) PsfOversamplingInfo objects.