[general]
std-out-err-fname = 'logs/{processing_step:s}_{task:s}_{now:s}_pid{pid:d}.outerr'
logging-fname = 'logs/{processing_step:s}_{task:s}_{now:s}_pid{pid:d}.log'
verbose = debug

[calibrate]
saturation-threshold = 15000
fnum = 'int(RAWFNAME.split('-')[1].split('_')[0])'
bias-level-adu = 512
compress-calibrated = 16
raw-hdu = 'R:1'
split-channels = 'R(0,1;0,1)'
calibrated-fname = 'CAL/{IMAGETYP}/{RAWFNAME}.fits.fz'

[masters]
stacked-master-fname = 'MASTERS/{IMAGETYP}_{CLRCHNL}.fits.fz'
high-flat-master-fname = 'MASTERS/{IMAGETYP}_{CLRCHNL}.fits.fz'
low-flat-master-fname = 'MASTERS/low{IMAGETYP}_{CLRCHNL}.fits.fz'
min-high-combine = 8

[find-stars]
filter-sources = flux > 300
srcfind-tool = fistar
brightness-threshold = 300
srcextract-psf-params = [s, d, k]
srcextract-psfmap-terms = "O0{x}"

[astrometry]
astrometry-catalog-max-magnitude = 12.0
frame-fov-estimate = [2.0 * units.deg, 2.0 * units.deg]
frame-center-estimate = [RA * 15.0 * units.deg, DEC * units.deg]
tweak-order = [1,3]
astrometry-order = 3
max-srcmatch-distance = 1.5
max-astrom-iter = 20
trans-threshold = 1e-3
min-match-fraction = 0.8
anet-api-key = kqrzybsrrzomydyc

[PSF model]
shape-mode = psf
shape-grid = "-5,5"
shape-terms = O0{x}

[aperture photometry]
apertures = [1.0, 2.0, 3.0, 4.0]

[magfit]
single-photref-dr-fname = 'DR/10-465248_2_center.h5'
master-photref-fname-format = 'MASTERS/mphotref_{OBJECT}_{CLRCHNL}_{EXPTIME}sec_iter{magfit_iteration:03d}.fits'
magfit-stat-fname-format = 'MASTERS/mfit_stat_{OBJECT}_{CLRCHNL}_{EXPTIME}sec_iter{magfit_iteration:03d}.txt'
correction-parametrization = O2{phot_g_mean_mag, x, y}

[lightcurves]
latitude-deg = {SITELAT}
longitude-deg = {SITELONG}
altitude-meters = {SITEALT}
lightcurve-catalog-fname = MASTERS/lc_catalog_{OBJECT}_{CLRCHNL}_{EXPTIME}.fits

[epd]
epd-datasets = 'apphot.magfit.magnitude -> apphot.epd.magnitude : aperture_index in range(4)'
epd-terms-expression = O1{1/cos(z)}
detrending-catalog = MASTERS/lc_catalog_G10124500_139_R_30.fits
epd-statistics-fname = MASTERS/epd_statistics.txt

[tfa]
tfa-datasets = 'apphot.epd.magnitude -> apphot.tfa.magnitude : aperture_index in range(4)'
tfa-faint-mag-limit = 12
tfa-min-observations-quantile = 0.8
tfa-sqrt-num-templates = 2
tfa-statistics-fname = MASTERS/tfa_statistics.txt
