def OnClick(self,event): #Extract parameters for simulation run: cubefile = str(self.INPUTCUBEVAL.GetPath()) ditval = float(self.DITVAL.GetValue()) nditval = float(self.NDITVAL.GetValue()) xspaxval = float(self.XSPAXVAL.GetValue()) yspaxval = float(self.YSPAXVAL.GetValue()) photoband = str(self.PHOTOBANDVAL.GetStringSelection()).split(' ')[0] telescopeval = str(self.TELESCOPEVAL.GetStringSelection()) aomodeval = str(self.AOMODEVAL.GetStringSelection()) seeingval = float(self.SEEINGVAL.GetValue()) zenithaval = float(self.ZENITHAVAL.GetValue()) resjitval = float(self.RESJITVAL.GetValue()) sitetempval = float(self.SITETEMPVAL.GetValue()) noiseseedval = self.NOISESEEDVAL.GetStringSelection() if noiseseedval == 'Random': noiseseedval = 0. setrchoice = self.SETRVAL.GetValue() if setrchoice: spec_nyq = False setrval = float(setrchoice) elif not setrchoice: spec_nyq = True setrval = 1. remove_bgval = str(self.REMOVE_BGVAL.GetValue()) return_obval = str(self.OUTPUT_OBVAL.GetValue()) return_tsval = str(self.OUTPUT_TSVAL.GetValue()) return_adrval = str(self.ADRVAL.GetValue()) nprocs = int(self.N_PROCVAL.GetValue()) odir = str(self.DIRVAL.GetPath()) user_PSF = str(self.USERPSFVAL.GetPath()) combnditsval=True print 'Filename: ', cubefile print 'DIT = ', ditval print 'NINT = ', nditval print 'X spaxels = ', xspaxval print 'Y spaxels = ', yspaxval print 'Grating = ', photoband print 'Telescope: ', telescopeval print 'AO = ', aomodeval print 'Seeing = ', seeingval print 'Zenith angle = ', zenithaval print 'Residual jitter = ', resjitval print 'Temperature = ', sitetempval print 'Noise seed = ', noiseseedval print 'Spectral Nyquist sampling? ', spec_nyq print 'Subtract background? ', remove_bgval print 'User PSF? ' , user_PSF print 'Return object cube? ', return_obval print 'Return transmission? ', return_tsval print 'ADR off? ', return_adrval print 'No. of processors = ', nprocs print 'Output directory = ', odir #start main program main(cubefile, odir, ditval, nditval, photoband, (xspaxval, yspaxval), seeingval, zenithaval, telescopeval, user_PSF, aomodeval, resjitval, sitetempval, combnditsval, spec_nyq, setrval, noiseseedval, remove_bgval, return_obval, return_tsval, return_adrval, ver, nprocs)
def OnClick(self, event): #Extract parameters for simulation run: cubefile = str(self.INPUTCUBEVAL.GetPath()) ditval = float(self.DITVAL.GetValue()) nditval = float(self.NDITVAL.GetValue()) xspaxval = float(self.XSPAXVAL.GetValue()) yspaxval = float(self.YSPAXVAL.GetValue()) photoband = str( self.PHOTOBANDVAL.GetStringSelection()).split(' ')[0] telescopeval = str(self.TELESCOPEVAL.GetStringSelection()) aomodeval = str(self.AOMODEVAL.GetStringSelection()) seeingval = float(self.SEEINGVAL.GetValue()) zenithaval = float(self.ZENITHAVAL.GetValue()) resjitval = float(self.RESJITVAL.GetValue()) sitetempval = float(self.SITETEMPVAL.GetValue()) noiseseedval = self.NOISESEEDVAL.GetStringSelection() if noiseseedval == 'Random': noiseseedval = 0. setrchoice = self.SETRVAL.GetValue() if setrchoice: spec_nyq = False setrval = float(setrchoice) elif not setrchoice: spec_nyq = True setrval = 1. remove_bgval = str(self.REMOVE_BGVAL.GetValue()) return_obval = str(self.OUTPUT_OBVAL.GetValue()) return_tsval = str(self.OUTPUT_TSVAL.GetValue()) return_adrval = str(self.ADRVAL.GetValue()) nprocs = int(self.N_PROCVAL.GetValue()) odir = str(self.DIRVAL.GetPath()) user_PSF = str(self.USERPSFVAL.GetPath()) combnditsval = True print 'Filename: ', cubefile print 'DIT = ', ditval print 'NINT = ', nditval print 'X spaxels = ', xspaxval print 'Y spaxels = ', yspaxval print 'Grating = ', photoband print 'Telescope: ', telescopeval print 'AO = ', aomodeval print 'Seeing = ', seeingval print 'Zenith angle = ', zenithaval print 'Residual jitter = ', resjitval print 'Temperature = ', sitetempval print 'Noise seed = ', noiseseedval print 'Spectral Nyquist sampling? ', spec_nyq print 'Subtract background? ', remove_bgval print 'User PSF? ', user_PSF print 'Return object cube? ', return_obval print 'Return transmission? ', return_tsval print 'ADR off? ', return_adrval print 'No. of processors = ', nprocs print 'Output directory = ', odir #start main program main(cubefile, odir, ditval, nditval, photoband, (xspaxval, yspaxval), seeingval, zenithaval, telescopeval, user_PSF, aomodeval, resjitval, sitetempval, combnditsval, spec_nyq, setrval, noiseseedval, remove_bgval, return_obval, return_tsval, return_adrval, ver, nprocs)
site_temp = float(args[12]) combine_ndits = True spec_Nyquist = args[13] if spec_Nyquist == 'True': spec_N = True elif spec_Nyquist == 'False': spec_N = False Spec_samp = float(args[14]) noise_force_seed = int(float(args[15])) remove_background = args[16] return_obj = args[17] return_tra = args[18] return_adr = args[19] #Start main function main(datacube, odir, DIT, NDIT, grat, spax, seeing, zenith_ang, telescope, user_PSF, AO, res_jitter, site_temp, combine_ndits, spec_N, Spec_samp, noise_force_seed, remove_background, return_obj, return_tra, return_adr, ver, nprocs) ## else: ## print"" ## print 'HARMONI Simulator' ## print"" ## print "Unknown option keys. Use either -h for help, or -c for command line usage" ## print"" ## sys.exit() #Use GUI interface if no command line option wxfound = 0 if len(optlist) == 0 and len(args) == 0: try:
combine_ndits = True spec_Nyquist = args[13] if spec_Nyquist == 'True': spec_N = True elif spec_Nyquist == 'False': spec_N = False Spec_samp = float(args[14]) noise_force_seed = int(float(args[15])) remove_background = args[16] return_obj = args[17] return_tra = args[18] return_adr = args[19] #Start main function main(datacube, odir, DIT, NDIT, grat, spax, seeing, zenith_ang, telescope, user_PSF, AO, res_jitter, site_temp, combine_ndits, spec_N, Spec_samp, noise_force_seed, remove_background, return_obj, return_tra, return_adr, ver, nprocs) ## else: ## print"" ## print 'HARMONI Simulator' ## print"" ## print "Unknown option keys. Use either -h for help, or -c for command line usage" ## print"" ## sys.exit() #Use GUI interface if no command line option wxfound = 0 if len(optlist) == 0 and len(args) == 0: try: import wx