#ifndef STAC_CONFIG_H
#define STAC_CONFIG_H

#include "pslib.h"

// stacConfig.c

// Configuration options
typedef struct {
    int verbose;			// Verbosity level
    float gain, readnoise;		// Gain and readnoise for detectors
    psArray *inputs;			// Input file names
    const char *output;			// Output file name
    bool saveShifts;			// Save shifted images?
    const char *starFile;		// File with star coordinates
    const char *starMapFile;		// File with map for stars
    int outnx, outny;			// Size of output image
    float xOffset, yOffset;		// Offset to get lower-left corner at 0,0
    float saturated;			// Saturation level
    float bad;				// Bad level
    float reject;			// Rejection level
    float frac;				// Fraction of input pixel that must be masked before the pixel is
					// considered bad
    float grad;				// Multiplier of the gradient
    int nReject;			// Number of rejection iterations
    float xMapDiff, yMapDiff;		// Difference between pure map and output image coordinates
    float aper;				// Aperture size (pixels)
} stacConfig;

// Allocator
stacConfig *stacConfigAlloc(void);
// Deallocator
void stacConfigFree(stacConfig *config);

// Help message
void help(const char *name);

// Parse the command line and return config
stacConfig *stacParseConfig(int argc,	// Number of command-line arguments
			    char **argv // Command-line arguments
    );

#endif
