Esempio n. 1
0
def make_grid():
    from copy import deepcopy
    simpar = deepcopy(simParams)
    simpar['FileName'] = 'boss_grid_sim'
    simpar['GridParams']['GridType'] = 'FluxRedshiftGrid'
    del simpar['GridParams']['QLFmodel']
    del simpar['GridParams']['QLFargs']
    simpar['GridParams']['mRange'] += (30, )
    simpar['GridParams']['zRange'] += (20, )
    simpar['GridParams']['nPerBin'] = 100
    simpar['ForestParams']['NumLinesOfSight'] = 1000
    simpar['ForestParams']['FileName'] = 'boss_grid_forest'
    qsoSimulation(simpar, verbose=5)
Esempio n. 2
0
def make_grid():
    from copy import deepcopy
    simpar = deepcopy(simParams)
    simpar['FileName'] = 'boss_grid_sim'
    simpar['GridParams']['GridType'] = 'FluxRedshiftGrid'
    del simpar['GridParams']['QLFmodel']
    del simpar['GridParams']['QLFargs']
    simpar['GridParams']['mRange'] += (30,)
    simpar['GridParams']['zRange'] += (20,)
    simpar['GridParams']['nPerBin'] = 100
    simpar['ForestParams']['NumLinesOfSight'] = 1000
    simpar['ForestParams']['FileName'] = 'boss_grid_forest'
    qsoSimulation(simpar,verbose=5)
Esempio n. 3
0
from simqso import qsoSimulation
from QLFz4.simulations.sdsssims import simpars

# (1) Train Classifier
#         Input)  Training Data Set
#         Output) .pkl of sklearn classifier
#                 list of feature columns used by classifier
# This step is currently manual

# (2) Simulate quasars and their classifiers using simqso
#         Input)  Simulation paramter file: (SED model, flux/redshift distribution)
#         Output) set of quasars (M, z, ugriz)

# !python sdsssims.py
qsoSimulation(simpars, noPhotoMap=True, saveSpectra=True, writeFeatures=True)

# (3) Add variability params to simulated quasars
#         Input) Output from simqso + Training set + list of feature columns used by classifier
#         Ouput) Set of simulated quasars (M, z, ugriz, variability)

# 4) Run simulated quasars though classifier
#         Input) Set of simulated quasars (M, z, ugriz, variability)
#         Ouput) completeness grid: fraction(M, z)

# 5) Run candidates through classifier
#         Input) candidates
#         Output) N(M, z)

# 6) "QuasarSurvey"
#         Input) N(M, z), fraction(M, z), m2M/M2m, area
Esempio n. 4
0

# (1) Train Classifier
#         Input)  Training Data Set
#         Output) .pkl of sklearn classifier
#                 list of feature columns used by classifier
# This step is currently manual


# (2) Simulate quasars and their classifiers using simqso
#         Input)  Simulation paramter file: (SED model, flux/redshift distribution)
#         Output) set of quasars (M, z, ugriz)


# !python sdsssims.py
qsoSimulation(simpars, noPhotoMap=True, saveSpectra=True, writeFeatures=True)


# (3) Add variability params to simulated quasars
#         Input) Output from simqso + Training set + list of feature columns used by classifier
#         Ouput) Set of simulated quasars (M, z, ugriz, variability)


# 4) Run simulated quasars though classifier
#         Input) Set of simulated quasars (M, z, ugriz, variability)
#         Ouput) completeness grid: fraction(M, z)


# 5) Run candidates through classifier
#         Input) candidates
#         Output) N(M, z)
Esempio n. 5
0
	p['QuasarModelParams'] = copy(quasarmodel)
	p['PhotoMapParams'] = cfhtls_photo
	# this is a bit of a hack, but because each survey shares a random seed,
	# as long as the shape of the luminosity and flux grids are the same,
	# the random sampling of the redshifts should be identical, and thus
	# the forest model can be shared and only generated once for each survey
	p['RandomSeed'] = uint32(hash(survey))
	pprint.pprint(p)
	return p

if __name__=='__main__':
	#survey,gridtype = sys.argv[1:3]
	#try:
	#	extraargs = sys.argv[3:]
	#except:
	#	extraargs = ()
	survey = 'CFHTLS_Wide'
	gridtype = 'flux'
	quasarmodel = fiducial_linetweak_model
	forestscale = None
	p = get_params(survey,gridtype,quasarmodel)#,forestscale,extraargs)
	if survey=='test':
		simdir = './'
	qsoSimulation(p,
#	              noPhotoMap=True,
#	              saveSpectra=True,
	              writeFeatures=True,
#	              forestOnly=True,
	              outputDir=simdir)

