From ec0bf66d3c1c918461902182bc27a092c24edd52 Mon Sep 17 00:00:00 2001 From: John Franklin Crenshaw <41785729+jfcrenshaw@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:46:40 -0700 Subject: [PATCH] Added PSF sizes for Euclid and Roman. (#20) * Added PSF sizes for Euclid and Roman. --- .github/workflows/main.yml | 2 +- photerr/euclid.py | 3 +++ photerr/model.py | 8 ++++++-- photerr/roman.py | 10 ++++++++++ pyproject.toml | 2 +- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cef693c..7325099 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,7 +101,7 @@ jobs: # (requires CODECOV_TOKEN in repository secrets) #---------------------------------------------- - name: Upload coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # Only required for private repositories file: ./coverage.xml diff --git a/photerr/euclid.py b/photerr/euclid.py index 2aafcc4..8725afb 100644 --- a/photerr/euclid.py +++ b/photerr/euclid.py @@ -17,6 +17,7 @@ class EuclidErrorParams(ErrorParams): __doc__ += param_docstring __doc__ += " Graham 2020 - https://arxiv.org/abs/2004.07885" + __doc__ += "\n Scaramella 2021 - https://arxiv.org/abs/2108.01201" nYrObs: float = 1.0 nVisYr: dict[str, float] | float = 1.0 @@ -29,6 +30,8 @@ class EuclidErrorParams(ErrorParams): "H": 23.9, } ) + theta: dict[str, float] | float = 0.18 + airmass: float = 0 class EuclidErrorModel(ErrorModel): diff --git a/photerr/model.py b/photerr/model.py index e0180e2..b6b917f 100644 --- a/photerr/model.py +++ b/photerr/model.py @@ -123,7 +123,9 @@ def _get_area_ratio_auto( # get the psf size for each band psf_size = np.array([self.params.theta[band] for band in bands]) airmass = np.array([self.params.airmass[band] for band in bands]) - psf_size *= airmass**0.6 + for i in range(len(airmass)): + if airmass[i] > 0: + psf_size[i] *= airmass[i] ** 0.6 # convert PSF FWHM to Gaussian sigma psf_sig = psf_size / 2.355 @@ -164,7 +166,9 @@ def _get_area_ratio_gaap( # get the psf size for each band psf_size = np.array([self.params.theta[band] for band in bands]) airmass = np.array([self.params.airmass[band] for band in bands]) - psf_size *= airmass**0.6 + for i in range(len(airmass)): + if airmass[i] > 0: + psf_size[i] *= airmass[i] ** 0.6 # convert PSF FWHM to Gaussian sigma psf_sig = psf_size / 2.355 diff --git a/photerr/roman.py b/photerr/roman.py index c41baa2..ee0b0a0 100644 --- a/photerr/roman.py +++ b/photerr/roman.py @@ -17,6 +17,7 @@ class RomanErrorParams(ErrorParams): __doc__ += param_docstring __doc__ += " Graham 2020 - https://arxiv.org/abs/2004.07885" + __doc__ += "\n Rubin 2021 - https://arxiv.org/abs/2102.05069" nYrObs: float = 1.0 nVisYr: dict[str, float] | float = 1.0 @@ -30,6 +31,15 @@ class RomanErrorParams(ErrorParams): "F": 26.25, } ) + theta: dict[str, float] | float = field( + default_factory=lambda: { + "Y": 0.130, + "J": 0.136, + "H": 0.150, + "F": 0.166, + } + ) + airmass: float = 0 class RomanErrorModel(ErrorModel): diff --git a/pyproject.toml b/pyproject.toml index 50df1b1..38a542e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "photerr" -version = "1.2.4" +version = "1.3.0" description = "Photometric error model for astronomical imaging surveys" authors = ["John Franklin Crenshaw "] readme = "README.md"