Metadata-Version: 2.1
Name: b4r
Version: 2024.7.0
Summary: Reduction and analysis tools for LMT/B4R
License: MIT
Author: Akio Taniguchi
Author-email: taniguchi@a.phys.nagoya-u.ac.jp
Requires-Python: >=3.9,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: astropy (>=6.0,<7.0)
Requires-Dist: matplotlib (>=3.8,<4.0)
Requires-Dist: netcdf4 (>=1.6,<2.0)
Requires-Dist: numpy (>=1.26,<2.0)
Requires-Dist: python-casacore (>=3.5,<4.0)
Requires-Dist: scikit-learn (>=1.4,<2.0)
Requires-Dist: scipy (>=1.13,<2.0)
Requires-Dist: tqdm (>=4.66,<5.0)
Description-Content-Type: text/markdown

# b4r

[![Release](https://img.shields.io/pypi/v/b4r?label=Release&color=cornflowerblue&style=flat-square)](https://pypi.org/project/b4r/)
[![Python](https://img.shields.io/pypi/pyversions/b4r?label=Python&color=cornflowerblue&style=flat-square)](https://pypi.org/project/b4r/)
[![Downloads](https://img.shields.io/pypi/dm/b4r?label=Downloads&color=cornflowerblue&style=flat-square)](https://pepy.tech/project/b4r)
[![Tests](https://img.shields.io/github/actions/workflow/status/b4r-dev/b4r/tests.yaml?label=Tests&style=flat-square)](https://github.com/b4r-dev/b4r/actions)

Reduction and analysis tools for LMT/B4R

## Installation

```shell
pip install b4r==2024.7.0
```

## Usage

### Reduce individual data

```python
import b4r.pipe as Bp


Bp.globBaseDir = '/home/hoge/b4r'
Bp.globLogDir = '/home/hoge/b4r/logv1'
Bp.PipelineAnalysis(86420)
```

This example shows a pipeline analysis for the data obsid `86420`.

### Reduce all data (for database)

```python
import b4r.pipe as Bp

Bp.globBaseDir = '/home/hoge/b4r'
Bp.globLogDir = '/home/hoge/b4r/logv1'
Bp.PipelineAnalysisBatchRun()
```

You need to specify following pathes.

#### b4r.pipe.globBaseDir

- The path where `xffts` and `lmttpm` directories are located.
- XFFTS binary data (e.g., `xffts20181003111006.xfftsx.01`) should be stored under the `xffts` directory.
- LMT antenna log data (e.g., `lmttpm_2018-04-22_075858_01_0000.nc`) should be stored under the `lmttpm` directory.

#### b4r.pipe.globLogDir

- The path where outputs are created.
- Anywhere you like is OK.

## Products

The script create following outputs (if possible).

- Continuum Map Qlook (Pointing offset, efficiency (only for uranus), etc.)
- Line (SiO) Map Qlook (Pointing offset, etc.)
- Spectrum Qlook (with auto-flag)
- Time series spectrum of PSW data (NumPy readable format)
- GoDec calibration results (see Taniguchi et al. 2021)
- MS2 (CASA readable format)

## Correspondence

B4R 2018/2019 (obsnum<=087433) data <-> CASA MS2:

| Name | B4R | CASA MS2 |
| --- | --- | --- |
| polarization | A | (correlation or stokes) YY |
| polarization | B | (correlation or stokes) XX |
| sideband | LSB | spw 0 |
| sideband | USB | spw 1 |

## Information

- B4R webpage: http://lmtgtm.org/b4r/?lang=en

