Ejemplo n.º 1
0
from picca.delta_extraction.quasar_catalogues.desi_quasar_catalogue import (
    defaults as defaults_quasar_catalogue)
from picca.delta_extraction.utils import ACCEPTED_BLINDING_STRATEGIES
from picca.delta_extraction.utils_pk1d import spectral_resolution_desi, exp_diff_desi
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options,
                                           accepted_options_quasar_catalogue)
accepted_options = update_accepted_options(
    accepted_options,
    ["blinding", "num processors", "use non-coadded spectra", "wave solution"])

defaults = update_default_options(
    defaults, {
        "delta lambda": 0.8,
        "delta log lambda": 3e-4,
        "blinding": "corr_yshift",
        "use non-coadded spectra": False,
        "wave solution": "lin",
    })
defaults = update_default_options(defaults, defaults_quasar_catalogue)


def merge_new_forest(forests_by_targetid, new_forests_by_targetid):
    """Merge new_forests_by_targetid and forests_by_targetid as Forest instances.

    Arguments
    ---------
    forests_by_targetid: dict
    Dictionary were forests are stored. Its content is modified by this
    function with the new forests.
Ejemplo n.º 2
0
from scipy.interpolate import interp1d

from picca.delta_extraction.errors import ExpectedFluxError
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import Dr16ExpectedFlux
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import (
    defaults, accepted_options)
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options, ["eta value"])
accepted_options = update_accepted_options(
    accepted_options,
    ["limit eta", "use constant weight", "use ivar as weight"],
    remove=True)

defaults = update_default_options(defaults, {
    "eta value": 1.0,
})


class Dr16FixedEtaExpectedFlux(Dr16ExpectedFlux):
    """Class to the expected flux similar to Dr16ExpectedFlux but fixing eta

    Methods
    -------
    (see Dr16ExpectedFlux in py/picca/delta_extraction/expected_fluxes/dr16_expected_flux.py)
    __init__
    __initialize_get_eta
    __parse_config

    Attributes
    ----------
Ejemplo n.º 3
0
    LeastsSquaresVarStats, FUDGE_REF)
from picca.delta_extraction.utils import (find_bins, update_accepted_options,
                                          update_default_options)

accepted_options = update_accepted_options(accepted_options, [
    "force stack delta to zero", "limit eta", "limit var lss",
    "min num qso in fit", "num iterations", "order", "use constant weight",
    "use ivar as weight"
])

defaults = update_default_options(
    defaults, {
        "force stack delta to zero": True,
        "limit eta": (0.5, 1.5),
        "limit var lss": (0., 0.3),
        "num iterations": 5,
        "min num qso in fit": 100,
        "order": 1,
        "use constant weight": False,
        "use ivar as weight": False,
    })

FUDGE_FIT_START = FUDGE_REF
ETA_FIT_START = 1.
VAR_LSS_FIT_START = 0.1


class Dr16ExpectedFlux(ExpectedFlux):
    """Class to the expected flux as done in the DR16 SDSS analysys
    The mean expected flux is calculated iteratively as explained in
    du Mas des Bourboux et al. (2020)
Ejemplo n.º 4
0
    Dr16FixedEtaExpectedFlux)
from picca.delta_extraction.expected_fluxes.dr16_fixed_eta_expected_flux import (
    defaults, accepted_options)
from picca.delta_extraction.expected_fluxes.dr16_fixed_varlss_expected_flux import (
    Dr16FixedVarlssExpectedFlux)
from picca.delta_extraction.expected_fluxes.dr16_fixed_varlss_expected_flux import (
    defaults as defaults2, accepted_options as accepted_options2)
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options, accepted_options2)
accepted_options = update_accepted_options(accepted_options, [
    "limit eta", "limit var lss", "use constant weight", "use ivar as weight"
],
                                           remove=True)

defaults = update_default_options(defaults, defaults2)


class Dr16FixedEtaVarlssExpectedFlux(Dr16FixedEtaExpectedFlux,
                                     Dr16FixedVarlssExpectedFlux):
    """Class to the expected flux similar to Dr16ExpectedFlux but fixing both
    eta and var_lss

    Methods
    -------
    (see Dr16FixedEtaExpectedFlux in
     py/picca/delta_extraction/expected_fluxes/dr16_fix_eta_expected_flux.py)
    (see Dr16FixedVarlssExpectedFlux in
     py/picca/delta_extraction/expected_fluxes/dr16_fix_varlss_expected_flux.py)

    Attributes
Ejemplo n.º 5
0
import numpy as np
from scipy.interpolate import interp1d

from picca.delta_extraction.errors import ExpectedFluxError
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import Dr16ExpectedFlux
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import (
    defaults, accepted_options)
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options, ["fudge value"])
accepted_options = update_accepted_options(
    accepted_options, ["use constant weight", "use ivar as weight"],
    remove=True)

