Skip to content

Commit 2461f22

Browse files
authored
#14 Merge pull request from b4r-dev/astropenguin/issue11
Rename project
2 parents 079793a + 935f0e9 commit 2461f22

File tree

20 files changed

+469
-1188
lines changed

20 files changed

+469
-1188
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "b4rpipe",
3-
"image": "python:3.10",
2+
"name": "b4r",
3+
"image": "python:3.11",
44
"runArgs": [
5-
"--name=b4rpipe",
5+
"--name=b4r",
66
"--platform=linux/amd64"
77
],
88
"containerEnv": {
99
"POETRY_VIRTUALENVS_CREATE": "false"
1010
},
11-
"onCreateCommand": "pip install poetry",
12-
"postCreateCommand": "poetry install==1.8.2",
11+
"onCreateCommand": "pip install poetry==1.8.3",
12+
"postCreateCommand": "poetry install",
1313
"customizations": {
1414
"vscode": {
1515
"extensions": [

.github/workflows/pypi.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
job:
10+
name: PyPI
11+
runs-on: ubuntu-latest
12+
env:
13+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
- uses: abatilo/actions-poetry@v3
20+
with:
21+
poetry-version: "1.8.3"
22+
- run: poetry publish --build

.github/workflows/tests.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
job:
13+
name: Test (Python ${{ matrix.python }})
14+
runs-on: ubuntu-latest
15+
env:
16+
POETRY_VIRTUALENVS_CREATE: false
17+
PYTHON_DIRS: b4r
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python: ["3.9", "3.10", "3.11"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: true
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python }}
29+
- uses: abatilo/actions-poetry@v3
30+
with:
31+
poetry-version: "1.8.3"
32+
- run: poetry install
33+
- run: black --check ${PYTHON_DIRS}

CITATION.cff

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
4+
title: "b4r"
5+
abstract: "Reduction and analysis tools for LMT/B4R"
6+
version: 2024.7.0
7+
date-released: 2024-07-09
8+
license: "MIT"
9+
url: "https://github.com/b4r-dev/b4r"
10+
authors:
11+
- given-names: "Akio"
12+
family-names: "Taniguchi"
13+
affiliation: "Nagoya University"
14+
orcid: "https://orcid.org/0000-0002-9695-6183"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Akio Taniguchi
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.

README.md

Lines changed: 49 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,70 @@
1-
# b4rpipe
1+
# b4r
22

3-
[![](https://img.shields.io/pypi/v/b4rpipe.svg?label=PyPI&style=flat-square)](https://pypi.org/pypi/b4rpipe/)
4-
[![](https://img.shields.io/pypi/pyversions/b4rpipe.svg?label=Python&color=yellow&style=flat-square)](https://pypi.org/pypi/b4rpipe/)
5-
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&style=flat-square)](LICENSE)
3+
[![Release](https://img.shields.io/pypi/v/b4r?label=Release&color=cornflowerblue&style=flat-square)](https://pypi.org/project/b4r/)
4+
[![Python](https://img.shields.io/pypi/pyversions/b4r?label=Python&color=cornflowerblue&style=flat-square)](https://pypi.org/project/b4r/)
5+
[![Downloads](https://img.shields.io/pypi/dm/b4r?label=Downloads&color=cornflowerblue&style=flat-square)](https://pepy.tech/project/b4r)
6+
[![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)
67

7-
Pipeline reduction tools for B4R/LMT data.
8+
Reduction and analysis tools for LMT/B4R
89

9-
**************************************************************
10-
Installation
11-
**************************************************************
10+
## Installation
1211

13-
```terminal
14-
$ pip install b4rpipe
12+
```shell
13+
pip install b4r==2024.7.0
1514
```
1615

17-
**************************************************************
18-
Usage
19-
**************************************************************
16+
## Usage
2017

2118
### Reduce individual data
2219

23-
```terminal
24-
$ python
25-
$ >>> import b4rpipe as Bp
26-
$ >>> Bp.globBaseDir = '/home/hoge/b4r'
27-
$ >>> Bp.globLogDir = '/home/hoge/b4r/logv1'
28-
$ >>> Bp.PipelineAnalysis(86420)
20+
```python
21+
import b4r.pipe as Bp
22+
23+
24+
Bp.globBaseDir = '/home/hoge/b4r'
25+
Bp.globLogDir = '/home/hoge/b4r/logv1'
26+
Bp.PipelineAnalysis(86420)
2927
```
3028

31-
This example shows a pipeline analysis for the data obsid 86420.
29+
This example shows a pipeline analysis for the data obsid `86420`.
3230

3331
### Reduce all data (for database)
3432

35-
```terminal
36-
$ python
37-
$ >>> import b4rpipe as Bp
38-
$ >>> Bp.globBaseDir = '/home/hoge/b4r'
39-
$ >>> Bp.globLogDir = '/home/hoge/b4r/logv1'
40-
$ >>> Bp.PipelineAnalysisBatchRun()
33+
```python
34+
import b4r.pipe as Bp
35+
36+
Bp.globBaseDir = '/home/hoge/b4r'
37+
Bp.globLogDir = '/home/hoge/b4r/logv1'
38+
Bp.PipelineAnalysisBatchRun()
4139
```
4240

4341
You need to specify following pathes.
44-
#### b4pipe.globBaseDir
45-
* The path where "xffts" and "lmttpm" directorys are located.
46-
* XFFTS binary data (e.g., xffts20181003111006.xfftsx.01) should be stored under the "xffts" directory.
47-
* LMT antenna log data (e.g., lmttpm_2018-04-22_075858_01_0000.nc) should be stored under the "lmttpm" directory.
48-
49-
#### b4rpipe.globLogDir
50-
* The path where outputs are created.
51-
* Anywhere you like is OK.
52-
53-
**************************************************************
54-
Products
55-
**************************************************************
56-
The script create following outputs (if possible).
5742

58-
* Continuum Map Qlook (Pointing offset, efficiency (only for uranus), etc.)
59-
* Line (SiO) Map Qlook (Pointing offset, etc.)
60-
* Spectrum Qlook (with auto-flag)
61-
* Time series spectrum of PSW data (numpy readable format)
62-
* GoDec calibration results (see Taniguch et al. 2021)
63-
* MS2 (CASA readable format)
64-
65-
**************************************************************
66-
Data query and download (only for internal use now)
67-
**************************************************************
68-
If you are in the NAOJ or IoA (U. Tokyo) local network, you can access the B4R ftp server.
69-
70-
```terminal
71-
$ python
72-
$ >>> import b4rpipe as Bp
73-
$ >>> Bp.PipelineAnalysis(86420,DataDownload=True,username='hogehoge',password='*****')
74-
```
43+
#### b4r.pipe.globBaseDir
7544

76-
Then "rawdata" and "calibrated" directory appears at the current directory.
45+
- The path where `xffts` and `lmttpm` directories are located.
46+
- XFFTS binary data (e.g., `xffts20181003111006.xfftsx.01`) should be stored under the `xffts` directory.
47+
- LMT antenna log data (e.g., `lmttpm_2018-04-22_075858_01_0000.nc`) should be stored under the `lmttpm` directory.
7748

78-
```terminal
79-
$ ls
80-
raw calibrated
81-
$ ls rawdata
82-
lmttpm xffts
83-
$ls calibrated
84-
86420
85-
```
49+
#### b4r.pipe.globLogDir
50+
51+
- The path where outputs are created.
52+
- Anywhere you like is OK.
8653

87-
**************************************************************
88-
Correspondence
89-
**************************************************************
90-
+ B4R 2018/2019 (obsnum<=087433) data <-> CASA MS2
54+
## Products
55+
56+
The script create following outputs (if possible).
57+
58+
- Continuum Map Qlook (Pointing offset, efficiency (only for uranus), etc.)
59+
- Line (SiO) Map Qlook (Pointing offset, etc.)
60+
- Spectrum Qlook (with auto-flag)
61+
- Time series spectrum of PSW data (NumPy readable format)
62+
- GoDec calibration results (see Taniguchi et al. 2021)
63+
- MS2 (CASA readable format)
64+
65+
## Correspondence
66+
67+
B4R 2018/2019 (obsnum<=087433) data <-> CASA MS2:
9168

9269
| Name | B4R | CASA MS2 |
9370
| --- | --- | --- |
@@ -96,9 +73,6 @@ Correspondence
9673
| sideband | LSB | spw 0 |
9774
| sideband | USB | spw 1 |
9875

99-
**************************************************************
100-
Information
101-
**************************************************************
102-
* B4R webpage: http://lmtgtm.org/b4r/?lang=en
103-
* Contact: Yuki Yoshimura
104-
(email: astro.yoshimura(_at_)gmail.com)
76+
## Information
77+
78+
- B4R webpage: http://lmtgtm.org/b4r/?lang=en

b4r/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__all__ = ["pipe"]
2+
__version__ = "2024.7.0"
3+
4+
5+
# subpackages
6+
from . import pipe
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
iers.conf.auto_max_age = None
3636

3737
# submodules
38-
import b4rpipe.makedatalist as md
39-
import b4rpipe.specfile4 as sp
40-
import b4rpipe.CreateMs2 as ms2
38+
import b4r.pipe.makedatalist as md
39+
import b4r.pipe.specfile4 as sp
40+
import b4r.pipe.CreateMs2 as ms2
4141

4242
globBaseDir = "./rawdata"
4343
globLogDir = "./calibrated"

b4r/pipe/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from b4r.pipe.main import *

0 commit comments

Comments
 (0)