Skip to content

Commit

Permalink
for type=dir write validation to subdirectopry
Browse files Browse the repository at this point in the history
  • Loading branch information
imedan committed Oct 3, 2023
1 parent 268b1bd commit f7a69b1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bin/validate_designs_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import glob
import time
import datetime

from astropy.io import fits
from astropy.table import Table
Expand Down Expand Up @@ -508,7 +509,19 @@ def valid_design_func(file, exp, obsTime, field_desmodes,
raise MugatuError(message='Improper Validation Type')

if vtype == 'dir':
file_save = directory + 'design_validation_results.fits'
date = datetime.datetime.now()
if not os.path.isdir((directory + '/design_validation_{year}_{month}_{day}'
.format(year='%04d' % date.year,
month='%02d' % date.month,
day='%02d' % date.day))):
os.makedirs((directory + '/design_validation_{year}_{month}_{day}'
.format(year='%04d' % date.year,
month='%02d' % date.month,
day='%02d' % date.day)))
file_save = (directory + '/design_validation_{year}_{month}_{day}/design_validation_results.fits'
.format(year='%04d' % date.year,
month='%02d' % date.month,
day='%02d' % date.day))
elif vtype == 'rs':
if not os.path.isdir((MUGATU_DATA + '/rs_plan_validations/{plan}'
.format(plan=plan))):
Expand Down

0 comments on commit f7a69b1

Please sign in to comment.