Skip to content

Commit

Permalink
#81 Merge pull request from deshima-dev/astropenguin/issue74
Browse files Browse the repository at this point in the history
Use deshima-rawdata as test datasets
  • Loading branch information
astropenguin authored Nov 16, 2023
2 parents e4d9bea + 088d3ab commit 540726f
Show file tree
Hide file tree
Showing 11 changed files with 388 additions and 45 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ jobs:
with:
python-version: ${{ matrix.python }}
- run: pip install poetry && poetry install
- run: cd tests && ./mktd.sh && python -m unittest -v
- run: demerge -d data/cosmos -m "--debug" 20171103184436
- name: Run unit tests for merge functions
run: |
deshima-rawdata download 20171103184436 -d data -e
cd tests && ./mktd.sh && python -m unittest -v
- name: Run a comprehensive merge test
run: |
deshima-rawdata download 20231108052231 -d data -e
demerge -d data -m "--debug" 20231108052231
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Created by package authors
cache/
data/*
!/data/.gitkeep
graph/
tests/testdata*
*~
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "data"]
path = data
url = https://github.com/deshima-dev/testdata.git
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,22 @@ poetry install

## 解析の実行例

以下のコマンドでOBSID=20171103184436の解析を行います。観測データはdata/cosmosに格納されているものとします
以下のコマンドでOBSID=20171103184436の解析を行います。観測データはdataに格納されているものとします

```shell
demerge -d data/cosmos 20171103184436
demerge -d data 20171103184436
```

以下のコマンドでテスト用のデータをダウンロードすることができます。

```shell
deshima-rawdata download 20171103184436 -d data -e
```

どのデータがダウンロードできるかは、データリストをご確認ください。

```shell
deshima-rawdata list
```

### demergeコマンドの引数
Expand All @@ -69,7 +81,7 @@ demerge -d data/cosmos 20171103184436

引数 | 説明 | デフォルト
--- | --- | ---
`-d` | 観測データディレクトリの指定 | `data/cosmos`
`-d` | 観測データディレクトリの指定 | `data`
`-c` | キャッシュディレクトリを指定 | `cache`
`-g` | グラフディレクトリを指定 | `graph`
`-b` | DDBファイルを指定 | `data/ddb/ddb_20180619.fits.gz`
Expand All @@ -80,25 +92,24 @@ demerge -d data/cosmos 20171103184436

```
data
├── cosmos
│   ├── cosmos_20171103184436
│   │   ├── 20171103184436_info.txt
│   │   ├── 20171103184436.ant
│   │   ├── 20171103184436.cabin
│   │   ├── 20171103184436.fits.gz
│   │   ├── 20171103184436.misti
│   │   ├── 20171103184436.obs
│   │   ├── 20171103184436.roomchop
│   │   ├── 20171103184436.skychop
│   │   ├── 20171103184436.tsky
│   │   ├── 20171103184436.wea
│   │   ├── kids.list
│   │   ├── localsweep_info.txt
│   │   ├── localsweep.sweep
│   │   └── pretune
│   │   ├── kids.list
│   │   ├── localsweep_info.txt
│   │   └── localsweep.sweep
├── cosmos_20171103184436
│   ├── 20171103184436_info.txt
│   ├── 20171103184436.ant
│   ├── 20171103184436.cabin
│   ├── 20171103184436.fits.gz
│   ├── 20171103184436.misti
│   ├── 20171103184436.obs
│   ├── 20171103184436.roomchop
│   ├── 20171103184436.skychop
│   ├── 20171103184436.tsky
│   ├── 20171103184436.wea
│   ├── kids.list
│   ├── localsweep_info.txt
│   ├── localsweep.sweep
│   └── pretune
│   ├── kids.list
│   ├── localsweep_info.txt
│   └── localsweep.sweep
((( 続く )))
```
Expand Down Expand Up @@ -175,7 +186,7 @@ cd /path/to/demerge/test
python test_merge_to_dems.py # merge_to_dems()関数のテストを実行します
```

test_merge_to_dems.pyを実行するにはダミーデータとテストデータが必要になります。ダミーデータはmktd.shスクリプトを実行することで生成されます。テストデータはdata/cosmos/cosmos_20171103184436/の中のものを使います。
test_merge_to_dems.pyを実行するにはダミーデータとテストデータが必要になります。ダミーデータはmktd.shスクリプトを実行することで生成されます。テストデータはdata/cosmos_20171103184436/の中のものを使います。

## merge_to_dems.pyについて

Expand Down
1 change: 0 additions & 1 deletion data
Submodule data deleted from 5675d4
Empty file added data/.gitkeep
Empty file.
Binary file added demerge/ddb_20231029.fits.gz
Binary file not shown.
8 changes: 5 additions & 3 deletions demerge/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# 使用例
# ------
# $ ./run.sh -d data/cosmos 20171103184836
# $ ./run.sh -d data 20171103184836
#
#
# 指定可能なオプション
Expand All @@ -35,6 +35,8 @@
# -p プロット実行オプションの指定
#

DEMERGE="$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd)"
DEFAULT_DDB="${DEMERGE}/ddb_20231029.fits.gz"
NCPU=`python -c "import multiprocessing as m; print(m.cpu_count() - 1);"`

# ==================
Expand Down Expand Up @@ -76,10 +78,10 @@ if [ -z "$GRAPH_DIR" ]; then
GRAPH_DIR="graph" # 作成したグラフを格納する場所の規定値
fi
if [ -z "$DATA_DIR" ]; then
DATA_DIR="data/cosmos" # 観測データの場所の規定値
DATA_DIR="data" # 観測データの場所の規定値
fi
if [ -z "$DDB_FILE" ]; then
DDB_FILE="data/ddb/ddb_20180619.fits.gz" # DDBファイルの規定値
DDB_FILE="${DEFAULT_DDB}" # DDBファイルの既定値
fi
if [ -z "$OUT_DIR" ]; then
OUT_DIR="${CACHE_DIR}" # 出力ディレクトリの規定値
Expand Down
Loading

0 comments on commit 540726f

Please sign in to comment.