
import os, sys
import glob
import numpy as np

from astropy.time import Time

gpstime = 1266671079.396973	
skymap = "../data/S200225q/LALInference.fits.gz"
cl = 0.9

outputDir = "../output/S200225q/%.3f_ZTF"%cl
system_command = "python gwemopt_run --telescope ZTF --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g,r --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --exposuretimes 30.0,30.0 --doAlternatingFilters --doBalanceExposure"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)
print(stop)

outputDir = "../output/GW190425/%.3f_TCA_OAJ_IRIS"%cl
system_command = "python gwemopt_run --telescope TCA,OAJ,IRIS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_TCA_OAJ_IRIS_Iterative"%cl
system_command = "python gwemopt_run --telescope TCA,OAJ,IRIS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)
#print(stop)

outputDir = "../output/GW190425/%.3f_TCA_OAJ_IRIS_Overlapping"%cl
system_command = "python gwemopt_run --telescope TCA,OAJ,IRIS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doOverlappingScheduling --mindiff 3600.0"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
#print(system_command)

outputDir = "../output/GW190425/%.3f_ZTF_balance"%cl
system_command = "python gwemopt_run --telescope ZTF --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g,r --exposuretimes 90.0,90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)
print(stop)

outputDir = "../output/GW190425/%.3f_DECam_ZTF_GIT"%cl
system_command = "python gwemopt_run --telescope DECam,ZTF,GIT --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_DECam_ZTF_GIT_Iterative"%cl
system_command = "python gwemopt_run --telescope DECam,ZTF,GIT --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)
#print(stop)

outputDir = "../output/GW190425/%.3f_DECam_ZTF_GIT_Overlapping"%cl
system_command = "python gwemopt_run --telescope DECam,ZTF,GIT --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 90.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doOverlappingScheduling --mindiff 3600.0"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_PS1_ATLAS"%cl
system_command = "python gwemopt_run --telescope PS1,ATLAS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 120.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling"%(skymap,gpstime,outputDir,cl)
os.system(system_command)
print(system_command)
#print(stop)

outputDir = "../output/GW190425/%.3f_PS1_ATLAS_Iterative"%cl
system_command = "python gwemopt_run --telescope PS1,ATLAS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 120.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
os.system(system_command)
print(system_command)
print(stop)

outputDir = "../output/GW190425/%.3f_PS1_ATLAS_Overlapping"%cl
system_command = "python gwemopt_run --telescope PS1,ATLAS --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 120.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doOverlappingScheduling --mindiff 3600.0"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_ATLAS_PS1_Iterative"%cl
system_command = "python gwemopt_run --telescope ATLAS,PS1 --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 120.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_ATLAS_PS1_Overlapping"%cl
system_command = "python gwemopt_run --telescope ATLAS,PS1 --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 120.0 --powerlaw_cl %.3f --doChipGaps --doReferences --doMinimalTiling --doOverlappingScheduling --mindiff 3600.0"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190425/%.3f_GIT_KPED_Nickel"%cl
system_command = "python gwemopt_run --telescope GIT,KPED,Nickel --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --tilesType galaxy --doCatalog"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)
print(stop)

outputDir = "../output/GW190425/%.3f_GIT_KPED_Nickel_Iterative"%cl
system_command = "python gwemopt_run --telescope GIT,KPED,Nickel --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --tilesType galaxy --doCatalog --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

print(stop)

outputDir = "../output/GW190425/%.3f_GIT"%cl
system_command = "python gwemopt_run --telescope GIT --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doReferences"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190426/%.3f_ZTF"%cl
system_command = "python gwemopt_run --telescope ZTF --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doReferences"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190426/%.3f_DECam"%cl
system_command = "python gwemopt_run --telescope DECam --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f"%(skymap,gpstime,outputDir,cl)
os.system(system_command)
print(system_command)
print(stop)

outputDir = "../output/GW190426/%.3f_ZTF_DECam"%cl
system_command = "python gwemopt_run --telescope ZTF,DECam --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doReferences --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
#os.system(system_command)
print(system_command)

outputDir = "../output/GW190426/%.3f_ZTF_DECam_NoRef"%cl
system_command = "python gwemopt_run --telescope ZTF,DECam --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doIterativeTiling"%(skymap,gpstime,outputDir,cl)
os.system(system_command)
print(system_command)
