demerge


Namedemerge JSON
Version 2025.8.4 PyPI version JSON
download
home_pageNone
SummaryDESHIMA merge code for observed datasets
upload_time2025-08-21 03:39:07
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.9
licenseMIT License Copyright (c) 2021-2025 DESHIMA Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords astronomy data-format deshima measurement-set spectroscopy submillimeter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # de:merge

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

DESHIMA merge code for observed datasets

## Installation

```shell
pip install demerge==2025.8.4
```

## Command line interface

de:merge ships with three commands, `demerge`, `reduce`, and `merge`.
`demerge` is the main command that (1) reduces raw data of KID measurements into a single "reduced" FITS and (2) merge datasets of a DESHIMA observation (including the reduced FITS) into a single DEMS file.
`reduce` and `merge` are the subcommands that perform (1) and (2), respectively, and they should be used only for debugging.

Here is (part of) the `demerge` command help:
```plaintext
SYNOPSIS
    demerge OBSID <flags>

DESCRIPTION
    Run reduce and merge commands to create a single DEMS.

POSITIONAL ARGUMENTS
    OBSID
        Type: str
        Observation ID (YYYYMMDDHHMMSS).

FLAGS
    --data_dir=DATA_DIR
        Type: Path
        Default: PosixPath('.')
        Path of directory where data packages are placed,
        i.e. expecting ``${data_dir}/cosmos_YYYYMMDDHHMMSS``.
    --dems_dir=DEMS_DIR
        Type: Path
        Default: PosixPath('.')
        Path of directory where merged DEMS will be placed,
        i.e. expecting ``${dems_dir}/dems_YYYYMMDDHHMMSS.zarr.zip``.
    --reduced_dir=REDUCED_DIR
        Type: Path
        Default: PosixPath('.')
        Path of directory where reduced packages are placed,
        i.e. expecting ``${reduced_dir}/reduced_YYYYMMDDHHMMSS``.
        If not specified, a temporary directory will be used.
    --cdb=CDB
        Type: Path
        Default: PosixPath('/path/to/demerge/data/cdb_20250528.zarr.zip')
        Path of CDB (KID correspondence database) file.
    --ddb=DDB
        Type: Path
        Default: PosixPath('/path/to/demerge/data/ddb_20250819.fits.gz')
        Path of DDB (DESHIMA database) file.
    --overwrite=OVERWRITE
        Type: bool
        Default: False
        If True, the reduced package and the merged DEMS file
        will be overwritten even if they exist.
    --debug=DEBUG
        Type: bool
        Default: False
        If True, detailed logs for debugging will be printed.
```

A typical command run is as follows:
```shell
demerge YYYYMMDDHHMMSS --data_dir /path/to/data --reduced_dir .cache
```
where the raw data directory, `/path/to/data/cosmos_YYYYMMDDHHMMSS`, will be selected, then an intermediate reduced data directory will be created as `./.cache/reduced_YYYYMMDDHHMMSS`, and finally the merged DEMS file will be placed as `./dems_YYYYMMDDHHMMSS.zarr.zip`.

## Raw data directory

The name and the file structure of a raw data directory must be as follows:

```plaintext
cosmos_YYYYMMDDHHMMSS/
├── YYYYMMDDHHMMSS.ant
├── YYYYMMDDHHMMSS.cabin
├── YYYYMMDDHHMMSS.fits
├── YYYYMMDDHHMMSS.misti
├── YYYYMMDDHHMMSS.obs
├── YYYYMMDDHHMMSS.skychopper.dat.xz
├── YYYYMMDDHHMMSS.wea
├── YYYYMMDDHHMMSS_info.txt
├── kid_corresp.json
├── kids.list
├── localsweep.sweep
├── localsweep_info.txt
└── pretune
    ├── kids.list
    ├── localsweep.sweep
    └── localsweep_info.txt
```

If multiple files with the same extension exist, then the last one sorted by name will be selected.

## Use as a Python package

All (sub)commands are also available as Python functions of the same names in the `demerge` package.
For example, the following two runs are equivalent:

