# Output directories and filename odir = os.path.expanduser(output) otypes_dir = {} otypes_filename = {} # Morphological radii sradii = '' for r in radii: for v in r: sradii = sradii + str(v) + '_' sradii = sradii[0: -1] # Load in the wave params params = swave_params.waves(lon_start=-180 * u.degree + 0.0 * u.degree)[example] # Unraveling params are different compared to the wave definition params params_unravel = copy.deepcopy(params) # Sum over many of the original bins used to create the wave in an attempt to # beat down transform artifacts params_unravel['lon_bin'] = unraveling_factor * params['lon_bin'] params_unravel['lat_bin'] = unraveling_factor * params['lat_bin'] # Move zero location of longitudinal reconstruction relative to the # wavefront # params_unravel['lon_min'] = params_unravel['lon_min'] # params_unravel['lon_max'] = params_unravel['lon_max'] # Storage for the results
str(ntrials) + '_' + str(max_steps) + '_' + str(temporal_summing) + '_' + str(spatial_summing.value), sradii, position_choice + '_' + error_choice, aware_utils.convert_dict_to_single_string(ransac_kwargs)]: idir = os.path.join(idir, loc) filename = filename + loc + '.' filename = filename[0: -1] if not(os.path.exists(idir)): os.makedirs(idir) otypes_dir[ot] = idir otypes_filename[ot] = filename + '.' + str(great_circle_points) # Load in the wave params if not sws.observational: params = swave_params.waves()[example] # # Load the results # if not os.path.exists(otypes_dir['dat']): os.makedirs(otypes_dir['dat']) filepath = os.path.join(otypes_dir['dat'], otypes_filename['dat'] + '.pkl') print('\nLoading ' + filepath + '\n') f = open(filepath, 'rb') results = pickle.load(f) f.close() # How many arcs? nlon = len(results[0]) angles = ((np.linspace(0, 2*np.pi, nlon+1))[0:-1] * u.rad).to(u.deg)
print(' - special designation = %s' % special_designation) print(' - position choice = %s' % position_choice) print(' - error choice = %s' % error_choice) print(' - along wavefront sampling = %i' % along_wavefront_sampling) print(' - perpendicular to wavefront sampling = %i' % perpendicular_to_wavefront_sampling) print(' - RANSAC parameters = %s' % str(ransac_kwargs)) print(' - starting trial %i out of %i\n' % (i + 1, n_random)) if not observational: print('\nSimulating %s ' % wave_name) if not use_saved: # Simulate the wave and return a dictionary print(" - Creating test waves.") # Load in the wave params simulated_wave_parameters = swave_params.waves()[wave_name] # Transform parameters used to convert HPC image data to HG data. # The HPC data is transformed to HG using the location below as the # "pole" around which the data is transformed transform_hpc2hg_parameters['epi_lon'] = -simulated_wave_parameters['epi_lon'] transform_hpc2hg_parameters['epi_lat'] = -simulated_wave_parameters['epi_lat'] # Simulate the waves euv_wave_data = wave2d.simulate(simulated_wave_parameters, max_steps, verbose=True, output=['finalmaps','raw', 'transformed', 'noise'], use_transform2=use_transform2) if save_test_waves: print(" - Saving test waves.") file_path = os.path.join(otypes_dir['dat'], otypes_filename['dat'] + '.pkl')
# Output directories and filename odir = os.path.expanduser(output) otypes_dir = {} otypes_filename = {} # Morphological radii sradii = '' for r in radii: for v in r: sradii = sradii + str(v) + '_' sradii = sradii[0: -1] # Load in the simulated wave params simulated_wave_parameters = swave_params.waves(lon_start=-180 * u.degree + 0.0 * u.degree)[example] # Unraveling parameters used to convert HPC image data to HG data unraveling_hpc2hg_parameters = {'lon_bin': 1.0*u.degree, 'lat_bin': 1.0*u.degree, 'epi_lon': 0.0*u.degree, 'epi_lat': 0.0*u.degree, 'lon_num': 200*u.pixel, 'lat_num': 300*u.pixel} # Unraveling parameters used to convert HG image data to HPC data unraveling_hg2hpc_parameters = {'epi_lon': simulated_wave_parameters['epi_lon'], 'epi_lat': simulated_wave_parameters['epi_lat'], 'xnum': 800*u.pixel, 'ynum': 800*u.pixel}