def explore_decenter_parameter_space(decenter_parameter, values): for _value in values: print _value # Build .seq file for automated run. TEL = autoact.AutoACT(ARRAY, descriptors=[ "secondary_decentering", "pa%s" % (ARRAY), decenter_parameter, _value ]) TEL.create_header() TEL.load_clean_len() TEL.remove_glass() TEL.apply_ar_coatings() TEL.set_wavelengths( wavelengths=[int(autov.freq2lambda(int(args.frequency)))], reference=0) # surface 4 is the secondary TEL.set_decenter_type(4, 'decenter and return') TEL.decenter_surface(4, decenter_parameter, _value) TEL.set_fields(polarization=1) TEL.set_vignetting() TEL.activate_pol_ray_trace() TEL.set_image_semi_aperture() TEL.run_psf() TEL.run_real_ray_trace() # skipping polarization analysis, since it'll just slow us down for now #TEL.run_poldsp(input_angle=0, pupil_number=23) #TEL.run_poldsp(input_angle=90, pupil_number=23) TEL.exit() TEL.run() file_name = TEL.save_cfg(out_dir="./output/")
# Parse arguments passed to the script. parser = argparse.ArgumentParser() parser.add_argument("tolerance", choices=['DLX', 'DLY', 'DLZ', 'DLT', 'DLA', 'DLB', 'DLG'], help="Tolerance you want to automate.") parser.add_argument("surface", choices=['3', '5', '8', '9'], help="Surface you want to tolerance.") args = parser.parse_args() # Setup logging logging.basicConfig(filename='./log/so_tolerancing.log', format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filemode='w', level=logging.DEBUG) logging.debug("Logging started.") tol = args.tolerance sur = args.surface wavelength = autov.freq2lambda(150) # GHz seq_file = "Granet_CrDr_Prim5m_F3_20170219_9deg_f2920_Ls1270_folded_apertures.seq" if tol in ['DLX', 'DLY', 'DLZ', 'DLT']: units = 'cm' #tol_range = (np.array(range(50))+1)/10. # 0 to 5 in 0.1 cm steps # 0 to 1 in 0.05 cm steps, 1 to 5 in 0.1 cm steps tol_range = np.hstack((np.arange(0.05, 1, 0.05), np.arange(1, 5, 0.1))) #tol_range = np.hstack((np.arange(0.05, 1, 0.10), np.arange(1, 5, 0.25), np.arange(5,10,0.5))) #tol_range = tol_range*10*1e3 #mm, then nm #units = 'nm' # changed to nm #tol_range = (np.array(range(10))+1)/1. # 0 to 5 in 0.1 cm steps #tol_range = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] elif tol in ['DLA', 'DLB', 'DLG']: # default angle units are radians in specing the tolerances
"frequency", help="Frequency to run the Code V calculations at in units of GHz.") args = parser.parse_args() ARRAY = args.array DATE = time.strftime('%Y%m%d') CTIME = int(time.time()) outDir = "E:\ownCloud\optics\data\\" tmpDir = "E:\ownCloud\optics\data\\tmp\\" # Build .seq file for automated run. qq = autoact.AutoACT(ARRAY, descriptors=["calibration", "pa%s" % (ARRAY)]) qq.create_header() qq.load_clean_len() qq.remove_glass() qq.apply_ar_coatings() qq.set_wavelengths(wavelengths=[int(autov.freq2lambda(int(args.frequency)))], reference=0) qq.set_fields(polarization=1) qq.set_vignetting() qq.activate_pol_ray_trace() qq.set_image_semi_aperture() #qq.run_psf() #qq.run_real_ray_trace() #qq.run_poldsp(input_angle=0, pupil_number=23) #qq.run_poldsp(input_angle=90, pupil_number=23) #qq.exit() qq.run() #qq.save_cfg(out_dir="../output/calibration/")