Metadata-Version: 2.4
Name: psimager
Version: 0.1
Summary: Fast dirty imaging of measurement sets for power spectrum analyses, with the ducc0 w-gridder and WSClean's options
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Author: Florent Mertens
Author-email: florent.mertens@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: astropy (>=5.0)
Requires-Dist: click (>=8.0)
Requires-Dist: ducc0 (>=0.27)
Requires-Dist: numpy (>=1.22)
Requires-Dist: pytest (>=8.0) ; extra == "dev"
Requires-Dist: pytest-cov (>=5.0) ; extra == "dev"
Requires-Dist: python-casacore (>=3.0)
Requires-Dist: ruff (==0.16.1) ; extra == "dev"
Project-URL: Homepage, https://gitlab.com/flomertens/psimager
Project-URL: Issues, https://gitlab.com/flomertens/psimager/-/issues
Project-URL: Repository, https://gitlab.com/flomertens/psimager
Description-Content-Type: text/markdown

# psimager

Fast dirty imaging of measurement sets for power spectrum analyses: dirty Stokes and PSF images
with the [ducc0](https://gitlab.mpcdf.mpg.de/mtr/ducc) w-gridder, with the options, file names and
FITS keywords of [WSClean](https://wsclean.readthedocs.io), so that pspipe and ps_eor read them as
WSClean images.

The MSs are read once, in large row chunks, and the output channels are gridded in parallel, each
by one ducc0 call. Imaging many channels is then many times faster than with WSClean, which
reorders the data on disk and grids one image at a time.

## Installation

```bash
pip install psimager
```

## Usage

```bash
psimager -name img -size 400 400 -scale 6amin -pol IV -channels-out 363 -weight natural \
    -minuv-l 5 -maxuv-l 100 -data-column CORRECTED_DATA -even-odd -make-psf -no-dirty obs*.MS
```

writes `img-even-0000-I-image.fits`, `img-even-0000-V-image.fits`, `img-even-0000-psf.fits`, ...,
for each output channel, for the even and the odd time steps.

## Options

As WSClean's: `-name`, `-data-column`, `-pol`, `-size`, `-scale`, `-channel-range`,
`-channels-out`, `-interval`, `-intervals-out`, `-even-timesteps`, `-odd-timesteps`, `-minuv-l`,
`-maxuv-l`, `-minuvw-m`, `-maxuvw-m`, `-weight natural|uniform|briggs ROBUST`,
`-visibility-weighting-mode`, `-taper-edge`, `-padding` (of the weighting grid),
`-wgridder-accuracy`, `-j`, `-parallel-gridding`, `-mem`, `-abs-mem`, `-make-psf`, `-no-dirty`.
See `psimager --help`.

Differences with WSClean:

- `-even-odd` images the even and the odd time steps in one pass, as `NAME-even-*` and
  `NAME-odd-*`.
- `-parallel-gridding` defaults to `-j`: one thread per output channel, which is the fastest.
- No deconvolution and no `-MFS-` images.
- WSClean's gridding options (`-oversampling`, `-kernel-size`, `-nwlayers`, `-grid-mode`,
  `-reorder`, `-temp-dir`, ...) are accepted and ignored, with a warning, so that a WSClean command
  line runs unchanged.
- Only single-field, single-SPW MSs with linear correlations.

Images are in Jy/PSF (the PSF peaks at 1), one file per output channel and Stokes parameter, with
WSClean's `WSCNVIS`, `WSCENVIS`, `WSCVWSUM`, `WSCIMGWG` and `WSCNORMF` computed from the Stokes I
weights, and `BMAJ`, `BMIN`, `BPA` fitted to the PSF.

