示例#1
0
文件: conftest.py 项目: ybh0822/pyRSD
def driver(request):

    from pyRSD.rsd import GalaxySpectrum

    # add the PYRSD_DATA env var
    os.environ['PYRSD_DATA'] = data_dir

    # inititalize the model
    config                   = {}
    config['z']              = 0.55
    config['cosmo_filename'] = 'runPB.ini'
    config['kmin']           = 1e-3
    config['kmax']           = 0.6
    config['interpolate']    = True
    m = GalaxySpectrum(**config)

    # load the model
    with cache_manager(m, "runPB_galaxy.npy") as model:
        pass

    # initialize the driver
    path = os.path.join(data_dir, 'examples', 'params.dat')
    driver = FittingDriver(path, init_model=False)
    driver.model = model

    # set fiducial
    driver.set_fiducial()

    return driver
示例#2
0
def driver(request):

    from pyRSD.rsd import QuasarSpectrum

    # add the PYRSD_DATA env var
    os.environ['PYRSD_DATA'] = data_dir

    # inititalize the model
    config = {}
    config['z'] = 0.55
    config['cosmo_filename'] = 'runPB.ini'
    config['kmin'] = 1e-3
    config['kmax'] = 0.6
    m = QuasarSpectrum(**config)

    # initialize the driver
    path = os.path.join(data_dir, 'examples', 'params_qso.dat')
    driver = FittingDriver(path, init_model=False)
    driver.model = m

    # set fiducial
    driver.set_fiducial()

    return driver