#!/bin/csh

set catdir = catdir.test

mkcmf -forcedwarp -photcode SIMTEST.g.ForcedWarp testdata/test.01.txt testdata/warp.01.cmf -extroot SkyChip -date 2010/01/01 -time 01:00:00 -mjd 55197.0416667 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 1 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.g.ForcedWarp testdata/test.02.txt testdata/warp.02.cmf -extroot SkyChip -date 2010/01/01 -time 02:00:00 -mjd 55197.0833333 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 2 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.g.ForcedWarp testdata/test.03.txt testdata/warp.03.cmf -extroot SkyChip -date 2010/01/01 -time 03:00:00 -mjd 55197.125 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 3 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.g.ForcedWarp testdata/test.04.txt testdata/warp.04.cmf -extroot SkyChip -date 2010/01/01 -time 04:00:00 -mjd 55197.1666667 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 4 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp testdata/test.13.txt testdata/warp.13.cmf -extroot SkyChip -date 2010/01/02 -time 01:00:00 -mjd 55198.0416667 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 13 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp testdata/test.14.txt testdata/warp.14.cmf -extroot SkyChip -date 2010/01/02 -time 02:00:00 -mjd 55198.0833333 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 14 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp testdata/test.15.txt testdata/warp.15.cmf -extroot SkyChip -date 2010/01/02 -time 03:00:00 -mjd 55198.125 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 15 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp testdata/test.16.txt testdata/warp.16.cmf -extroot SkyChip -date 2010/01/02 -time 04:00:00 -mjd 55198.1666667 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 16 -sourceID 2 -tess_id RINGS.V3 -skycell skycell.1133.081 -bad-psfqf-frac 0.2
mkcmf -forcedgalaxy -photcode SIMTEST.g.ForcedWarp testdata/test.01.txt testdata/fgal.01.cmf -extroot SkyChip -date 2008/1/1 -time 0:00:00 -mjd 54466.0 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 1 -sourceID 1 -tess_id RINGS.V3 -skycell skycell.1133.081
mkcmf -forcedgalaxy -photcode SIMTEST.r.ForcedWarp testdata/test.04.txt testdata/fgal.04.cmf -extroot SkyChip -date 2008/1/1 -time 3:00:00 -mjd 54466.0 -radec 10.0 20.0 -type PS1_V5_Lensing -imageID 4 -sourceID 1 -tess_id RINGS.V3 -skycell skycell.1133.081

addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.01.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.02.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.03.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.04.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.13.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.14.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.15.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad
addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest testdata/warp.16.cmf -D CATFORMAT PS1_V5 -quick-airmass -xrad

loadgalphot -D CATDIR $catdir testdata/fgal.01.cmf
loadgalphot -D CATDIR $catdir testdata/fgal.04.cmf
