from ObservationSim import Observation
from Pointing import *
import os
import numpy as np
import galsim

import gc
gc.enable()

#############################################
# Testing run one exposure (NOT using MPI)
# ipoint = 2
# pointRa = float('{:8.4f}'.format(pRA[ipoint]))
# pointDec = float('{:8.4f}'.format(pDEC[ipoint]))

# obs = Observation(work_dir=work_dir, data_dir=data_dir)
# obs.runExposure(ra_cen=pointRa, dec_cen=pointDec, pointing_ID=ipoint, oneChip=16)

#############################################
# Testing run pointing list (using MPI)
obs = Observation(work_dir=work_dir, data_dir=data_dir)
# obs.runExposure_MPI_PointingList(ra_cen=pRA, dec_cen=pDEC, pRange=pRange, timestamp_obs=timestamp_obs, pointing_type=pointing_type)
obs.runExposure_MPI_PointingList(ra_cen=pRA, dec_cen=pDEC, pRange=pRange, timestamp_obs=timestamp_obs, pointing_type=pointing_type, exptime=exp_time)
