Ejemplo n.º 1
0
    def __init__(self, **kwargs):

        infits = kwargs.get('infits', '/Users/khamren/M31_Research/splash_data/DiskSample.fits')
        
        self.d31 = 41.269 
        self.r31 = 10.68

        #Read in Data
        hdu = pyfits.open(infits)
        cols = hdu[1].columns.names
        data = hdu[1].data

        #We're only going to deal with stars that have colors and valid positions
        f4 = data.F475W
        f8 = data.F814W
        
        good = (f4 < 99) & (f8 < 99) & (f4 == f4) & (f8 == f8) & (data.RA != '00:00:00')
        self.f475w = f4[good]
        self.f814w = f8[good]

        data_good = data[good]
        self.params = {}
        for c in cols:
            self.params[c] = data_good.field(c)

#        self.lbin = data_good.LBIN
#        self.spec = data_good.SPEC
#        self.ivar = data_good.IVAR
#        self.ssnr = data_good.SSNR

        self.cntio = data_good.CN - data_good.TIO

        self.dm = 24.41
        self.cid = data_good.CID
        self.ev = data_good.EVSTAGE

        pos = [hms2deg(ra,dec) for ra, dec in zip(data_good.RA, data_good.DEC)]
        self.ra = np.array([p[0] for p in pos])
        self.dec = np.array([p[1] for p in pos])
        self.createColors()
        self.getMbols()
        self.getCMDefs()
        self.getOtherDefs()
        self.specialSSN()
Ejemplo n.º 2
0
def string2radec(string):
    ra = string[0:10]
    dec = string[13:]
 
    radeg, decdeg = hms2deg(ra,dec)
    return radeg, decdeg
Ejemplo n.º 3
0
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])

b = [b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23]

#---------Get HII Region data--------------------------
ID, hh, hm, hs, dd, dm, ds = np.genfromtxt('/Users/khamren/M31_Research/Metallicity/Sanders2012_Basic.txt', usecols = (0,2,3,4,5,6,7), dtype = str, unpack = True)

rasxg = np.array(['%s:%s:%s' %(h,m,s) for h, m, s in zip(hh, hm, hs)])
decsxg = np.array(['%s:%s:%s' %(d,m,s) for d,m,s in zip(dd, dm, ds)])
ra = np.array([hms2deg(r,d)[0] for r, d in zip(rasxg, decsxg)])
dec = np.array([hms2deg(r,d)[1] for r, d in zip(rasxg, decsxg)])

#fhii = open('/Users/khamren/M31_Research/Metallicity/Sanders2012_allHII_errors.txt','r')
#fpne = open('/Users/khamren/M31_Research/Metallicity/Sanders2012_HII_allO.txt', 'r')
fpne = open('/Users/khamren/M31_Research/Metallicity/Sanders2012_strongline_OH.txt','r')

obj_id = []
obj_oh = []
obj_eoh = []

for line in fpne:
    if line[0] != '#':
        cols = line.strip().split()
        if len(cols) > 1:
            obj_id.append(cols[0])
Ejemplo n.º 4
0
#    term2 = np.sum(1/(sig_guess**2 + sigarr**2))
#    v_guess = term1/term2

    
                  

hdu = pyfits.open('/Users/khamren/M31_Research/splash_data/subMasterSPLASH_zerr.fits')
data = hdu[1].data
cstars = data[(data.CID == 'c') & (data.FIELDTYPE == 'disk') & (data.RA != '00:00:00')]
agb = data[((data.EVSTAGE == 'AGB') | (data.EVSTAGE == 'agb')) & (data.FIELDTYPE == 'disk') & (data.RA != '00:00:00')]
agb_noc = data[((data.EVSTAGE == 'AGB') | (data.EVSTAGE == 'agb')) & (data.FIELDTYPE == 'disk') & (data.RA != '00:00:00') & (data.CID != 'c')]


#cvel = (cstars.Z*c) - (cstars.ABAND*c) - helcorr(keck_long,keck_lat,keck_alt,cra, cdec,cstars.MJD)[0]

cra = np.array([hms2deg(r,d)[0] for r,d in zip(cstars.RA, cstars.DEC)])
cra2 = cra*cosdg(d31)
cdec = np.array([hms2deg(r,d)[1] for r,d in zip(cstars.RA, cstars.DEC)])

cdist = computeDist(cra, cdec)

ara = np.array([hms2deg(r,d)[0] for r,d in zip(agb_noc.RA, agb_noc.DEC)])
ara2 = ara*cosdg(d31)
adec = np.array([hms2deg(r,d)[1] for r,d in zip(agb_noc.RA, agb_noc.DEC)])

ara_all = np.array([hms2deg(r,d)[0] for r,d in zip(agb.RA, agb.DEC)])
ara2_all = ara_all*cosdg(d31)
adec_all = np.array([hms2deg(r,d)[1] for r,d in zip(agb.RA, agb.DEC)])

cvel = np.array([((z*c) - (aband*c) - helcorr(keck_long,keck_lat,keck_alt,r,d, mjd)[0]) for z, aband, r, d, mjd in zip(cstars.Z, cstars.ABAND, cra, cdec, cstars.MJD)])
avel = np.array([((z*c) - (aband*c) - helcorr(keck_long, keck_lat,keck_alt, r,d, mjd)[0]) for z, aband, r, d, mjd in zip(agb_noc.Z, agb_noc.ABAND, ara, adec, agb_noc.MJD)])