Skip to main content

Parse and declare NANTEN2/NASCO specific constants/parameters.

Project description

N-CONST

PyPI Python Test License

NANTEN2/NASCO Constants and ObservatioN Specification Translator.

Features

This library provides:

  • constants of the telescope system as useful python objects
  • parsers for parameter files unique to NANTEN2/NASCO system

Installation

pip install n-const

Usage

Be careful of the package name! Use underscore instead of hyphen.

Constants

Solid constants such as location of the telescope are declared in constants module. To use the constants:

>>> import n_const.constants as n2const
>>> n2const.LOC_NANTEN2
EarthLocation(2230866.39573496, -5440247.68222275, -2475554.41874542) m
>>> n2const.XFFTS.ch_num
32768

Constants objects support both keys and dot notations to access its components. So you can write:

>>> n2consst.XFFTS['ch_num']
32768

Parameters

Kisa parameter (parameters to correct instrumental error) and observation parameters are formatted using kisa and obsparam modules respectively.

To get the formatted kisa parameters:

>>> from n_const import kisa
>>> params = kisa.RadioKisa.from_file("path/to/kisafile")
>>> params.dAz
Quantity 5314.24667547 arcsec

# This module also support keys to access the components:

>>> params['dAz']
Quantity 5314.24667547 arcsec

To get the formatted observation parameters:

>>> from n_const import obsparams
>>> params = obsparams.OTFParams.from_file("path/to/obsfile")
>>> params.offset_Az
Quantity 0. deg
>>> params['offset_Az']
Quantity 0. deg

For conventional style obsfiles, this module provides a parser. This is a conventional one, so it provides very limited functionality;

  • Dot notation is not supported, keys only.
  • Return values are not combined with units.
>>> params = obsparams.obsfile_parser("path/to/obsfile")
>>> params['offset_Az']
0

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

N-CONST-0.1.0.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

N_CONST-0.1.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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