Necst Constants and ObservatioN Specification Translator.
Project description
N-CONST
Necst Constants and ObservatioN Specification Translator.
Features
This library provides:
- constants of the telescope system as useful python objects
- parsers for parameter files unique to NECST
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
>>> n_const.LOC_NANTEN2
EarthLocation(2230866.39573496, -5440247.68222275, -2475554.41874542) m
>>> n_const.XFFTS.ch_num
32768
Constants
objects support both keys and dot notations to access its components. So you can write:
>>> n_const.XFFTS['ch_num']
32768
You now can get all the parameters packed in the Constants
using dict
method:
>>> n_const.XFFTS.keys()
dict_keys(['ch_num', 'bandwidth'])
>>> n_const.REST_FREQ.values()
dict_values([<Quantity 115.27 GHz>, <Quantity 110.20 GHz>, ..., <Quantity 219.56 GHz>])
>>> n_const.XFFTS.items()
dict_items([('ch_num', 32768), ('bandwidth', <Quantity 2. GHz>)])
Parameters
Pointing error parameter (parameters to correct pointing error) and observation parameters are extracted via pointing
and obsparam
modules respectively.
To get the pointing error parameters:
>>> from n_const.pointing import PointingError
>>> params = PointingError.from_file("path/to/param_file")
>>> params.dAz
Quantity 5314.24667547 arcsec
# This module also supports keys to access the components:
>>> params['dAz']
Quantity 5314.24667547 arcsec
To get the observation parameters:
>>> from n_const import obsparams
>>> params = obsparams.OTFParams.from_file("path/to/obs_file")
>>> params.Beta_on
<Angle 15.51638889 deg>
>>> params['Beta_on']
<Angle 15.51638889 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/obs_file")
>>> params['offset_Az']
0
This library is using 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.
Source Distribution
Built Distribution
File details
Details for the file N-CONST-1.1.0.tar.gz
.
File metadata
- Download URL: N-CONST-1.1.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6356094ec69b971afa1b94c9dc666770583befa9d9df223520c0390d5526996c |
|
MD5 | 469224291a4a7fd2983b9d559b4d4cc6 |
|
BLAKE2b-256 | 58056f5054e0bf10f89bfd9b025b91b83aa331bc427027dd90781b65fb540ce3 |
File details
Details for the file N_CONST-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: N_CONST-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0d5ebcf1fa807dbf55beae1dfbfd6f3c1a32d5090ee9b09d9ac67dc968400a1 |
|
MD5 | 9dc52c4f49ca36e1560b68e5de730343 |
|
BLAKE2b-256 | b493e8078c679d033920f1b8243b5d38dbba2ca6f5c9d3b2a8a24055041bb415 |