Esempio n. 6
0
    'IronEmissionParams': {
        'FeScalings': [(0, 1540, 0.5), (1540, 1680, 2.0), (1680, 1868, 1.6),
                       (1868, 2140, 1.0), (2140, 3500, 1.0)],
    },
    'DustExtinctionParams': {
        'DustExtinctionModel': 'Exponential E(B-V) Distribution',
        'DustModelName': 'SMC',
        'E(B-V)': 0.033,
        #'DustLOSfraction':1.0,
    },
}


def make_grid():
    from copy import deepcopy
    simpar = deepcopy(simParams)
    simpar['FileName'] = 'boss_grid_sim'
    simpar['GridParams']['GridType'] = 'FluxRedshiftGrid'
    del simpar['GridParams']['QLFmodel']
    del simpar['GridParams']['QLFargs']
    simpar['GridParams']['mRange'] += (30, )
    simpar['GridParams']['zRange'] += (20, )
    simpar['GridParams']['nPerBin'] = 100
    simpar['ForestParams']['NumLinesOfSight'] = 1000
    simpar['ForestParams']['FileName'] = 'boss_grid_forest'
    qsoSimulation(simpar, verbose=5)


if __name__ == '__main__':
    qsoSimulation(simParams)
Esempio n. 7
0
    p['PhotoMapParams'] = cfhtls_photo
    # this is a bit of a hack, but because each survey shares a random seed,
    # as long as the shape of the luminosity and flux grids are the same,
    # the random sampling of the redshifts should be identical, and thus
    # the forest model can be shared and only generated once for each survey
    p['RandomSeed'] = uint32(hash(survey))
    pprint.pprint(p)
    return p


if __name__ == '__main__':
    #survey,gridtype = sys.argv[1:3]
    #try:
    #	extraargs = sys.argv[3:]
    #except:
    #	extraargs = ()
    survey = 'CFHTLS_Wide'
    gridtype = 'flux'
    quasarmodel = fiducial_linetweak_model
    forestscale = None
    p = get_params(survey, gridtype, quasarmodel)  #,forestscale,extraargs)
    if survey == 'test':
        simdir = './'
    qsoSimulation(
        p,
        #	              noPhotoMap=True,
        #	              saveSpectra=True,
        writeFeatures=True,
        #	              forestOnly=True,
        outputDir=simdir)
Esempio n. 8
0
#    'FileName':name+'_forest',
    'ForestModel':'Worseck&Prochaska2011',
    'ForestType':'Sightlines', # 'Grid' 'OneToOne'
    'zRange':(0.0,4.5),
    'NumLinesOfSight':2000,
    'Rmin':30000.,
  },
  'PhotoMapParams':{
    'PhotoSystems':[
      ('SDSS','Legacy'),
      ('UKIRT','UKIDSS_LAS'),
    ]
  },
}

if __name__=='__main__':
	import sys
	survey,gridType = sys.argv[1:]
	simpars['FileName'] = survey+'_'+gridType
	simpars['GridParams'] = grids[survey+'_'+gridType]
	if gridType == 'LF':
		simpars['ForestParams']['FileName'] = survey+'_LF_forest'
	else:
		simpars['ForestParams']['FileName'] = survey+'_grid_forest'
		# makes the lum and flux grids use the same forest
		simpars['RandomSeed'] = uint32(hash(survey))
	simpars['QuasarModelParams'] = fiducial_linetweak_model
	qsoSimulation(simpars,writeFeatures=True)#,forestOnly=True)


Esempio n. 9
0
  'IronEmissionParams':{
    'FeScalings':[(0,1540,0.5),(1540,1680,2.0),(1680,1868,1.6),
                  (1868,2140,1.0),(2140,3500,1.0)],
  },
  'DustExtinctionParams':{
    'DustExtinctionModel':'Exponential E(B-V) Distribution',
    'DustModelName':'SMC',
    'E(B-V)':0.033,
    #'DustLOSfraction':1.0,
  },
}

def make_grid():
    from copy import deepcopy
    simpar = deepcopy(simParams)
    simpar['FileName'] = 'boss_grid_sim'
    simpar['GridParams']['GridType'] = 'FluxRedshiftGrid'
    del simpar['GridParams']['QLFmodel']
    del simpar['GridParams']['QLFargs']
    simpar['GridParams']['mRange'] += (30,)
    simpar['GridParams']['zRange'] += (20,)
    simpar['GridParams']['nPerBin'] = 100
    simpar['ForestParams']['NumLinesOfSight'] = 1000
    simpar['ForestParams']['FileName'] = 'boss_grid_forest'
    qsoSimulation(simpar,verbose=5)

if __name__=='__main__':
    qsoSimulation(simParams)