예제 #1
0
    def __init__(self,
                 surveyName,
                 fieldName,
                 prange=False,
                 cosmo=FLARE.default_cosmo(),
                 SPS=False,
                 verbose=False,
                 make_plots=False):

        self.SimType = 'idealised'
        self.surveyName = surveyName
        self.fieldName = fieldName
        self.prange = prange
        self.cosmo = cosmo

        self.verbose = verbose
        self.make_plots = make_plots

        self.Field = FLARE.surveys.surveys[self.surveyName].fields[
            self.fieldName]
        self.Filters = self.Field.filters
        self.Backgrounds = FLARE.obs.FieldBackgrounds(
            self.Field, verbose=self.verbose)  # --- create Background object

        self.SPS = SPS  # necessary for SED generating if not \beta model
예제 #2
0
    def __init__(self,
                 Filters,
                 prange,
                 cosmo=FLARE.default_cosmo(),
                 SPS=False,
                 verbose=False,
                 SimType='const'):

        self.SimType = SimType

        self.Filters = Filters

        self.prange = prange
        self.cosmo = cosmo

        self.verbose = verbose

        self.SPS = SPS  # necessary for SED generating if not \beta model
예제 #3
0
    def __init__(self,
                 DepthModel,
                 ReferenceFilter,
                 Filters,
                 prange,
                 cosmo=FLARE.default_cosmo(),
                 SPS=False,
                 verbose=False):

        self.DepthModel = DepthModel
        self.depths = FLARE.surveys.depthmodel[self.DepthModel]

        self.ReferenceFilter = ReferenceFilter

        self.Filters = Filters

        self.prange = prange
        self.cosmo = cosmo

        self.verbose = verbose

        self.SPS = SPS  # necessary for SED generating if not \beta model
예제 #4
0
    def __init__(self,
                 surveyName,
                 fieldName,
                 DetectionFilters,
                 prange=False,
                 cosmo=FLARE.default_cosmo(),
                 CutoutWidth=101,
                 threshold=2.5,
                 npixels=5,
                 SPS=False,
                 verbose=False,
                 make_plots=False):

        self.SimType = 'idealised'
        self.surveyName = surveyName
        self.fieldName = fieldName
        self.DetectionFilters = DetectionFilters
        self.prange = prange
        self.cosmo = cosmo
        self.CutoutWidth = CutoutWidth
        self.threshold = threshold
        self.npixels = npixels

        self.verbose = verbose
        self.make_plots = make_plots

        self.Field = FLARE.surveys.surveys[self.surveyName].fields[
            self.fieldName]
        self.Filters = self.Field.filters
        self.Backgrounds = FLARE.obs.FieldBackgrounds(
            self.Field, verbose=self.verbose)  # --- create Background object

        # --- define PSF
        TargetPSF = PSF.PSF(self.Filters[-1])
        self.PSFs = {f: TargetPSF
                     for f in self.Filters
                     }  # force all to use the PSF of the last filter

        self.SPS = SPS  # necessary for SED generating if not \beta model
예제 #5
0
    def __init__(self,
                 surveyName,
                 fieldName,
                 detection_criteria,
                 prange=False,
                 cosmo=FLARE.default_cosmo(),
                 SPS=False,
                 verbose=False,
                 make_plots=False):

        self.SimType = 'simple'
        self.surveyName = surveyName
        self.fieldName = fieldName
        self.prange = prange
        self.cosmo = cosmo

        self.verbose = verbose
        self.make_plots = make_plots

        self.Field = FLARE.surveys.surveys[self.surveyName].fields[
            self.fieldName]
        self.Filters = self.Field.filters

        self.SPS = SPS  # necessary for SED generating if not \beta model

        self.depth = {
            f: FLARE.photom.m_to_flux(self.Field.depths[f])
            for f in self.Filters
        }

        self.detection_filter = detection_criteria[0]
        self.detection_snr = detection_criteria[1]
        self.detection_stretch = detection_criteria[2]

        if verbose:
            for f in self.Filters:
                print(f'{f} {self.depth[f]:.2f}')
예제 #6
0
model.create_Lnu_grid(F) # --- create new L grid for each filter

Lnu = models.generate_Lnu(model, test.Masses, test.Ages, test.Metallicities, test.MetSurfaceDensities, F) # --- calculate rest-frame L uminosity

for f in F['filters']:
    print(f, Lnu[f])


# --- create observed frame fluxes

z = 8.

F = FLARE.filters.add_filters(FLARE.filters.NIRCam_W, new_lam = model.lam * (1. + z)) 

cosmo = FLARE.default_cosmo()

model.create_Fnu_grid(F, z, cosmo) # --- create new Fnu grid for each filter

Fnu = models.generate_Fnu(model, test.Masses, test.Ages, test.Metallicities, test.MetSurfaceDensities, F) # --- calculate rest-frame L uminosity

for f in F['filters']:
    print(f, Fnu[f]) 







예제 #7
0

import numpy as np
import matplotlib.pyplot as plt 
from matplotlib import cm 

import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

import FLARE
import FLARE.LF
from FLARE.LF import evo, lf_parameters, LF_plots, completeness
from FLARE.photom import m_to_flux

cosmo = FLARE.default_cosmo() # WMAP9

f_limit_deep = FLARE.photom.m_to_flux(26.)

area = 60.*60.*40.

print('area of Euclid deep: {0} arcmin2'.format(area))

# load in lf parameters
m = getattr(lf_parameters, 'FLARES')()


evo_model = evo.linear(m) # initialises the linear evolution model with the FLARES parameters

bin_edges, bin_centres, N = evo_model.N(cosmo = cosmo, redshift_limits = [8., 15.], log10L_limits = [27., 30.], dz = 0.1, dlog10L = 0.01)
c = completeness.completeness_erf(bin_centres, f_limit_deep) # calculates the completeness with a flux limit
# model_definitions = {'SPS': 'BPASSv2.2.1.binary', 'IMF': 'ModSalpeter_300', 'SFZH': 'constant_constant', 'dust': False, 'cosmo': FLARE.default_cosmo()}
# redshift = z

# ID = 'XDF_fixedz'
# filters = FLARE.filters.XDF
# model_definitions = {'SPS': 'BPASSv2.2.1.binary', 'IMF': 'ModSalpeter_300', 'SFZH': 'constant_constant', 'dust': 'very_simple', 'cosmo': FLARE.default_cosmo()}
# redshift = z

ID = 'XDF'
filters = FLARE.filters.XDF
model_definitions = {
    'SPS': 'BPASSv2.2.1.binary',
    'IMF': 'ModSalpeter_300',
    'SFZH': 'constant_constant',
    'dust': 'very_simple',
    'cosmo': FLARE.default_cosmo()
}
redshift = False

# --- generate fake data

parameters = {
    'log10_duration': 8.,
    'log10Z': -2.,
    'log10M*': 8.,
    'log10fesc': -1.,
    'log10tau_V': -1.0,
    'z': z
}

# --- full SED