Parse and declare NANTEN2/NASCO specific constants/parameters.
Project description
N-CONST
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
- This library uses Semantic Versioning.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.