Skip to main content

DESHIMA merge code for observed datasets

Project description

de:merge

Release Python Downloads DOI Tests

DESHIMA merge code for observed datasets

Installation

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:

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:

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:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demerge-2025.8.4.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demerge-2025.8.4-py3-none-any.whl (20.4 MB view details)

Uploaded Python 3

File details

Details for the file demerge-2025.8.4.tar.gz.

File metadata

  • Download URL: demerge-2025.8.4.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.12

File hashes

Hashes for demerge-2025.8.4.tar.gz
Algorithm Hash digest
SHA256 ee9cce739d62a7867103ef9ecfd846e4642b4ad84a621526a302f758218ebc34
MD5 43e3c22c2aecbeb0af3d78718ca95c0d
BLAKE2b-256 a3d2022ba526965906f2eebc9cdee8a04222c4ccd56307d68b102deb7635f11e

See more details on using hashes here.

File details

Details for the file demerge-2025.8.4-py3-none-any.whl.

File metadata

  • Download URL: demerge-2025.8.4-py3-none-any.whl
  • Upload date:
  • Size: 20.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.12

File hashes

Hashes for demerge-2025.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 85b3d3640a46aa5226d681baa9abcfbc003b6824de20cd04f8e0a5fb2592a4bb
MD5 b712aa841e4639c843c897906f63da0a
BLAKE2b-256 07a2ae422b5451f9edef037d0a619324b8a7fded06c92e63e54b895b679035aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page