Skip to main content

uvotredux

PyPI version

uvotredux is a simple python wrapper around HEASoft, which can iteratively reduce Swift UVOT data. The actual data reduction is done by HEASoft, while the downloading is done with swifttools. All credit should go to the Swift team for developing these tools.

I strongly recommend using uvotredux in a Docker container.

Installing and using a stable uvotredux release with Docker

You can pull the latest version of uvotredux from Docker Hub:

docker pull robertdstein/uvotredux:latest

You need a working docker installation for this. This image contains the latest version of uvotredux, and heasoft.

Then you can run the container with:

docker run -it --rm -v ~/path/to/local/data:/mydata robertdstein/uvotredux:latest ARGS

where /path/to/local/data is the path to the directory where you want to download the data, and ARGS are the arguments you want to pass to uvotredux.

Creating a convenient alias for uvotredux

You can create a convenient alias in your shell configuration file (e.g., .bashrc or .zshrc) to simplify the command:

alias uvotredux='docker run --rm -v /path/to/local/data:/mydata robertdstein/uvotredux:latest'

Then, to download and reduce data for a target at RA 133.457 and Dec 25.119, you can run:

uvotredux by-ra-dec 133.457 25.119

or to download and reduce data for a target with a specific name, you can run:

uvotredux by-name AT2025mav

Installing and using a stable uvotredux release using pip with local HEASoft

If you already have heasoft installed locally, you can also install uvotredux via pip:

pip install uvotredux

This will install the latest stable release of uvotredux from PyPI.

Then you can set the data directory where you want to download/reduce the data:

export UVOTREDUX_DATA_DIR="/path/to/local/data"

and then run uvotredux with the desired arguments, e.g.:

uvotredux by-ra-dec 133.457 25.119

Installing and using uvotredux in an editable state with Docker

If you want to edit the code, you will still need a working docker installation of heasoft:

docker pull robertdstein/uvotredux:latest

Then, you can clone the repository somewhere on your machine:

git clone https://github.com/robertdstein/uvotredux.git

Then, start the docker container with:

docker run --rm -it --entrypoint bash -v /path/to/local/data:/mydata -v /path/to/local/uvotredux:/uvotredux robertdstein/uvotredux:latest

This will mount your local data directory to /mydata in the container, and your local uvotredux directory to /uvotredux in the container.

Then inside the docker container, you can install uvotredux in editable mode:

export PATH="/home/heasoft/.local/bin:$PATH"
pip install -e /uvotredux

And finally, within the docker container, you can run uvotredux commands as usual:

uvotredux by-ra-dec 133.457 25.119

Using uvotredux

Uvotredux will download the data for you, if it is not already present in the specified data directory.

It will then iteratively reduce each image in the subfolders of the data directory.

Make sure you have a fast internet connection, because the uvot pipeline can attempt to download calibration fits files that are >150Mb and downloads will time out eventually!

The code will scrape the output files of each individual image, and produce a combined csv file with all the available info (uvot_results.csv). Beware: this file contains over a hundred columns per image.

There is also a smaller file (uvot_summary.csv) that contains only the most important columns.

Checking the Results

Imagine you reduced data for a target with the name AT2025mav.

You will see a directory created in your local data directory: /path/to/local/data/AT2025mav .

In the directory there will be a subdirectory for each visit, as well as a uvot_results.csv and uvot_summary.csv file. There are also two region files (src.reg and bkg.reg) that were used extract the source and background regions.

uvotredux generates these automatically. However, it is possible that an unrelated source is present in the background region. You can check this by opening up one of the uncompressed images in ds9, e.g /path/to/local/data/AT2025mav/00019808001/uvot/image/UW2.fits. You can then overlay the regions from the src.reg and bkg.reg files to see if they are centered correctly.

Metadata

Release files for uvotredux 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uvotredux 0.3.2
File Size Uploaded
uvotredux-0.3.2.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uvotredux 0.3.2
File Interpreter ABI Platform
uvotredux-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.4 kB

Release files / uvotredux-0.3.2.tar.gz

Download URL uvotredux-0.3.2.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ae53692f42e30a33d8da6b1360785332c995106efa3786df2dedbe6cae7d9472
BLAKE2b-256 checksum
How to use checksums
2d656cf663ac5a209cb54c6d1f235fa0729783beee2bae0f5f79a04542d182ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / uvotredux-0.3.2-py3-none-any.whl

Download URL uvotredux-0.3.2-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9d6f8b0b2c17015c1767447ec98c07001eb5a08796f2576519baef097781645
BLAKE2b-256 checksum
How to use checksums
ed6b5fbf028e1fe3897174af661710785a1d678d454f5d7f43812fa8c21f2d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.3.3

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page