def getdata( co10_mom0, co10_noise, co21_mom0, co21_noise, freqco10, freqco21, ): """ """ # get beam beamstr = co10_mom0.split("/")[-1].replace(".moment0", "").split("_")[-1].replace( "p", ".") beamfloat = float(beamstr) # # get data data_co10_mom0 = r21.import_data(co10_mom0, mode="data") data_co10_noise = r21.import_data(co10_noise, mode="data") data_co21_mom0 = r21.import_data(co21_mom0, mode="data") data_co21_noise = r21.import_data(co21_noise, mode="data") # # select data cut_all = np.where((data_co10_mom0 > 0) & (data_co10_noise > 0) & (data_co21_mom0 > 0) & (data_co21_noise > 0)) # data_co10_mom0 = data_co10_mom0[cut_all] data_co10_noise = data_co10_noise[cut_all] data_co21_mom0 = data_co21_mom0[cut_all] data_co21_noise = data_co21_noise[cut_all] # # Jy-to-Kelvin log_co10_mom0_k = np.log10(Jy2Kelvin(data_co10_mom0, beamfloat, freqco10)) log_co10_noise_k = np.log10(Jy2Kelvin(data_co10_noise, beamfloat, freqco10)) log_co21_mom0_k = np.log10(Jy2Kelvin(data_co21_mom0, beamfloat, freqco21)) log_co21_noise_k = np.log10(Jy2Kelvin(data_co21_noise, beamfloat, freqco21)) return log_co10_mom0_k, log_co10_noise_k, log_co21_mom0_k, log_co21_noise_k
def getdata( co10_mom0, co10_noise, co21_mom0, co21_noise, freqco10, freqco21, pa, inc, cnt_ra, cnt_dec, scale, def_nucleus, ): """ """ # get beam beamstr = co10_mom0.split("/")[-1].replace(".moment0", "").split("_")[-1].replace( "p", ".") beamfloat = float(beamstr) # # get data data_co10_mom0 = r21.import_data(co10_mom0, mode="data") data_co10_noise = r21.import_data(co10_noise, mode="data") data_co21_mom0 = r21.import_data(co21_mom0, mode="data") data_co21_noise = r21.import_data(co21_noise, mode="data") # data_ra = r21.import_data(co10_mom0, mode="coords", index=0) data_dec = r21.import_data(co10_mom0, mode="coords", index=1) dist = r21.distance(data_ra, data_dec, pa, inc, cnt_ra, cnt_dec, scale) # # select data cut_all = np.where((data_co10_mom0 > 0) & (data_co10_noise > 0) & (data_co21_mom0 > 0) & (data_co21_noise > 0) & (dist > def_nucleus)) # data_co10_mom0 = data_co10_mom0[cut_all] data_co10_noise = data_co10_noise[cut_all] data_co21_mom0 = data_co21_mom0[cut_all] data_co21_noise = data_co21_noise[cut_all] # # Jy-to-Kelvin log_co10_mom0_k = np.log10(Jy2Kelvin(data_co10_mom0, beamfloat, freqco10)) log_co10_noise_k = np.log10(Jy2Kelvin(data_co10_noise, beamfloat, freqco10)) log_co21_mom0_k = np.log10(Jy2Kelvin(data_co21_mom0, beamfloat, freqco21)) log_co21_noise_k = np.log10(Jy2Kelvin(data_co21_noise, beamfloat, freqco21)) return log_co10_mom0_k, log_co10_noise_k, log_co21_mom0_k, log_co21_noise_k
image_co21 = glob.glob(dir_co21 + "co21_" + beamp + ".moment0")[0] image_co21_snr = glob.glob(dir_co21 + "co21_" + beamp + ".moment0.snratio")[0] image_tpeak = glob.glob(dir_co21 + "co21_" + beamp + ".moment8")[0] image_r21 = glob.glob(dir_r21 + "r21_" + beamp + ".moment0")[0] image_r21mask = glob.glob(dir_r21 + "r21_" + beamp + ".moment0.highlowmask")[0] image_w1 = glob.glob(dir_wise + galname + "_w1_gauss" + beamp + ".image")[0] image_w2 = glob.glob(dir_wise + galname + "_w2_gauss" + beamp + ".image")[0] image_w3 = glob.glob(dir_wise + galname + "_w3_gauss" + beamp + ".image")[0] # import data data_ra = r21.import_data(imagename=image_co21, mode="coords") data_dec = r21.import_data(imagename=image_co21, mode="coords", index=1) data_dist = r21.distance(data_ra, data_dec, pas[i], incs[i], cnt_ras[i], cnt_decs[i], scales[i]) data_co10 = r21.import_data(imagename=image_co10, mode="data") data_co21 = r21.import_data(imagename=image_co21, mode="data") data_tpeak = r21.import_data(imagename=image_tpeak, mode="data") data_disp = data_co21 / (np.sqrt(2 * np.pi) * data_tpeak) data_disp[np.isnan(data_disp)] = 0 data_r21 = r21.import_data(imagename=image_r21, mode="data") data_r21mask = r21.import_data(imagename=image_r21mask, mode="data") data_w1 = r21.import_data(imagename=image_w1, mode="data") data_w2 = r21.import_data(imagename=image_w2, mode="data") data_w3 = r21.import_data(imagename=image_w3, mode="data")
".moment0.snratio")[0] image_co21 = glob.glob(dir_co21 + "co21_" + beamp + ".moment0")[0] image_co21_snr = glob.glob(dir_co21 + "co21_" + beamp + ".moment0.snratio")[0] image_pco10 = glob.glob(dir_co10 + "co10_" + beamp + ".moment8")[0] image_pco21 = glob.glob(dir_co21 + "co21_" + beamp + ".moment8")[0] image_r21 = glob.glob(dir_r21 + "r21_" + beamp + ".moment0")[0] image_p21 = glob.glob(dir_r21 + "r21_" + beamp + ".moment8")[0] image_r21mask = glob.glob(dir_r21 + "r21_" + beamp + ".moment0.highlowmask")[0] image_gmcmask = glob.glob(dir_r21 + "cprops_" + beamp + ".mask.fits")[0] image_envmask = glob.glob(dir_r21 + "env_all_" + beamp + ".mask.fits")[0] image_piemask = glob.glob(dir_r21 + "piechart_" + beamp + ".mask.fits")[0] # import data data_ra = r21.import_data(imagename=image_co21, mode="coords") data_dec = r21.import_data(imagename=image_co21, mode="coords", index=1) data_co10 = r21.import_data(imagename=image_co10, mode="data") data_co10snr = r21.import_data(imagename=image_co10_snr, mode="data") data_co21 = r21.import_data(imagename=image_co21, mode="data") data_co21snr = r21.import_data(imagename=image_co21_snr, mode="data") data_pco10 = r21.import_data(imagename=image_pco10, mode="data") data_pco21 = r21.import_data(imagename=image_pco21, mode="data") data_r21 = r21.import_data(imagename=image_r21, mode="data") data_p21 = r21.import_data(imagename=image_p21, mode="data") data_r21mask = r21.import_data(imagename=image_r21mask, mode="data") data_gmcmask = r21.import_data(imagename=image_gmcmask, mode="data") data_envmask = r21.import_data(imagename=image_envmask, mode="data") data_piemask = r21.import_data(imagename=image_piemask, mode="data") # masking