```shell
# run by a shell script
demerge YYYYMMDDHHMMSS --data_dir /path/to/data --reduced_dir .cache
```

```python
# run by a Python script
from demerge import demerge
demerge("YYYYMMDDHHMMSS", data_dir="/path/to/data", reduced_dir=".cache")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "demerge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "astronomy, data-format, deshima, measurement-set, spectroscopy, submillimeter",
    "author": null,
    "author_email": "Akio Taniguchi <taniguchi.akio@gmail.com>, Tatsuya Takekoshi <tatsuya.takekoshi@gmail.com>, Daisuke Naito <naito@naitosystems.com>",
    "download_url": "https://files.pythonhosted.org/packages/a3/d2/022ba526965906f2eebc9cdee8a04222c4ccd56307d68b102deb7635f11e/demerge-2025.8.4.tar.gz",
    "platform": null,
    "description": "# de:merge\n\n[![Release](https://img.shields.io/pypi/v/demerge?label=Release&color=cornflowerblue&style=flat-square)](https://pypi.org/project/demerge/)\n[![Python](https://img.shields.io/pypi/pyversions/demerge?label=Python&color=cornflowerblue&style=flat-square)](https://pypi.org/project/demerge/)\n[![Downloads](https://img.shields.io/pypi/dm/demerge?label=Downloads&color=cornflowerblue&style=flat-square)](https://pepy.tech/project/demerge)\n[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.10015892-cornflowerblue?style=flat-square)](https://doi.org/10.5281/zenodo.10015892)\n[![Tests](https://img.shields.io/github/actions/workflow/status/deshima-dev/demerge/tests.yaml?label=Tests&style=flat-square)](https://github.com/deshima-dev/demerge/actions)\n\nDESHIMA merge code for observed datasets\n\n## Installation\n\n```shell\npip install demerge==2025.8.4\n```\n\n## Command line interface\n\nde:merge ships with three commands, `demerge`, `reduce`, and `merge`.\n`demerge` is the main command that (1) reduces raw data of KID measurements into a single \"reduced\" FITS and (2) merge datasets of a DESHIMA observation (including the reduced FITS) into a single DEMS file.\n`reduce` and `merge` are the subcommands that perform (1) and (2), respectively, and they should be used only for debugging.\n\nHere is (part of) the `demerge` command help:\n```plaintext\nSYNOPSIS\n    demerge OBSID <flags>\n\nDESCRIPTION\n    Run reduce and merge commands to create a single DEMS.\n\nPOSITIONAL ARGUMENTS\n    OBSID\n        Type: str\n        Observation ID (YYYYMMDDHHMMSS).\n\nFLAGS\n    --data_dir=DATA_DIR\n        Type: Path\n        Default: PosixPath('.')\n        Path of directory where data packages are placed,\n        i.e. expecting ``${data_dir}/cosmos_YYYYMMDDHHMMSS``.\n    --dems_dir=DEMS_DIR\n        Type: Path\n        Default: PosixPath('.')\n        Path of directory where merged DEMS will be placed,\n        i.e. expecting ``${dems_dir}/dems_YYYYMMDDHHMMSS.zarr.zip``.\n    --reduced_dir=REDUCED_DIR\n        Type: Path\n        Default: PosixPath('.')\n        Path of directory where reduced packages are placed,\n        i.e. expecting ``${reduced_dir}/reduced_YYYYMMDDHHMMSS``.\n        If not specified, a temporary directory will be used.\n    --cdb=CDB\n        Type: Path\n        Default: PosixPath('/path/to/demerge/data/cdb_20250528.zarr.zip')\n        Path of CDB (KID correspondence database) file.\n    --ddb=DDB\n        Type: Path\n        Default: PosixPath('/path/to/demerge/data/ddb_20250819.fits.gz')\n        Path of DDB (DESHIMA database) file.\n    --overwrite=OVERWRITE\n        Type: bool\n        Default: False\n        If True, the reduced package and the merged DEMS file\n        will be overwritten even if they exist.\n    --debug=DEBUG\n        Type: bool\n        Default: False\n        If True, detailed logs for debugging will be printed.\n```\n\nA typical command run is as follows:\n```shell\ndemerge YYYYMMDDHHMMSS --data_dir /path/to/data --reduced_dir .cache\n```\nwhere the raw data directory, `/path/to/data/cosmos_YYYYMMDDHHMMSS`, will be selected, then an intermediate reduced data directory will be created as `./.cache/reduced_YYYYMMDDHHMMSS`, and finally the merged DEMS file will be placed as `./dems_YYYYMMDDHHMMSS.zarr.zip`.\n\n## Raw data directory\n\nThe name and the file structure of a raw data directory must be as follows:\n\n```plaintext\ncosmos_YYYYMMDDHHMMSS/\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.ant\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.cabin\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.fits\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.misti\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.obs\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.skychopper.dat.xz\n\u251c\u2500\u2500 YYYYMMDDHHMMSS.wea\n\u251c\u2500\u2500 YYYYMMDDHHMMSS_info.txt\n\u251c\u2500\u2500 kid_corresp.json\n\u251c\u2500\u2500 kids.list\n\u251c\u2500\u2500 localsweep.sweep\n\u251c\u2500\u2500 localsweep_info.txt\n\u2514\u2500\u2500 pretune\n    \u251c\u2500\u2500 kids.list\n    \u251c\u2500\u2500 localsweep.sweep\n    \u2514\u2500\u2500 localsweep_info.txt\n```\n\nIf multiple files with the same extension exist, then the last one sorted by name will be selected.\n\n## Use as a Python package\n\nAll (sub)commands are also available as Python functions of the same names in the `demerge` package.\nFor example, the following two runs are equivalent:\n\n```shell\n# run by a shell script\ndemerge YYYYMMDDHHMMSS --data_dir /path/to/data --reduced_dir .cache\n```\n\n```python\n# run by a Python script\nfrom demerge import demerge\ndemerge(\"YYYYMMDDHHMMSS\", data_dir=\"/path/to/data\", reduced_dir=\".cache\")\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021-2025 DESHIMA Team  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "DESHIMA merge code for observed datasets",
    "version": "2025.8.4",
    "project_urls": {
        "homepage": "https://deshima-dev.github.io/demerge",
        "repository": "https://github.com/deshima-dev/demerge"
    },
    "split_keywords": [
        "astronomy",
        " data-format",
        " deshima",
        " measurement-set",
        " spectroscopy",
        " submillimeter"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "07a2ae422b5451f9edef037d0a619324b8a7fded06c92e63e54b895b679035aa",
                "md5": "b712aa841e4639c843c897906f63da0a",
                "sha256": "85b3d3640a46aa5226d681baa9abcfbc003b6824de20cd04f8e0a5fb2592a4bb"
            },
            "downloads": -1,
            "filename": "demerge-2025.8.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b712aa841e4639c843c897906f63da0a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 20429340,
            "upload_time": "2025-08-21T03:39:05",
            "upload_time_iso_8601": "2025-08-21T03:39:05.098294Z",
            "url": "https://files.pythonhosted.org/packages/07/a2/ae422b5451f9edef037d0a619324b8a7fded06c92e63e54b895b679035aa/demerge-2025.8.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a3d2022ba526965906f2eebc9cdee8a04222c4ccd56307d68b102deb7635f11e",
                "md5": "43e3c22c2aecbeb0af3d78718ca95c0d",
                "sha256": "ee9cce739d62a7867103ef9ecfd846e4642b4ad84a621526a302f758218ebc34"
            },
            "downloads": -1,
            "filename": "demerge-2025.8.4.tar.gz",
            "has_sig": false,
            "md5_digest": "43e3c22c2aecbeb0af3d78718ca95c0d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 20512147,
            "upload_time": "2025-08-21T03:39:07",
            "upload_time_iso_8601": "2025-08-21T03:39:07.501974Z",
            "url": "https://files.pythonhosted.org/packages/a3/d2/022ba526965906f2eebc9cdee8a04222c4ccd56307d68b102deb7635f11e/demerge-2025.8.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 03:39:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "deshima-dev",
    "github_project": "demerge",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "demerge"
}
        
Elapsed time: 0.90624s