def plot(): npix = 1200 d31 = 41.269 #degrees: declination r31 = 10.68*np.cos(d31*np.pi/180.) #degrees, tangent plane, RA #plot plt.clf() im = show_galex.show_galex() #filename = '../plots/' + stat + 'v-map-galex.eps' fig = plt.axes() aTod = 0.000278 R1 = 2250.*aTod R2 = 3700.*aTod c1 = plt.Circle((0,0), radius = R1*13.76, fill = False, edgecolor = 'white', lw = 2) c2 = plt.Circle((0,0), radius = R2*13.76, fill = False, edgecolor = 'white', lw = 2) fig.add_patch(c1) fig.add_patch(c2) fig.set_xlim(-15., 15) fig.set_ylim(-10, 16) fig.set_xticklabels(['','','-5', '0', '5', '10','15'], size = 22) fig.set_yticklabels([ '-10', '-5', '0', '5', '10','15'], size = 22) fig.set_xticks([15, 10, 5, 0, -5,-10,-15]) fig.set_yticks([-10, -5, 0, 5, 10, 15]) fig.set_xlim(-16,5) fig.set_xlabel(r'$\xi$\textrm{ (kpc)}', size = 22) fig.set_ylabel(r'$\eta$\textrm{ (kpc)}', size = 22) fig.set_aspect('equal') plt.savefig('Galexcircles.png', dpi=500) return
def plot(): npix = 1200 d31 = 41.269 #degrees: declination r31 = 10.68*np.cos(d31*np.pi/180.) #degrees, tangent plane, RA #plot plt.clf() im = show_galex.show_galex() #filename = '../plots/' + stat + 'v-map-galex.eps' fig = plt.axes() #now need to get all radial velocities. just read in the confirmed RGB file. #cfile = '/Users/khamren/M31_Research/CarbonStars/600Line/CstarPositions.txt' #raSEX, decSEX = np.genfromtxt(cfile, unpack = True, usecols = (0, 1), dtype = str) #rgbRA = np.zeros(len(raSEX)) #rgbDEC = np.zeros(len(decSEX)) hdu = pyfits.open('/Users/khamren/M31_Research/splash_data/subMasterSPLASH_SPT.fits') data = hdu[1].data teff = np.genfromtxt('/Users/khamren/M31_Research/SpectralTyping/Grid_Based/Phoenix_Res\ ults_Smoothed.txt', usecols = 1) ftype = data.FIELDTYPE disk = (ftype == 'disk') diskstars = data[disk] tdisk = teff[disk] raSEX = diskstars.RA decSEX = diskstars.DEC RA = np.zeros(len(raSEX)) DEC = np.zeros(len(decSEX)) for ind in range(len(raSEX)): RA[ind] = AngularCoordinate(raSEX[ind],sghms = True).d DEC[ind] = AngularCoordinate(decSEX[ind],sghms = False).d #pdb.set_trace() RA *= scipy.special.cosdg(d31) RA -= r31 DEC -= d31 RA *= -13.67 DEC *= 13.67 evstage = diskstars.EVSTAGE agb = (evstage == 'AGB') agbstars = diskstars[agb] agb_ra = RA[agb] agb_dec = DEC[agb] agb_teff = tdisk[agb] # h, xedges, yedges = np.histogram2d(RA, DEC, bins = 50, range = [[-15,15],[-10,16]]) # h[h > 0] = 100 # fig.pcolor(xedges, yedges, h.T) tt = fig.scatter(agb_ra, agb_dec, c = agb_teff,marker = 'o', edgecolors = 'black', s = 50, vmin = 2400, vmax = 7000) plt.colorbar(tt, label = 'T$_{eff}$') fig.set_xlim(-15., 15) fig.set_ylim(-10, 16) fig.set_xticklabels(['','','-5', '0', '5', '10','15'], size = 22) fig.set_yticklabels([ '-10', '-5', '0', '5', '10','15'], size = 22) fig.set_xticks([15, 10, 5, 0, -5,-10,-15]) fig.set_yticks([-10, -5, 0, 5, 10, 15]) fig.set_xlim(-16,5) fig.set_xlabel(r'$\xi$\textrm{ (kpc)}', size = 22) fig.set_ylabel(r'$\eta$\textrm{ (kpc)}', size = 22) fig.set_aspect('equal') pdb.set_trace() #plt.savefig('Mstar_on_Galex.eps', dpi=500) return
if line[0] != '#': cols = line.strip().split() if len(cols) == 3: pne_id.append(cols[0]) pne_oh.append(np.float(cols[1])) pne_eoh.append(np.float(cols[2])) matchInd = [list(ID).index(item) for item in pne_id] ra_pne = ra[matchInd] dec_pne = dec[matchInd] #----------Plot Things------------------------------- py.clf() im = show_galex.show_galex() fig = py.axes() h2_ra_all = (ra_matched-cmbase.r31)*cosdg(cmbase.d31)*-13.67 h2_dec_all = (dec_matched - cmbase.d31)*13.67 pne_ra = (ra_pne - cmbase.r31)*cosdg(cmbase.d31)*-13.67 pne_dec = (dec_pne - cmbase.d31)*13.67 h2_all = fig.scatter(h2_ra_all, h2_dec_all, c = obj_oh, s = 100 , edgecolor = 'black', zorder = 2, vmin = 7.6, vmax = 9.6) #h2_in = fig.scatter(h2_ra_all[inds], h2_dec_all[inds], c = obj_oh[inds], s = 100, marker = 'o', zorder = 3, vmin = 7.6, vmax = 9.6) pne = fig.scatter(pne_ra, pne_dec, c = np.array(pne_oh), vmin = 7.6, vmax = 9.6, s = 100, marker = '^', edgecolor = 'black', zorder = 2) for jj in range(23):
def plot(): npix = 1200 d31 = 41.269 #degrees: declination r31 = 10.68*np.cos(d31*np.pi/180.) #degrees, tangent plane, RA masknames = ['SE_1', 'SE_2', 'SE_3', 'mct04p','mct05p','mct06p', 'mct07p','mct08p','mct09p','mct10p','mct12p','mct13p', 'mct150', 'mct16p','mctA5' ,'mctB4','mctC3', 'mctD3', 'mctE3', 'mctF', 'mctG', 'mctJ', 'mctK', 'mctL'] #positions of m31 masks maskcoords = ['00:43:38.74 41:10:17.4', '00:44:00.82 41:09:27.1 ', '00:44:49.26 41:03:27.6', '00:44:51.81 41:25:19.2 ', '00:44:19.70 41:32:53.5 ', '00:44:33.71 41:36:17.6 ', '00:44:41.77 41:40:03.0 ', '00:44:54.88 41:43:04.8 ', '00:45:39.23 41:38:39.1 ', '00:45:08.24 41:46:19.2 ', '00:45:28.34 41:53:23.3 ', '00:45:42.02 41:56:42.4 ', '00:45:54.36 41:59:43.1 ', '00:46:08.44 42:02:58.6 ', '00:44:18.33 41:39:28.1 ', '00:44:29.04 41:35:10.0 ', '00:45:11.89 41:53:37.7 ', '00:45:09.46 41:49:08.8 ', '00:46:53.23 42:14:59.3 ', '00:44:24.00 41:36:00.0 ', '00:45:53.03 41:42:05.1 ', '00:45:10.80 41:55:48.0 ', '00:46:46.85 42:13:35.3 ', '00:46:19.97 42:14:05.2'] pamask= [39.000, -113.0, -60.00, -142.3, -52.30, -52.30, -52.30, -52.30, -142.3, -52.30, -52.30, -52.30, -52.30, -52.30, 270.00, 270.00, 90.000, 90.000, 90.000, -30.00, 25.000, 35.000, 45.000, 65.000] maskwidth = 4./60. #arcminutes/60 masklength = 16.0/60. #arcminutes/60 #plot plt.clf() im = show_galex.show_galex() #filename = '../plots/' + stat + 'v-map-galex.eps' fig = plt.axes() #positions of HST bricks b1 = np.asarray([12058, 10.87969, 41.26532, 10.63671, 41.34631, 10.57610, 41.24387, 10.81892, 41.16290]) b2 = np.asarray([12073, 11.12029, 41.18549, 10.87790, 41.26699, 10.81699, 41.16468, 11.05921, 41.08321]) b3= np.asarray([12109, 10.95216, 41.36298, 10.70890, 41.44413, 10.64809, 41.34173, 10.89118, 41.26061]) b4=np.asarray([ 12107, 11.19357, 41.28269, 10.95092, 41.36434, 10.88980, 41.26207, 11.13230, 41.18044]) b5=np.asarray([ 12074, 11.04482, 41.45377, 10.80133, 41.53511, 10.74029, 41.43276, 10.98361, 41.35144]) b6=np.asarray([ 12105, 11.28646, 41.37401, 11.04358, 41.45586, 10.98223, 41.35363, 11.22495, 41.27182]) b7=np.asarray([ 12113, 11.13774, 41.54510, 10.89403, 41.62664, 10.83276, 41.52434, 11.07630, 41.44284]) b8=np.asarray([ 12075, 11.37848, 41.46474, 11.13539, 41.54679, 11.07381, 41.44462, 11.31675, 41.36260]) b9=np.asarray([ 12057, 11.22980, 41.63532, 10.98587, 41.71706, 10.92436, 41.61481, 11.16813, 41.53310]) b10=np.asarray([ 12111, 11.47410, 41.55495, 11.23079, 41.63719, 11.16898, 41.53508, 11.41213, 41.45287]) b11=np.asarray([ 12115, 11.28791, 41.71003, 11.02353, 41.74143, 10.99982, 41.63066, 11.26404, 41.59933]) b12=np.asarray([ 12071, 11.54277, 41.65341, 11.29918, 41.73581, 11.23717, 41.63373, 11.48060, 41.55137]) b13=np.asarray([ 12114, 11.31717, 41.81950, 11.05228, 41.85054, 11.02883, 41.73975, 11.29355, 41.70886]) b14=np.asarray([ 12072, 11.57892, 41.78777, 11.31430, 41.81941, 11.29041, 41.70867, 11.55487, 41.67718]) b15=np.asarray([ 12056, 11.37644, 41.92498, 11.11115, 41.95616, 11.08756, 41.84538, 11.35268, 41.81435]) b16=np.asarray([ 12106, 11.63914, 41.89310, 11.37413, 41.92490, 11.35010, 41.81416, 11.61495, 41.78253]) b17=np.asarray([ 12059, 11.48855, 42.02423, 11.22291, 42.05568, 11.19909, 41.94492, 11.46456, 41.91363]) b18=np.asarray([ 12108, 11.75272, 41.99292, 11.48736, 42.02497, 11.46310, 41.91427, 11.72830, 41.88238]) b19=np.asarray([ 12110, 11.62005, 42.12072, 11.35409, 42.15246, 11.33001, 42.04174, 11.59581, 42.01015]) b20=np.asarray([ 12112, 11.88344, 42.08995, 11.61776, 42.12230, 11.59324, 42.01163, 11.85876, 41.97944]) b21=np.asarray([ 12055, 11.68571, 42.22514, 11.41935, 42.25704, 11.39512, 42.14633, 11.66131, 42.11460]) b22=np.asarray([ 12076, 11.95062, 42.19503, 11.68455, 42.22754, 11.65987, 42.11690, 11.92579, 42.08456]) b23=np.asarray([ 12070, 11.86064, 42.31678, 11.59401, 42.34909, 11.56944, 42.23843, 11.83591, 42.20629]) bricks = [b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23] for jj in range(len(bricks)): thisbrick = bricks[jj] print 'number ', jj deccorners = np.asarray([thisbrick[2], thisbrick[4], thisbrick[6], thisbrick[8], thisbrick[2]]) racorners = np.asarray([thisbrick[1], thisbrick[3], thisbrick[5], thisbrick[7], thisbrick[1]])*scipy.special.cosdg(d31) - r31 deccorners -= d31 racorners *= -13.67 deccorners *= 13.67 # if jj == 0: # fig.plot(racorners, deccorners, 'white', label = 'PHAT bricks', linewidth=2) # else: # fig.plot(racorners, deccorners, 'white',linewidth=2) #now need to get all radial velocities. just read in the confirmed RGB file. #cfile = '/Users/khamren/M31_Research/CarbonStars/600Line/CstarPositions.txt' #raSEX, decSEX = np.genfromtxt(cfile, unpack = True, usecols = (0, 1), dtype = str) #rgbRA = np.zeros(len(raSEX)) #rgbDEC = np.zeros(len(decSEX)) hdu = pyfits.open('/Users/khamren/M31_Research/splash_data/Cstars.fits') data = hdu[1].data raSEX = data.RA decSEX = data.DEC rgbRA = np.zeros(len(raSEX)) rgbDEC = np.zeros(len(decSEX)) for ind in range(len(raSEX)): rgbRA[ind] = AngularCoordinate(raSEX[ind],sghms = True).d rgbDEC[ind] = AngularCoordinate(decSEX[ind],sghms = False).d rgbRA *= scipy.special.cosdg(d31) rgbRA -= r31 rgbDEC -= d31 rgbRA *= -13.67 rgbDEC *= 13.67 tt = fig.scatter(rgbRA, rgbDEC, c = 'r',marker = '*', edgecolors = 'none', s = 400) #plt.colorbar(tt, label = 'Smoothed velocity dispersion (km/s)') fig.set_xlim(-15., 15) fig.set_ylim(-10, 16) fig.set_xticklabels(['','','-5', '0', '5', '10','15'], size = 22) fig.set_yticklabels([ '-10', '-5', '0', '5', '10','15'], size = 22) fig.set_xticks([15, 10, 5, 0, -5,-10,-15]) fig.set_yticks([-10, -5, 0, 5, 10, 15]) fig.set_xlim(-16,5) fig.set_xlabel(r'$\xi$\textrm{ (kpc)}', size = 22) fig.set_ylabel(r'$\eta$\textrm{ (kpc)}', size = 22) fig.set_aspect('equal') plt.savefig('/Users/khamren/Dropbox/Conference/CstarsGALEX.png', dpi=500) return
def plot(): npix = 1200 d31 = 41.269 #degrees: declination r31 = 10.68*np.cos(d31*np.pi/180.) #degrees, tangent plane, RA #plot plt.clf() im = show_galex.show_galex() #filename = '../plots/' + stat + 'v-map-galex.eps' fig = plt.axes() #now need to get all radial velocities. just read in the confirmed RGB file. #cfile = '/Users/khamren/M31_Research/CarbonStars/600Line/CstarPositions.txt' #raSEX, decSEX = np.genfromtxt(cfile, unpack = True, usecols = (0, 1), dtype = str) #rgbRA = np.zeros(len(raSEX)) #rgbDEC = np.zeros(len(decSEX)) hdu = pyfits.open('/Users/khamren/M31_Research/splash_data/Cstars.fits') data = hdu[1].data raSEX = data.RA decSEX = data.DEC cRA = np.zeros(len(raSEX)) cDEC = np.zeros(len(decSEX)) for ind in range(len(raSEX)): cRA[ind] = AngularCoordinate(raSEX[ind],sghms = True).d cDEC[ind] = AngularCoordinate(decSEX[ind],sghms = False).d cB_I = data.F475W - data.F814W cRA *= scipy.special.cosdg(cDEC) cRA -= r31 cDEC -= d31 cRA *= -13.67 cDEC *= 13.67 #Color code by Teff # cstar,cteff = np.loadtxt('/Users/khamren/M31_Research/SpectralTyping/Grid_Based/Cstar_S\ # pecTyping_Results.txt', usecols = (0,2),dtype = 'S32,f', unpack = True) # fullname = data.FULLNAME # matches = [i for i,e in enumerate(fullname) if e in cstar] # othermatches = [i for i,e in enumerate(cstar) if e in fullname] # cteff = cteff[othermatches] # tt = fig.scatter(cRA[matches], cDEC[matches], c = cteff,marker = '*', edgecolors = 'none', s = 100, vmin = 2600, vmax = 4000) # # plt.colorbar(tt, label = 'T$_{eff}$') tt = fig.scatter(cRA, cDEC, c = cB_I, marker = '*', edgecolors = 'black', s = 200, vmin = 2, vmax = 7 ) plt.colorbar(tt, label = 'F475W - F814W') fig.set_xlim(-15., 15) fig.set_ylim(-10, 16) fig.set_xticklabels(['','','-5', '0', '5', '10','15'], size = 22) fig.set_yticklabels([ '-10', '-5', '0', '5', '10','15'], size = 22) fig.set_xticks([15, 10, 5, 0, -5,-10,-15]) fig.set_yticks([-10, -5, 0, 5, 10, 15]) fig.set_xlim(-16,5) fig.set_xlabel(r'$\xi$\textrm{ (kpc)}', size = 22) fig.set_ylabel(r'$\eta$\textrm{ (kpc)}', size = 22) fig.set_aspect('equal') pdb.set_trace() #plt.savefig('/Users/khamren/M31_Research/Plots/Position/CstarGalex.png', dpi=500) return