def new_dataset (label, energy_form, dep_type, dep_units, data_hz): # build new set of coordinates with proper photon energy form crdlist = [] for hz_crd in data_hz: crdlist.append(graph.coord_obj(energy_form.from_hz(hz_crd.x), hz_crd.y)) return graph.data_set(label, energy_form.type, energy_form.units, dep_type, dep_units, crdlist)
def graph_list (gui, array): # build and return list of coordinates crdlist = [] for i, item in enumerate(array): crdlist.append(graph.coord_obj(gui.interp.freq_list[i], item)) return crdlist
def add_trans (gui, graph_obj, site_file): trans_list = sigtrans.trans(gui, site_file.file) # build and return list of coordinates crdlist = [] for i, trans_val in enumerate(trans_list): crdlist.append(graph.coord_obj(gui.interp.freq_list[i], trans_val)) # build data set and add to graph data_set = new_dataset("Atmos Trans ("+site_file.name+")", gui.energy_form, "Transmission", "Proportion", crdlist) graph_obj.dataset_list.append(data_set)
def add_signal (gui, graph_obj, aperture, site_file, source_file, spec_res): sig_list = sigtrans.signal(gui, aperture, site_file.file, source_file.file, spec_res) # build and return list of coordinates (freq, signal) crdlist = [] for i, signal_val in enumerate(sig_list): if gui.signal_units == 1: # convert W -> photons/s signal_val /= const.h * gui.interp.freq_list[i] crdlist.append(graph.coord_obj(gui.interp.freq_list[i], signal_val)) # build data set and add to graph data_set = new_dataset( "Signal ("+str(aperture)+" m, "+site_file.name+", "+source_file.name+")", gui.energy_form, "Signal", signal_units(gui), crdlist) graph_obj.dataset_list.append(data_set)
def add_integ (gui, graph_obj, label, atmos_site, galactic_file, mirror_temp, mirror_constant, zodiac_file, cib, cmb, aperture, site_file, source_file, snr, spec_res): # compute noise and signal and, with signal:noise ratio, integration time blingsq_tot = bling.noise_total(gui, atmos_site.file, galactic_file.file, mirror_temp, mirror_constant, zodiac_file.file, cib, cmb, spec_res) sig_list = sigtrans.signal(gui, aperture, site_file.file, source_file.file, spec_res) integ_time = cal.IT(blingsq_tot, snr, sig_list) # array of integration times # build and return list of coordinates crdlist = [] for i, integ_val in enumerate(integ_time): crdlist.append(graph.coord_obj(gui.interp.freq_list[i], integ_val)) # build data set and add to graph data_set = new_dataset("Integration Time ("+label+")", gui.energy_form, "Time", "s", crdlist) graph_obj.dataset_list.append(data_set)