Coder Social home page Coder Social logo

mao-wfs / mao-merge-45m Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 26.73 MB

Merge MAO datasets observed with NRO 45m telescope into a single Zarr file

Home Page: https://mao-wfs.github.io/mao-merge-45m

License: MIT License

Python 99.55% Dockerfile 0.45%
nro45 mao data-merge xarray python radio-astronomy single-dish zarr

mao-merge-45m's Introduction

mao-merge-45m

Merge MAO datasets observed with the Nobeyama 45m telescope

Installation

$ git clone https://github.com/mao-wfs/mao-merge-45m.git
$ cd mao-merge-45m
$ poetry install

Convert raw data to formatted (Zarr) data

Correlator output

from pathlib import Path
from mao_merge_45m import correlator


path_vdif = Path("/path/to/data.vdif")
path_raw_zarr = correlator.to_zarr(path_vdif)
path_fmt_zarr = correlator.convert(path_raw_zarr)

Accelerometer log

from pathlib import Path
from mao_merge_45m import accelerometer


path_gbd = Path("/path/to/data.gbd")
path_raw_zarr = accelerometer.to_zarr(path_gbd)
path_fmt_zarr = accelerometer.convert(path_raw_zarr)

Accelerometer log (CSV format)

from pathlib import Path
from mao_merge_45m import accelerometer_csv


path_csv = Path("/path/to/data.csv")
path_zarr = accelerometer_csv.convert(path_csv)

Weather log

from pathlib import Path
from mao_merge_45m import weather


path_csv = Path("/path/to/data.csv")
path_zarr = accelerometer.convert(path_csv)

Antenna log (normal 10-sps format)

from pathlib import Path
from mao_merge_45m import antenna


path_log = Path("/path/to/data.txt")
path_zarr = antenna.convert(path_log)

Antenna log (new 50-sps format)

from pathlib import Path
from mao_merge_45m import antenna_50_sps


path_log = Path("/path/to/data.txt")
path_zarr = antenna_50_sps.convert(path_log)

SAM45 log (text dumped by sldump)

from pathlib import Path
from mao_merge_45m import sam45


path_log = Path("/path/to/data.txt")
path_zarr = sam45.convert(path_log)

Merge formatted data into a single Zarr file

from pathlib import Path
from mao_merge_45m import merge


path_correlator = Path("/path/to/formatted/correlator.zarr")
path_accelerometer = Path("/path/to/formatted/accelerometer.zarr")
path_weather = Path("/path/to/formatted/weather.zarr")
path_antenna = Path("/path/to/formatted/antenna.zarr")
path_sam45 = Path("/path/to/formatted/sam45.zarr")
path_merged = Path("/path/to/merged.zarr")


merge.merge(
    path_correlator,
    path_merged,
    path_accelerometer_zarr=path_accelerometer,
    path_weather_zarr=path_weather,
    path_antenna_zarr=path_antenna,
    path_sam45_zarr=path_sam45,
)

mao-merge-45m's People

Contributors

astropenguin avatar kiwakami avatar nasatoya avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

mao-merge-45m's Issues

Rename project

  • Rename package name (nro45_mergemao_merge_45m)
  • Rename repository name (nro45-mergemao-merge-45m)

Add command line interface

  • Add command line interface, nro45-merge
  • Add empty interface functions for dry-run
  • Add logging feature

Add support for Poetry >=1.2

Update pyproject.toml and poetry.lock to be compatible with Poetry >=1.2.

Any dependency declared in the legacy dev-dependencies section will automatically be added to a dev group.
As the dev-dependencies is now deprecated, projects should migrate to the new group syntax as soon as possible.
Keep in mind that the group syntax is a new feature of Poetry 1.2, and your project will not be buildable with Poetry 1.1 after migrating.
https://python-poetry.org/blog/announcing-poetry-1.2.0/#dependency-groups

Add conversion from Zarr to VDIF

Add nro45_merge.correlator.to_vdif function to convert a Zarr file to a VDIF file.
(It is for identity check between a VDIF file and that converted as VDIF → Zarr → VDIF)

Fix timezone of weather and accelerometer data

Weather and accelerometer data for distribution uses raw timestamps in JST, but correlator data are written in UTC.
Fix weather.to_dist_zarr and accelerometer.to_dist_zarr so that they uses UTC as the timezone of output Zarr files.

Add options to shift timestamps of logs

  • merge()関数の以下の行の間でcorrelator.timeの時刻にオフセットを与えられるようにする
    correlator = xr.open_zarr(path_correlator_zarr)
    # correlator.timeにオフセットを加える
    correlator.to_zarr(path_merged_zarr, mode="w")
  • merge()関数に時刻オフセットの引数を追加する
  • merge()関数のdocstringに時刻オフセットの記述を追加する

Add antenna module

  • Add antenna module
  • Add antenna log to Zarr converter
  • Add tests for the module

Add option to change integration time (5 or 10 ms)

The correlator module currently only supports for the integration time of 10 ms.
This issue will update the code to support for the integration time of 5 ms as well.

Note: In the current code, changing the integration time (10 → 5 ms) needs to change the following constants:

-N_UNITS_PER_SECOND = 6400
+N_UNITS_PER_SECOND = 12800
...
-N_SCANS_PER_SECOND = 100
+N_SCANS_PER_SECOND = 200
...
-N_SCANS_PER_MINUTE = 6000
+N_SCANS_PER_MINUTE = 12000
...
-UNIT_MILLISECOND = np.timedelta64(10, "ms")
+UNIT_MILLISECOND = np.timedelta64(5, "ms")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.