In [ ]:
import scda
import pprint
import logging
scda.configure_log()
Parameters selected here are the primary mirror (pm), support struts (ss), secondary strut thickness (sst), secondary mirror (sm). In the image plane, two bandwidths are tested, 10% and 20%. The parameter 'N' = pupil array diameter, and FPM 'rad' = radius each have only one value and therefore is fixed for all designs.
In [ ]:
#survey_params = {'Pupil': { 'pm': ['hex1', 'hex2', 'hex3', 'hex4', 'pie08'],
# 'ss': ['X','Cross'],
# 'sst': ['025','100'],
# 'sm': [True, False],
# 'N': 250 },
# 'FPM': { 'rad': 4. },
# 'LS': { 'shape':['ann', 'hex'], 'obscure':2, 'ppad':3, 'spad':[4,8] },
# 'Image': { 'iwa':[3.5, 3.75, 4.], 'bw':0.10 }}
survey_params = {'Pupil': { 'pm':'hex4', 'sm':True, 'ss':'X', 'sst':'025',
'N': [250, 300, 350, 400, 450, 500] },
'FPM': { 'rad': 4. },
'LS': { 'shape':'ann', 'obscure':1, 'spad':1, 'id':17, 'od':83 },
'Image': { 'c': 10., 'iwa':3.5, 'owa':10., 'bw':0.10, 'Nlam':3 } }
In [ ]:
survey_ampl_dir = "./ampl_survey_test/" # where to write the AMPL source code
In [ ]:
hexap_survey = scda.DesignParamSurvey(scda.QuarterplaneAPLC, survey_params, fileorg={'ampl src dir':survey_ampl_dir})
print("This survey has {0:d} design parameter combinations.".format(hexap_survey.N_combos))
print("{0:d} parameters are varied: {1}".format(len(hexap_survey.varied_param_index), hexap_survey.varied_param_index))
In [ ]:
#i = 100
i = 0
print("Telescope aperture file for design #{:d}: {:s}".format(i+1, hexap_survey.coron_list[i].fileorg['TelAp fname']))
print("Focal plane mask file for design #{:d}: {:s}".format(i+1, hexap_survey.coron_list[i].fileorg['FPM fname']))
print("Lyot stop file for design #{:d}: {:s}".format(i+1, hexap_survey.coron_list[i].fileorg['LS fname']))
In [ ]:
hexap_survey.check_ampl_input_files()
In [ ]:
# pprint.pprint(hexap_survey.varied_param_combos)
In [ ]:
hexap_survey.write_ampl_batch(override_infile_status=True, overwrite=True)
In [ ]:
hexap_survey.write_spreadsheet()
In [ ]:
hexap_survey.write()
In [ ]:
mysurvey = scda.load_design_param_survey(hexap_survey.fileorg['survey fname'])