示例#1
0
    def runMulti(self, modelGridIn):
        self.print_constraints()

        dustmodelIn, extIn = query_dustmodel_coords(self.const['ra'],
                                                    self.const['dec'],
                                                    self.dust)

        # Instantiate model
        x = classify_grid.obsdata()
        self.addcoords(x)
        self.addspec(x)
        self.addlum(x)
        self.addjhk(x)
        self.addgriz(x)
        self.addgaia(x)
        self.addbv(x)
        self.addbvt(x)
        self.addseismo(x)
        self.addplx(x)
        self.adddmag(x)
        self.paras = classify_grid.classify(input=x,
                                            model=modelGridIn,
                                            dustmodel=dustmodelIn,
                                            ext=extIn,
                                            plot=self.plot,
                                            useav=0,
                                            band=self.const['band'])
示例#2
0
    def run(self):
        self.print_constraints()

        #        model = ebf.read(os.path.join(DATADIR,'mesa.ebf'))
        fn = os.path.join(DATADIR, 'mesa.h5')
        modfile = h5py.File(fn, 'r', driver='core', backing_store=False)
        model = {'age':np.array(modfile['age']),\
        'mass':np.array(modfile['mass']),\
        'feh_init':np.array(modfile['feh']),\
        'feh':np.array(modfile['feh_act']),\
        'teff':np.array(modfile['teff']),\
        'logg':np.array(modfile['logg']),\
        'rad':np.array(modfile['rad']),\
        'lum':np.array(modfile['rad']),\
        'rho':np.array(modfile['rho']),\
        'dage':np.array(modfile['dage']),\
        'dmass':np.array(modfile['dmass']),\
        'dfeh':np.array(modfile['dfeh']),\
        'eep':np.array(modfile['eep']),\
        'bmag':np.array(modfile['bmag']),\
        'vmag':np.array(modfile['vmag']),\
        'btmag':np.array(modfile['btmag']),\
        'vtmag':np.array(modfile['vtmag']),\
        'gmag':np.array(modfile['gmag']),\
        'rmag':np.array(modfile['rmag']),\
        'imag':np.array(modfile['imag']),\
        'zmag':np.array(modfile['zmag']),\
        'jmag':np.array(modfile['jmag']),\
        'hmag':np.array(modfile['hmag']),\
        'kmag':np.array(modfile['kmag']),\
        'bpmag':np.array(modfile['bpmag']),\
        'gamag':np.array(modfile['gamag']),\
        'rpmag':np.array(modfile['rpmag']),\
        'fdnu':np.array(modfile['fdnu']),\
        'avs':np.zeros(len(np.array(modfile['gamag']))),\
        'dis':np.zeros(len(np.array(modfile['gamag'])))}

        model['rho'] = np.log10(model['rho'])
        model['lum'] = model['rad']**2 * (model['teff'] / 5772.)**4
        # next line turns off Dnu scaling relation corrections
        # model['fdnu'][:]=1.
        model['avs'] = np.zeros(len(model['teff']))
        model['dis'] = np.zeros(len(model['teff']))

        dustmodel, ext = query_dustmodel_coords(self.const['ra'],
                                                self.const['dec'], self.dust)

        # Instantiate model
        x = classify_grid.obsdata()
        self.addcoords(x)
        self.addspec(x)
        self.addlum(x)
        self.addjhk(x)
        self.addgriz(x)
        self.addgaia(x)
        self.addbv(x)
        self.addbvt(x)
        self.addseismo(x)
        self.addplx(x)
        self.adddmag(x)
        self.paras = classify_grid.classify(input=x,
                                            model=model,
                                            dustmodel=dustmodel,
                                            ext=ext,
                                            plot=self.plot,
                                            useav=0,
                                            band=self.const['band'])
示例#3
0
    def run(self):
        self.print_constraints()

        #        model = ebf.read(os.path.join(DATADIR,'mesa.ebf'))
        fn = os.path.join(DATADIR, 'mesa.h5')
        file = h5py.File(fn, 'r+', driver='core', backing_store=False)
        model = {'age':np.array(file['age']),\
        'mass':np.array(file['mass']),\
        'feh':np.array(file['feh']),\
        'teff':np.array(file['teff']),\
        'logg':np.array(file['logg']),\
        'rad':np.array(file['rad']),\
        'lum':np.array(file['rad']),\
        'rho':np.array(file['rho']),\
        'dage':np.array(file['dage']),\
        'dmass':np.array(file['dmass']),\
        'dfeh':np.array(file['dfeh']),\
        'eep':np.array(file['eep']),\
        'bmag':np.array(file['bmag']),\
        'vmag':np.array(file['vmag']),\
        'btmag':np.array(file['btmag']),\
        'vtmag':np.array(file['vtmag']),\
        'gmag':np.array(file['gmag']),\
        'rmag':np.array(file['rmag']),\
        'imag':np.array(file['imag']),\
        'zmag':np.array(file['zmag']),\
        'jmag':np.array(file['jmag']),\
        'hmag':np.array(file['hmag']),\
        'kmag':np.array(file['kmag']),\
        'd51mag':np.array(file['d51mag']),\
        'gamag':np.array(file['gamag']),\
        'fdnu':np.array(file['fdnu']),\
        'avs':np.zeros(len(np.array(file['gamag']))),\
        'dis':np.zeros(len(np.array(file['gamag'])))}

        #ebf.read(os.path.join(DATADIR,'mesa.ebf'))
        # prelims to manipulate some model variables (to be automated soon ...)
        #pdb.set_trace()
        model['rho'] = np.log10(model['rho'])
        model['lum'] = model['rad']**2 * (model['teff'] / 5777.)**4
        # next line turns off Dnu scaling relation corrections
        model['fdnu'][:] = 1.
        model['avs'] = np.zeros(len(model['teff']))
        model['dis'] = np.zeros(len(model['teff']))

        if self.dust == 'allsky':
            dustmodel = query_dustmodel_coords_allsky(self.const['ra'],
                                                      self.const['dec'])
            ext = extinction('cardelli')
        if self.dust == 'green18':
            dustmodel = query_dustmodel_coords(self.const['ra'],
                                               self.const['dec'])
            ext = extinction('schlafly16')
        if self.dust == 'none':
            dustmodel = 0
            ext = extinction('cardelli')

        # Instantiate model
        x = classify_grid.obsdata()
        self.addcoords(x)
        self.addspec(x)
        self.addlum(x)
        self.addjhk(x)
        self.addgriz(x)
        self.addgaia(x)
        self.addbv(x)
        self.addbvt(x)
        self.addseismo(x)
        self.addplx(x)
        self.paras = classify_grid.classify(input=x,
                                            model=model,
                                            dustmodel=dustmodel,
                                            ext=ext,
                                            plot=self.plot,
                                            useav=0)