def stackMags(targname, filter): jdanUse = getJdan(targname, filter) cat1 = np.loadtxt(workdir + catDir + jdanUse[0] + "_" + targname + "_magList.dat", dtype=float) cat2 = np.loadtxt(workdir + catDir + jdanUse[1] + "_" + targname + "_magList.dat", dtype=float) cat3 = np.loadtxt(workdir + catDir + jdanUse[2] + "_" + targname + "_magList.dat", dtype=float) cat4 = np.loadtxt(workdir + catDir + jdanUse[3] + "_" + targname + "_magList.dat", dtype=float) final_cat = np.array((cat1, cat2, cat3, cat4)) # print(final_cat.shape) np.savetxt(workdir + catDir + targname + "_" + filter + "_magList.dat", final_cat.T, fmt="%1.5f") return None
def pullRawPos(targname,filter): jdanUse = getJdan(targname,filter) # master = np.loadtxt(coordDir+targname+"_"+filter+"_coords.txt") master = np.loadtxt(coordDir+targname+"_"+filter+"_coords.txt") # coordRows = master[:,[ra_ind,dec_ind,flux,c_star]] #working line # trying to output xr and yr coordRows = master[:,[ra_ind,dec_ind,flux,c_star]] #edited newCols = np.zeros((len(coordRows),28)) counter = 0 for jj in range(len(jdanUse)): # cat = np.loadtxt(posDir+ jdanUse[jj] +"_"+targname+'_'+ filter +"_dc_t.dat",comments='#') # transformed points # cat = np.loadtxt(coordDir+ jdanUse[jj] +"_"+targname+'_'+ filter +"_at.dat",comments='#') cat = np.loadtxt(coordDir+ jdanUse[jj] +"_"+targname+'_'+ filter +"_at.dat",comments='#') if jj==0: idcol = id else: idcol = xt+jj+1 rowsMast = np.transpose(master) newIDcol = rowsMast[idcol] idx = np.asarray(newIDcol,int) # reg = cat[idx] newCols[:,counter] = reg[:,xr] counter += 1 newCols[:,counter] = reg[:,yr] counter += 1 newCols[:,counter] = reg[:,xc] counter += 1 newCols[:,counter] = reg[:,yc] counter += 1 newCols[:,counter] = reg[:,xt] counter += 1 newCols[:,counter] = reg[:,yt] counter += 1 newCols[:,counter] = reg[:,magr] counter += 1 magList = np.hstack((coordRows, newCols)) header = 'RA DEC flux c_star xr_1 yr_1 xc_1 yc_1 xt_1 yt_1 mag1 xr_2 yr_2 xc_2 yc_2 xt_2 yt_2 mag2 xr_3 yr_3 xc_3 yc_3 xt_3 yt_3 mag3 xr_4 yr_4 xc_4 yc_4 xt_4 yt_4 mag4' # np.savetxt(out_dir+targname+"_"+filter+"_xy.dat", magList, fmt="%1.5f",header=header) np.savetxt(out_dir+targname+"_"+filter+"_xy.dat", magList, fmt="%1.5f",header=header) return None
def pullRawPos(targname, filter): jdanUse = getJdan(targname, filter) master = np.loadtxt(workdir + coordDir + targname + "_" + filter + "_coords.txt") # coordRows = master[:,[ra_ind,dec_ind,flux,c_star]] #working line # trying to output xr and yr coordRows = master[:, [ra_ind, dec_ind, flux, c_star]] #edited newCols = np.zeros((len(coordRows), 12)) counter = 0 for jj in range(len(jdanUse)): cat = np.loadtxt(workdir + catDir + jdanUse[jj] + "_" + targname + "_oc.dat", comments='#') if jj == 0: idcol = id else: idcol = xo + jj + 1 rowsMast = np.transpose(master) newIDcol = rowsMast[idcol] idx = np.asarray(newIDcol, int) # reg = cat[idx] newCols[:, counter] = reg[:, xr] counter += 1 newCols[:, counter] = reg[:, yr] counter += 1 newCols[:, counter] = reg[:, magr] counter += 1 magList = np.hstack((coordRows, newCols)) header = 'RA DEC flux c_star xr_1 yr_1 mag1 xr_2 yr_2 mag2 xr_3 yr_3 mag3 xr_4 yr_4 mag4' np.savetxt(workdir + magDir + targname + "_" + filter + "_xy.dat", magList, fmt="%1.5f", header=header) return None