
import os, sys
import glob
import numpy as np

from astropy.time import Time

gpstime = 1235311089.400738
skymap = "../data/MS190227n/bayestar.fits.gz"
cls = [0.9]

for cl in cls:
    outputDir = "../output/MS190227n/%.3f_TNT"%cl
    system_command = "python gwemopt_run --telescope TNT --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doCatalog --doUseCatalog --tilesType galaxy"%(skymap,gpstime,outputDir,cl)
    print(system_command)
    outputDir = "../output/MS190227n/%.3f_GWAC"%cl
    system_command = "python gwemopt_run --telescope GWAC --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f"%(skymap,gpstime,outputDir,cl)
    #system_command = "python gwemopt_run --telescope Gattini --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f"%(skymap,gpstime,outputDir,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)
    print(system_command)
    #os.system(system_command)

    outputDir = "../output/MS190227n/%.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 --doCatalog"%(skymap,gpstime,outputDir,cl)
    print(system_command)

    outputDir = "../output/MS190227n/%.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 --doCatalog"%(skymap,gpstime,outputDir,cl)
    print(system_command)

    print(stop)
