Metadata-Version: 2.4
Name: vis-downloader
Version: 1.1.1
Project-URL: Documentation, https://github.com/Alec Thomson (S&A, Kensington WA)/vis-downloader#readme
Project-URL: Issues, https://github.com/Alec Thomson (S&A, Kensington WA)/vis-downloader/issues
Project-URL: Source, https://github.com/Alec Thomson (S&A, Kensington WA)/vis-downloader
Author-email: "Alec Thomson (S&A, Kensington WA)" <alec.thomson@csiro.au>
License-Expression: MIT
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Requires-Dist: aiohttp
Requires-Dist: astropy
Requires-Dist: astroquery>=0.4.8.dev0
Requires-Dist: requests
Requires-Dist: tqdm
Provides-Extra: dev
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# Vis Downloader

<!-- [![PyPI - Version](https://img.shields.io/pypi/v/vis-downloader.svg)](https://pypi.org/project/vis-downloader)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vis-downloader.svg)](https://pypi.org/project/vis-downloader)

----- -->
Download visibilties from CASDA.

## Installation

Use `pip`:

```sh
# From PyPI
pip install vis-downloader
# - OR -
# Latest git version
pip install git+https://github.com/AlecThomson/vis-downloader
```

## Usage

To make sure you don't DDoS CASDA, please make use of the `--max-workers` option.

```bash
usage: vis_download [-h] [--beam BEAM] [--output-dir OUTPUT_DIR] [--username USERNAME] [--store-password] [--reenter-password]
                    [--max-workers MAX_WORKERS] [--extract-tar] [--download-holography] [--log-only] [--disable-progress] [--quiet]
                    [--max-retries MAX_RETRIES]
                    sbids [sbids ...]

Download visibilities from CASDA for a given SBID

positional arguments:
  sbids                 SBID to download

options:
  -h, --help            show this help message and exit
  --beam BEAM           Beam to download. Defaults to all.
  --output-dir OUTPUT_DIR
                        Output directory. If unset a directory for each SBID will be created.
  --username USERNAME   CASDA username
  --store-password      Store password in keyring
  --reenter-password    Reenter password
  --max-workers MAX_WORKERS
                        Number of workers
  --extract-tar         If a file is a tarball attempt to extract it. This removes the original tar file if successful.
  --download-holography
                        Download the evaluation files that contain the holography data
  --log-only
  --disable-progress    Disable the progress bars produced by `tqdm`.
  --quiet               Silence logged output and progress bar updates
  --max-retries MAX_RETRIES
                        The maximum number of retries allowed for each file when downloading.
```

To cache your CASDA credentials run:

```bash
casda_login -h
# usage: casda_login [-h] username
#
# Login to CASDA and save credentials
#
# positional arguments:
#   username    Username for CASDA
#
# options:
#   -h, --help  show this help message and exit
```

Note that you will also want to set the `CASDA_USERNAME` environment variable for non-interactive use.

## License

`vis-downloader` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
