-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into frb20210912A
- Loading branch information
Showing
342 changed files
with
21,564 additions
and
2,295 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: CI Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
pull_request: | ||
|
||
env: | ||
SETUP_XVFB: True # avoid issues if mpl tries to open a GUI window | ||
|
||
jobs: | ||
ci-tests: | ||
name: Python-${{ matrix.python }}, deps=${{ matrix.deps }} | ||
runs-on: ${{ matrix.os }} | ||
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))" | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: ['3.11', '3.12'] | ||
deps: [current, numpy211, astropydev, numpydev, astropydev-numpydev] | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install base dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Test with numpy = 2.1.1 | ||
if: "contains(matrix.deps, 'numpy211')" | ||
run: | | ||
python -m pip install numpy==2.1.1 | ||
- name: Test with dev version of numpy | ||
if: "contains(matrix.deps, 'numpydev')" | ||
run: | | ||
python -m pip install git+https://github.com/numpy/numpy.git#egg=numpy | ||
- name: Test with dev version astropy | ||
if: "contains(matrix.deps, 'astropydev')" | ||
run: | | ||
python -m pip install git+https://github.com/astropy/astropy.git#egg=astropy | ||
- name: Install frb requirements | ||
run: | | ||
python -m pip install wheel scipy IPython | ||
python -m pip install git+https://github.com/FRBs/ne2001.git#egg=ne2001 | ||
python -m pip install git+https://github.com/FRBs/astropath.git#egg=astropath | ||
python -m pip install git+https://github.com/linetools/linetools#egg=linetools | ||
python -m pip install -r frb/requirements.txt | ||
- name: Install numba | ||
run: | | ||
python -m pip install numba | ||
- name: Install astroquery | ||
run: | | ||
python -m pip install astroquery | ||
- name: Print Python, pip, astropy, numpy, and setuptools versions | ||
run: | | ||
python -c "import sys; print(f'Python {sys.version}')" | ||
python -c "import pip; print(f'pip {pip.__version__}')" | ||
python -c "import astropy; print(f'astropy {astropy.__version__}')" | ||
python -c "import numpy; print(f'numpy {numpy.__version__}')" | ||
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')" | ||
- name: Run tests | ||
run: tox -e ${{ matrix.python }}-${{ matrix.toxenv }} | ||
|
||
codestyle: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python codestyle check | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install base dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pycodestyle | ||
- name: Check for runtime errors using pycodestyle | ||
run: | | ||
pycodestyle frb --count --select=E9 |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ Galaxy_DB/ | |
*.hdf5 | ||
.DS_Store | ||
*.json | ||
*.npz | ||
|
||
# Tests | ||
./pytest_cache | ||
|
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
***************************** | ||
Magnitudes to flux conversion | ||
***************************** | ||
|
||
Most public photometry tables report brightness of objects | ||
in terms of magnitudes as opposed to flux units (Jy or mJy). | ||
However, using software such as CIGALE and EAZY is made | ||
less ambiguous if fluxes are supplied. To enable this, we provide | ||
the function `frb.surveys.catalog_utils.convert_mags_to_flux` | ||
|
||
The definition for magnitude errors arises from the following | ||
equation: | ||
|
||
.. math:: | ||
m\pm \delta m = ZP-2.5 \log_{10}(f\pm \delta f) | ||
\Rightarrow m = ZP-2.5 \log_{10}(f) | ||
\Rightarrow \delta m = 2.5 \log_{10}(1+\delta f/f) | ||
While the math:`\delta m` formula above is exact, most photometry | ||
software use a first order Taylor expansion in math:`\delta f/f` | ||
assuming the error is typically small. i.e. | ||
|
||
.. math:: | ||
\delta m \approx \frac{2.5}{\log_{10}}(\delta f/f) | ||
This will obviously break down when looking at really faint objects, | ||
barely at the threshold of detection above the noise floor. | ||
`convert_mags_to_flux` explicitly assumes the catalog mag errors are | ||
produced using this approximation. However, if you have reason to believe | ||
the exact formula was used, you can set `exact_mag_err=True` to get the | ||
correct flux error. |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.