defaults = update_default_options(defaults, {
    "fudge value": 0.0,
})


class Dr16FixedFudgeExpectedFlux(Dr16ExpectedFlux):
    """Class to the expected flux similar to Dr16ExpectedFlux but fixing the
    fudge factor

    Methods
    -------
    (see Dr16ExpectedFlux in py/picca/delta_extraction/expected_fluxes/dr16_expected_flux.py)
    __init__
    _initialize_get_fudge
    __parse_config

    Attributes
from scipy.interpolate import interp1d

from picca.delta_extraction.errors import ExpectedFluxError
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import Dr16ExpectedFlux
from picca.delta_extraction.expected_fluxes.dr16_expected_flux import (
    defaults, accepted_options)
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options, ["var lss value"])
accepted_options = update_accepted_options(
    accepted_options,
    ["limit var lss", "use constant weight", "use ivar as weight"],
    remove=True)

defaults = update_default_options(defaults, {
    "var lss value": 0.15,
})


class Dr16FixedVarlssExpectedFlux(Dr16ExpectedFlux):
    """Class to the expected flux similar to Dr16ExpectedFlux but fixing

    Methods
    -------
    (see Dr16ExpectedFlux in py/picca/delta_extraction/expected_fluxes/dr16_expected_flux.py)
    __init__
    __initialize_get_eta
    __parse_config

    Attributes
    ----------
Ejemplo n.º 7
0
from picca.delta_extraction.quasar_catalogues.drq_catalogue import defaults as defaults_drq
from picca.delta_extraction.quasar_catalogues.drq_catalogue import (
    accepted_options as accepted_options_quasar_catalogue)
from picca.delta_extraction.utils_pk1d import exp_diff, spectral_resolution
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options,
                                           accepted_options_quasar_catalogue)
accepted_options = update_accepted_options(accepted_options, ["rebin", "mode"])
accepted_options = update_accepted_options(
    accepted_options,
    ["delta lambda", "delta log lambda", "delta lambda rest frame"],
    remove=True)

defaults = update_default_options(defaults, {
    "mode": "spplate",
    "rebin": 3,
})
defaults = update_default_options(defaults, defaults_drq)


class SdssData(Data):
    """Reads the spectra from SDSS and formats its data as a list of
    Forest instances.

    Methods
    -------
    (see Data in py/picca/delta_extraction/data.py)
    __init__
    __parse_config
    read_from_spec
    read_from_spplate
Ejemplo n.º 8
0
from pkg_resources import resource_filename

from picca.delta_extraction.astronomical_objects.forest import Forest
from picca.delta_extraction.astronomical_objects.pk1d_forest import Pk1dForest
from picca.delta_extraction.errors import ExpectedFluxError
from picca.delta_extraction.expected_flux import ExpectedFlux, defaults, accepted_options
from picca.delta_extraction.utils import (find_bins, update_accepted_options,
                                          update_default_options)

accepted_options = update_accepted_options(accepted_options, [
    "input directory", "raw statistics file", "use constant weight",
    "num bins variance"
])

defaults = update_default_options(defaults, {
    "raw statistics file": "",
    "use constant weight": False,
})

IN_NSIDE = 16


class TrueContinuum(ExpectedFlux):
    """Class to compute the expected flux using the true unabsorbed contiuum
    for mocks.
    It uses var_lss pre-computed from mocks and the mean flux modeled from a
    2nd order polinomial in effective optical depth.

    Methods
    -------
    (see ExpectedFlux in py/picca/delta_extraction/expected_flux.py)
    __init__
    defaults as defaults2, accepted_options as accepted_options2)
from picca.delta_extraction.expected_fluxes.dr16_fixed_varlss_expected_flux import (
    Dr16FixedVarlssExpectedFlux)
from picca.delta_extraction.expected_fluxes.dr16_fixed_varlss_expected_flux import (
    defaults as defaults3, accepted_options as accepted_options3)
from picca.delta_extraction.utils import update_accepted_options, update_default_options

accepted_options = update_accepted_options(accepted_options, accepted_options2)
accepted_options = update_accepted_options(accepted_options, accepted_options3)
accepted_options = update_accepted_options(accepted_options, [
    "limit var lss", "num iterations", "use constant weight",
    "use ivar as weight"
],
                                           remove=True)

defaults = update_default_options(defaults, defaults2)
defaults = update_default_options(defaults, defaults3)
defaults = update_default_options(defaults, {
    "num iterations": 1,
})


class Dr16FixedEtaVarlssFudgeExpectedFlux(Dr16FixedEtaExpectedFlux,
                                          Dr16FixedVarlssExpectedFlux,
                                          Dr16FixedFudgeExpectedFlux):
    """Class to the expected flux similar to Dr16ExpectedFlux but fixing
    eta, var_lss and fudge

    Methods
    -------
    (see Dr16FixedEtaExpectedFlux in