uvotredux 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uvotredux-0.1.0/.github/dependabot.yml +11 -0
- uvotredux-0.1.0/.github/workflows/automerge.yml +30 -0
- uvotredux-0.1.0/.github/workflows/black.yml +23 -0
- uvotredux-0.1.0/.github/workflows/continuous_integration.yml +65 -0
- uvotredux-0.1.0/.github/workflows/isort.yml +21 -0
- uvotredux-0.1.0/.github/workflows/pylint.yml +24 -0
- uvotredux-0.1.0/.gitignore +162 -0
- uvotredux-0.1.0/.pre-commit-config.yaml +33 -0
- uvotredux-0.1.0/LICENSE +21 -0
- uvotredux-0.1.0/PKG-INFO +32 -0
- uvotredux-0.1.0/README.md +1 -0
- uvotredux-0.1.0/pyproject.toml +59 -0
- uvotredux-0.1.0/setup.cfg +4 -0
- uvotredux-0.1.0/uvotredux/__init__.py +5 -0
- uvotredux-0.1.0/uvotredux/reduce.py +128 -0
- uvotredux-0.1.0/uvotredux/run.py +33 -0
- uvotredux-0.1.0/uvotredux.egg-info/PKG-INFO +32 -0
- uvotredux-0.1.0/uvotredux.egg-info/SOURCES.txt +20 -0
- uvotredux-0.1.0/uvotredux.egg-info/dependency_links.txt +1 -0
- uvotredux-0.1.0/uvotredux.egg-info/entry_points.txt +2 -0
- uvotredux-0.1.0/uvotredux.egg-info/requires.txt +7 -0
- uvotredux-0.1.0/uvotredux.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "pip" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Dependabot auto-merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
merge_group:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
pull-requests: write
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
automerge:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
15
|
+
steps:
|
|
16
|
+
- name: Dependabot metadata
|
|
17
|
+
id: metadata
|
|
18
|
+
uses: dependabot/fetch-metadata@v1.1.1
|
|
19
|
+
with:
|
|
20
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
21
|
+
|
|
22
|
+
- name: Echo auto-merge
|
|
23
|
+
run: echo "Update type is ${{steps.metadata.outputs.update-type}}, check is ${{contains(steps.metadata.outputs.update-type,'version-update:semver')}}"
|
|
24
|
+
|
|
25
|
+
- name: Enable auto-merge for Dependabot PRs
|
|
26
|
+
if: ${{contains(steps.metadata.outputs.update-type,'version-update:semver')}}
|
|
27
|
+
run: gh pr merge --auto --squash "$PR_URL"
|
|
28
|
+
env:
|
|
29
|
+
PR_URL: ${{github.event.pull_request.html_url}}
|
|
30
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Black
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
black:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v3
|
|
11
|
+
- name: Set up Python 3.12
|
|
12
|
+
uses: actions/setup-python@v4
|
|
13
|
+
with:
|
|
14
|
+
python-version: 3.12
|
|
15
|
+
cache: 'pip'
|
|
16
|
+
cache-dependency-path: pyproject.toml
|
|
17
|
+
- name: Install dependencies
|
|
18
|
+
run: |
|
|
19
|
+
pip install --upgrade pip
|
|
20
|
+
pip install --editable ".[dev]"
|
|
21
|
+
- name: Reformat the code with black
|
|
22
|
+
run: |
|
|
23
|
+
black . --check
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# This is a basic workflow to help you get started with Actions
|
|
2
|
+
|
|
3
|
+
name: CI
|
|
4
|
+
|
|
5
|
+
# Controls when the action will run.
|
|
6
|
+
on:
|
|
7
|
+
# Triggers the workflow on push or pull request events
|
|
8
|
+
push:
|
|
9
|
+
|
|
10
|
+
pull_request:
|
|
11
|
+
|
|
12
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
16
|
+
jobs:
|
|
17
|
+
# This workflow contains a single job called "build"
|
|
18
|
+
build:
|
|
19
|
+
# The type of runner that the job will run on
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
# Specify the python versions to test
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.12"]
|
|
26
|
+
|
|
27
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v3
|
|
30
|
+
|
|
31
|
+
# Set up the python versions
|
|
32
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
33
|
+
uses: actions/setup-python@v4
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ matrix.python-version }}
|
|
36
|
+
cache: 'pip'
|
|
37
|
+
cache-dependency-path: pyproject.toml
|
|
38
|
+
|
|
39
|
+
- name: install packages
|
|
40
|
+
run: |
|
|
41
|
+
pip install --editable ".[dev]"
|
|
42
|
+
|
|
43
|
+
- name: Echo tag name
|
|
44
|
+
run: echo "Tag is ${{ github.ref }}, Tagged is ${{ startsWith(github.ref, 'refs/tags/')}}, Python Check is ${{matrix.python-version == 3.12}}, Deploy is ${{ startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.12}}"
|
|
45
|
+
|
|
46
|
+
- name: Install pypa/build
|
|
47
|
+
run: >-
|
|
48
|
+
python -m
|
|
49
|
+
pip install
|
|
50
|
+
build
|
|
51
|
+
--user
|
|
52
|
+
- name: Build a binary wheel and a source tarball
|
|
53
|
+
run: >-
|
|
54
|
+
python -m
|
|
55
|
+
build
|
|
56
|
+
--sdist
|
|
57
|
+
--wheel
|
|
58
|
+
--outdir dist/
|
|
59
|
+
.
|
|
60
|
+
|
|
61
|
+
- name: Publish distribution 📦 to PyPI
|
|
62
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') && success() && matrix.python-version == 3.12 && github.event_name == 'push'}}
|
|
63
|
+
uses: pypa/gh-action-pypi-publish@master
|
|
64
|
+
with:
|
|
65
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Run isort
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
isort:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
|
+
- name: Set up Python 3.12
|
|
11
|
+
uses: actions/setup-python@v4
|
|
12
|
+
with:
|
|
13
|
+
python-version: 3.12
|
|
14
|
+
cache: 'pip'
|
|
15
|
+
cache-dependency-path: pyproject.toml
|
|
16
|
+
- name: Install dependencies
|
|
17
|
+
run: |
|
|
18
|
+
pip install --upgrade pip
|
|
19
|
+
pip install --editable ".[dev]"
|
|
20
|
+
- name: isort
|
|
21
|
+
uses: isort/isort-action@v1.0.0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Pylint
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
pylint:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v3
|
|
12
|
+
- name: Set up Python 3.12
|
|
13
|
+
uses: actions/setup-python@v4
|
|
14
|
+
with:
|
|
15
|
+
python-version: 3.12
|
|
16
|
+
cache: 'pip'
|
|
17
|
+
cache-dependency-path: pyproject.toml
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: |
|
|
20
|
+
pip install --upgrade pip
|
|
21
|
+
pip install --editable ".[dev]"
|
|
22
|
+
- name: Analysing the code with pylint
|
|
23
|
+
run: |
|
|
24
|
+
pylint uvotredux --fail-under=10.00
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
*.idea
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# poetry
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
104
|
+
#poetry.lock
|
|
105
|
+
|
|
106
|
+
# pdm
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
108
|
+
#pdm.lock
|
|
109
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
110
|
+
# in version control.
|
|
111
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
112
|
+
.pdm.toml
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# mkdocs documentation
|
|
141
|
+
/site
|
|
142
|
+
|
|
143
|
+
# mypy
|
|
144
|
+
.mypy_cache/
|
|
145
|
+
.dmypy.json
|
|
146
|
+
dmypy.json
|
|
147
|
+
|
|
148
|
+
# Pyre type checker
|
|
149
|
+
.pyre/
|
|
150
|
+
|
|
151
|
+
# pytype static type analyzer
|
|
152
|
+
.pytype/
|
|
153
|
+
|
|
154
|
+
# Cython debug symbols
|
|
155
|
+
cython_debug/
|
|
156
|
+
|
|
157
|
+
# PyCharm
|
|
158
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
159
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
161
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
162
|
+
#.idea/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v2.3.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-yaml
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- repo: local
|
|
8
|
+
hooks:
|
|
9
|
+
- id: black
|
|
10
|
+
name: black
|
|
11
|
+
entry: black
|
|
12
|
+
language: system
|
|
13
|
+
types: [ python ]
|
|
14
|
+
- repo: local
|
|
15
|
+
hooks:
|
|
16
|
+
- id: isort
|
|
17
|
+
name: isort (python)
|
|
18
|
+
entry: isort
|
|
19
|
+
language: system
|
|
20
|
+
types: [ python ]
|
|
21
|
+
- repo: local
|
|
22
|
+
hooks:
|
|
23
|
+
- id: pylint
|
|
24
|
+
name: pylint
|
|
25
|
+
entry: pylint
|
|
26
|
+
language: system
|
|
27
|
+
types: [python]
|
|
28
|
+
args:
|
|
29
|
+
[
|
|
30
|
+
"-rn", # Only display messages
|
|
31
|
+
"-sn", # Don't display the score
|
|
32
|
+
]
|
|
33
|
+
verbose: true
|
uvotredux-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Robert David Stein
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
uvotredux-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: uvotredux
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI to reduce Swift UVOT data
|
|
5
|
+
Author-email: Robert Stein <rdstein@caltech.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/robertdstein/uvotredux
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
19
|
+
Classifier: Operating System :: POSIX
|
|
20
|
+
Classifier: Operating System :: Unix
|
|
21
|
+
Classifier: Operating System :: MacOS
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: pathlib
|
|
26
|
+
Requires-Dist: pre-commit
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: black==24.2.0; extra == "dev"
|
|
29
|
+
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pylint==3.1.0; extra == "dev"
|
|
31
|
+
|
|
32
|
+
# uvotredux
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# uvotredux
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "setuptools-scm"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "uvotredux"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "CLI to reduce Swift UVOT data"
|
|
9
|
+
authors = [
|
|
10
|
+
{name = "Robert Stein", email = "rdstein@caltech.edu"}
|
|
11
|
+
]
|
|
12
|
+
license = {text = "MIT"}
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
'Programming Language :: Python :: 3.10',
|
|
18
|
+
'Programming Language :: Python :: 3.11',
|
|
19
|
+
'Programming Language :: Python :: 3.12',
|
|
20
|
+
'Intended Audience :: Science/Research',
|
|
21
|
+
'Intended Audience :: End Users/Desktop',
|
|
22
|
+
'Intended Audience :: Developers',
|
|
23
|
+
'Natural Language :: English',
|
|
24
|
+
'Topic :: Scientific/Engineering',
|
|
25
|
+
'Topic :: Scientific/Engineering :: Astronomy',
|
|
26
|
+
'Topic :: Scientific/Engineering :: Physics',
|
|
27
|
+
'Operating System :: POSIX',
|
|
28
|
+
'Operating System :: Unix',
|
|
29
|
+
'Operating System :: MacOS',
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"pathlib",
|
|
33
|
+
"pre-commit"
|
|
34
|
+
]
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"black == 24.2.0",
|
|
38
|
+
"isort == 5.13.2",
|
|
39
|
+
"pylint == 3.1.0",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.urls]
|
|
43
|
+
Homepage = "https://github.com/robertdstein/uvotredux"
|
|
44
|
+
|
|
45
|
+
[project.scripts]
|
|
46
|
+
uvotredux = "uvotredux.run:main"
|
|
47
|
+
|
|
48
|
+
[tool.setuptools]
|
|
49
|
+
packages = ["uvotredux"]
|
|
50
|
+
|
|
51
|
+
[tool.isort]
|
|
52
|
+
profile = "black"
|
|
53
|
+
|
|
54
|
+
[tool.pylint.format]
|
|
55
|
+
max-line-length = "88"
|
|
56
|
+
disable=["logging-fstring-interpolation"]
|
|
57
|
+
good-names=["ax", "ra", "df", "pi", "i"]
|
|
58
|
+
exclude-too-few-public-methods=["pydantic.*"]
|
|
59
|
+
extension-pkg-whitelist=["pydantic"]
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Created by Brad Cenko
|
|
3
|
+
|
|
4
|
+
Updated by Robert Stein on 2024-03-08 to use python3, pathlib, f-strings and gzip
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import gzip
|
|
8
|
+
import logging
|
|
9
|
+
import subprocess
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
filter_dict = {
|
|
15
|
+
"vv": "V",
|
|
16
|
+
"bb": "B",
|
|
17
|
+
"uu": "U",
|
|
18
|
+
"w1": "UW1",
|
|
19
|
+
"m2": "UM2",
|
|
20
|
+
"w2": "UW2",
|
|
21
|
+
"wh": "W",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def unpack_swift_obs(
|
|
26
|
+
swift_obs_dir: Path,
|
|
27
|
+
src_region_path: Path,
|
|
28
|
+
bkg_region_path: Path,
|
|
29
|
+
):
|
|
30
|
+
"""
|
|
31
|
+
Function to unpack the swift observation and create the uvot images
|
|
32
|
+
|
|
33
|
+
:param swift_obs_dir: Single swift observation directory
|
|
34
|
+
:param src_region_path: Path to the source region file
|
|
35
|
+
:param bkg_region_path: Path to the background region file
|
|
36
|
+
:return: None
|
|
37
|
+
"""
|
|
38
|
+
uvot_dir = swift_obs_dir / "uvot/image"
|
|
39
|
+
|
|
40
|
+
swift_images = [x for x in uvot_dir.glob("*_sk.img") if x.is_file()]
|
|
41
|
+
swift_compressed_images = [x for x in uvot_dir.glob("*_sk.img.gz") if x.is_file()]
|
|
42
|
+
|
|
43
|
+
for image in swift_compressed_images:
|
|
44
|
+
uncompressed_image = image.with_suffix("")
|
|
45
|
+
if not uncompressed_image.is_file():
|
|
46
|
+
logger.info(f"Uncompressing image: {image}")
|
|
47
|
+
with gzip.open(image, "rb") as f_in:
|
|
48
|
+
with open(uncompressed_image, "wb") as f_out:
|
|
49
|
+
f_out.write(f_in.read())
|
|
50
|
+
swift_images.append(uncompressed_image)
|
|
51
|
+
|
|
52
|
+
for image in swift_images:
|
|
53
|
+
uvot_filter = filter_dict[image.name[14:16]]
|
|
54
|
+
uvot_save_path = uvot_dir / f"{uvot_filter}.fits"
|
|
55
|
+
cmd = f"uvotimsum {image} {uvot_save_path}"
|
|
56
|
+
if uvot_save_path.is_file():
|
|
57
|
+
logger.info(f"UVOT image already exists: {uvot_save_path}")
|
|
58
|
+
else:
|
|
59
|
+
subprocess.run(cmd, shell=True, check=True)
|
|
60
|
+
logger.info(f"UVOT image created at: {uvot_save_path}")
|
|
61
|
+
|
|
62
|
+
if not uvot_save_path.is_file():
|
|
63
|
+
logger.error(f"UVOT image not created: {uvot_save_path}")
|
|
64
|
+
logger.error(f"Command: {cmd}")
|
|
65
|
+
raise FileNotFoundError(f"UVOT image not created: {uvot_save_path}")
|
|
66
|
+
|
|
67
|
+
output_path = uvot_dir / f"{uvot_filter}.out"
|
|
68
|
+
|
|
69
|
+
cmd = (
|
|
70
|
+
f"uvotsource image={uvot_save_path} srcreg={src_region_path} "
|
|
71
|
+
f"bkgreg={bkg_region_path} sigma=3.0 outfile={output_path} "
|
|
72
|
+
f"syserr=yes output=ALL apercorr=CURVEOFGROWTH "
|
|
73
|
+
f"> {output_path.with_suffix('.log')}"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
if output_path.is_file():
|
|
77
|
+
logger.info(f"UVOT source data already exists: {output_path}")
|
|
78
|
+
else:
|
|
79
|
+
subprocess.run(cmd, shell=True, check=True)
|
|
80
|
+
logger.info(f"UVOT source data created at: {output_path}")
|
|
81
|
+
|
|
82
|
+
if not output_path.is_file():
|
|
83
|
+
logger.error(f"UVOT source data not created: {output_path}")
|
|
84
|
+
logger.error(f"Command: {cmd}")
|
|
85
|
+
raise FileNotFoundError(f"UVOT source data not created: {output_path}")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def unpack_swift_directory(
|
|
89
|
+
directory: Path | None = None,
|
|
90
|
+
src_region_path: Path | None = None,
|
|
91
|
+
bkg_region_path: Path | None = None,
|
|
92
|
+
):
|
|
93
|
+
"""
|
|
94
|
+
Function to unpack all the swift observations in a directory
|
|
95
|
+
|
|
96
|
+
:param directory: Directory containing the swift observations
|
|
97
|
+
:param src_region_path: Path to the source region file
|
|
98
|
+
:param bkg_region_path: Path to the background region file
|
|
99
|
+
:return: None
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
if directory is None:
|
|
103
|
+
directory = Path.cwd()
|
|
104
|
+
|
|
105
|
+
all_swift_obs = [
|
|
106
|
+
x for x in directory.glob("*") if (x.is_dir()) & (len(x.name) == 11)
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
if src_region_path is None:
|
|
110
|
+
src_region_path = directory / "src.reg"
|
|
111
|
+
logger.info(f"Source region path not provided, using {src_region_path}")
|
|
112
|
+
|
|
113
|
+
if not src_region_path.is_file():
|
|
114
|
+
raise FileNotFoundError(f"Region file {src_region_path} not found")
|
|
115
|
+
|
|
116
|
+
if bkg_region_path is None:
|
|
117
|
+
bkg_region_path = directory / "bkg.reg"
|
|
118
|
+
logger.info(f"Background region path not provided, using {bkg_region_path}")
|
|
119
|
+
|
|
120
|
+
if not bkg_region_path.is_file():
|
|
121
|
+
raise FileNotFoundError(f"Region file {bkg_region_path} not found")
|
|
122
|
+
|
|
123
|
+
for swift_obs in sorted(all_swift_obs):
|
|
124
|
+
unpack_swift_obs(
|
|
125
|
+
swift_obs,
|
|
126
|
+
src_region_path=src_region_path,
|
|
127
|
+
bkg_region_path=bkg_region_path,
|
|
128
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Wrapper script to run the swift reduction on a directory using command line arguments
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import logging
|
|
7
|
+
|
|
8
|
+
from uvotredux.reduce import unpack_swift_directory
|
|
9
|
+
|
|
10
|
+
logging.basicConfig(level=logging.INFO)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main():
|
|
14
|
+
"""
|
|
15
|
+
Function to run the swift reduction on a directory
|
|
16
|
+
|
|
17
|
+
:return: None
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
parser = argparse.ArgumentParser(description="Unpack a Swift UVOT observation")
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"-d", "--swift_obs_dir", help="Path to the base Swift observation directory"
|
|
23
|
+
)
|
|
24
|
+
parser.add_argument(
|
|
25
|
+
"-s", "--src_region_path", help="Path to the source region file"
|
|
26
|
+
)
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
"-b", "--bkg_region_path", help="Path to the background region file"
|
|
29
|
+
)
|
|
30
|
+
args = parser.parse_args()
|
|
31
|
+
unpack_swift_directory(
|
|
32
|
+
args.swift_obs_dir, args.src_region_path, args.bkg_region_path
|
|
33
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: uvotredux
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI to reduce Swift UVOT data
|
|
5
|
+
Author-email: Robert Stein <rdstein@caltech.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/robertdstein/uvotredux
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
19
|
+
Classifier: Operating System :: POSIX
|
|
20
|
+
Classifier: Operating System :: Unix
|
|
21
|
+
Classifier: Operating System :: MacOS
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: pathlib
|
|
26
|
+
Requires-Dist: pre-commit
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: black==24.2.0; extra == "dev"
|
|
29
|
+
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pylint==3.1.0; extra == "dev"
|
|
31
|
+
|
|
32
|
+
# uvotredux
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.pre-commit-config.yaml
|
|
3
|
+
LICENSE
|
|
4
|
+
README.md
|
|
5
|
+
pyproject.toml
|
|
6
|
+
.github/dependabot.yml
|
|
7
|
+
.github/workflows/automerge.yml
|
|
8
|
+
.github/workflows/black.yml
|
|
9
|
+
.github/workflows/continuous_integration.yml
|
|
10
|
+
.github/workflows/isort.yml
|
|
11
|
+
.github/workflows/pylint.yml
|
|
12
|
+
uvotredux/__init__.py
|
|
13
|
+
uvotredux/reduce.py
|
|
14
|
+
uvotredux/run.py
|
|
15
|
+
uvotredux.egg-info/PKG-INFO
|
|
16
|
+
uvotredux.egg-info/SOURCES.txt
|
|
17
|
+
uvotredux.egg-info/dependency_links.txt
|
|
18
|
+
uvotredux.egg-info/entry_points.txt
|
|
19
|
+
uvotredux.egg-info/requires.txt
|
|
20
|
+
uvotredux.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
uvotredux
|