-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates for v1.2 * Oops. Didn't add lsstV1/V2. * No longer forcing random_state. * Linting tests. * Linting
- Loading branch information
1 parent
523c41e
commit 8e15499
Showing
12 changed files
with
519 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
"""Photometric error model for LSST using defaults from Ivezic 2019.""" | ||
|
||
from dataclasses import dataclass, field | ||
from typing import Any | ||
|
||
from photerr.model import ErrorModel | ||
from photerr.params import ErrorParams, param_docstring | ||
|
||
|
||
@dataclass | ||
class LsstErrorParamsV1(ErrorParams): | ||
"""Parameters for the LSST photometric error model. | ||
Default values taken from pages 11, 12, 26 of Ivezic 2019. | ||
""" | ||
|
||
__doc__ += param_docstring | ||
|
||
nYrObs: float = 10.0 | ||
nVisYr: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 5.6, | ||
"g": 8.0, | ||
"r": 18.4, | ||
"i": 18.4, | ||
"z": 16.0, | ||
"y": 16.0, | ||
} | ||
) | ||
gamma: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.038, | ||
"g": 0.039, | ||
"r": 0.039, | ||
"i": 0.039, | ||
"z": 0.039, | ||
"y": 0.039, | ||
} | ||
) | ||
|
||
m5: dict[str, float] | float = field(default_factory=lambda: {}) | ||
|
||
tvis: dict[str, float] | float = 30 | ||
airmass: dict[str, float] | float = 1.2 | ||
Cm: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 23.09, | ||
"g": 24.42, | ||
"r": 24.44, | ||
"i": 24.32, | ||
"z": 24.16, | ||
"y": 23.73, | ||
} | ||
) | ||
dCmInf: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.62, | ||
"g": 0.18, | ||
"r": 0.10, | ||
"i": 0.07, | ||
"z": 0.05, | ||
"y": 0.04, | ||
} | ||
) | ||
msky: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 22.99, | ||
"g": 22.26, | ||
"r": 21.20, | ||
"i": 20.48, | ||
"z": 19.60, | ||
"y": 18.61, | ||
} | ||
) | ||
mskyDark: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 22.99, | ||
"g": 22.26, | ||
"r": 21.20, | ||
"i": 20.48, | ||
"z": 19.60, | ||
"y": 18.61, | ||
} | ||
) | ||
theta: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.92, | ||
"g": 0.87, | ||
"r": 0.83, | ||
"i": 0.80, | ||
"z": 0.78, | ||
"y": 0.76, | ||
} | ||
) | ||
km: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.491, | ||
"g": 0.213, | ||
"r": 0.126, | ||
"i": 0.096, | ||
"z": 0.069, | ||
"y": 0.170, | ||
} | ||
) | ||
|
||
tvisRef: float | None = 30 | ||
|
||
|
||
class LsstErrorModelV1(ErrorModel): | ||
"""Photometric error model for Euclid.""" | ||
|
||
def __init__(self, **kwargs: Any) -> None: | ||
"""Create an LSST error model. | ||
Keyword arguments override default values in LsstErrorParams. | ||
""" | ||
super().__init__(LsstErrorParamsV1(**kwargs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
"""Photometric error model for LSST as of Feb 28, 2024.""" | ||
|
||
from dataclasses import dataclass, field | ||
from typing import Any | ||
|
||
from photerr.model import ErrorModel | ||
from photerr.params import ErrorParams, param_docstring | ||
|
||
|
||
@dataclass | ||
class LsstErrorParamsV2(ErrorParams): | ||
"""Parameters for the LSST photometric error model. | ||
Default values match v1.9 of the official LSST throughputs, including the | ||
silver coatings on all three mirrors. The values for tvis and nVisYr were | ||
taken from one of the OpSim runs that Lynne Jones said is likely to resemble | ||
the final exposure times and visit distributions. | ||
""" | ||
|
||
__doc__ += param_docstring | ||
|
||
nYrObs: float = 10.0 | ||
nVisYr: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 6.3, | ||
"g": 6.8, | ||
"r": 18.1, | ||
"i": 18.8, | ||
"z": 16.6, | ||
"y": 16.3, | ||
} | ||
) | ||
gamma: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.038, | ||
"g": 0.039, | ||
"r": 0.039, | ||
"i": 0.039, | ||
"z": 0.039, | ||
"y": 0.039, | ||
} | ||
) | ||
|
||
m5: dict[str, float] | float = field(default_factory=lambda: {}) | ||
|
||
tvis: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 38, | ||
"g": 30, | ||
"r": 30, | ||
"i": 30, | ||
"z": 30, | ||
"y": 30, | ||
} | ||
) | ||
airmass: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 1.15, | ||
"g": 1.15, | ||
"r": 1.14, | ||
"i": 1.15, | ||
"z": 1.16, | ||
"y": 1.16, | ||
} | ||
) | ||
Cm: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 22.968, | ||
"g": 24.582, | ||
"r": 24.602, | ||
"i": 24.541, | ||
"z": 24.371, | ||
"y": 23.840, | ||
} | ||
) | ||
dCmInf: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.543, | ||
"g": 0.088, | ||
"r": 0.043, | ||
"i": 0.028, | ||
"z": 0.019, | ||
"y": 0.016, | ||
} | ||
) | ||
msky: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 22.65, | ||
"g": 22.07, | ||
"r": 21.10, | ||
"i": 19.99, | ||
"z": 19.04, | ||
"y": 18.28, | ||
} | ||
) | ||
mskyDark: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 23.052, | ||
"g": 22.254, | ||
"r": 21.198, | ||
"i": 20.463, | ||
"z": 19.606, | ||
"y": 18.602, | ||
} | ||
) | ||
theta: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 1.22, | ||
"g": 1.09, | ||
"r": 1.02, | ||
"i": 0.99, | ||
"z": 1.01, | ||
"y": 0.99, | ||
} | ||
) | ||
km: dict[str, float] | float = field( | ||
default_factory=lambda: { | ||
"u": 0.470, | ||
"g": 0.213, | ||
"r": 0.126, | ||
"i": 0.096, | ||
"z": 0.068, | ||
"y": 0.171, | ||
} | ||
) | ||
|
||
tvisRef: float | None = 30 | ||
|
||
|
||
class LsstErrorModelV2(ErrorModel): | ||
"""Photometric error model for Euclid.""" | ||
|
||
def __init__(self, **kwargs: Any) -> None: | ||
"""Create an LSST error model. | ||
Keyword arguments override default values in LsstErrorParams. | ||
""" | ||
super().__init__(LsstErrorParamsV2(**kwargs)) |
Oops, something went wrong.