
import os, sys
import glob
import numpy as np

from astropy.time import Time

gpstime = 1235145480.52727
skymap = "../data/MS190225p/bayestar.fits.gz"
cls = [0.9]

for cl in cls:
    outputDir = "../output/MS190225p/%.3f_Gattini"%cl
    #system_command = "python gwemopt_run --telescope F60 --doSchedule --doSkymap --doPlots --skymap %s --gpstime %d -o %s --doTiles --doSingleExposure --filters g --exposuretimes 30.0 --powerlaw_cl %.3f --doCatalog --doUseCatalog --tilesType hierarchical"%(skymap,gpstime,outputDir,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/MS190225p/%.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)

    print(stop)
