mao_merge_45m.accelerometer module#

convert(path_raw_zarr: Union[Sequence[Path], Path], path_fmt_zarr: Optional[Path] = None, *, length_per_chunk: int = 1000000, overwrite: bool = False, progress: bool = False) Path[source]#

Convert a raw Zarr file(s) to a formatted Zarr file.

This function will make a one-dimensional accelerometer outputs with time metadata derived from the raw Zarr file.

Parameters
  • path_raw_vdif – Path(s) of the raw VDIF file(s).

  • path_fmt_zarr (Optional[Path]) – Path of the formatted Zarr file (optional).

  • length_per_chunk (int) – Length per chunk in the Zarr file.

  • overwrite (bool) – Whether to overwrite the formatted Zarr file if exists.

  • progress (bool) – Whether to show a progress bar.

  • path_raw_zarr (Union[Sequence[Path], Path]) –

Returns

Path of the formatted Zarr file.

Raises

FileExistsError – Raised if the formatted Zarr file exists and overwriting is not allowed (default).

Return type

Path

Notes

The timezone of the Zarr file is not JST but UTC.

to_zarr(path_gbd: Path, path_zarr: Optional[Path] = None, *, length_per_chunk: int = 1000000, encoding: str = 'shift-jis', overwrite: bool = False, progress: bool = False) Path[source]#

Convert a GBD file to a Zarr file.

This function focuses on the conversion between formats. The formatted Zarr file with metadata will be made by another function (convert).

Parameters
  • path_gbd (Path) – Path of the GBD file.

  • path_zarr (Optional[Path]) – Path of the Zarr file (optional).

  • length_per_chunk (int) – Length per chunk in the Zarr file.

  • encoding (str) – Encoding of the GBD file.

  • overwrite (bool) – Whether to overwrite the Zarr file if exists.

  • progress (bool) – Whether to show a progress bar.

Returns

Path of the Zarr file.

Raises

FileExistsError – Raised if the Zarr file exists and overwriting is not allowed (default).

Return type

Path