neclib.utils.data_utils#
Utility functions for data structure handling.
- class ParameterList(value=[])[source]#
Bases:
list
List, specialized in parameter storing.
- Parameters:
value (Iterable) – Iterable object to be converted to ParameterList.
Examples
>>> neclib.utils.ParameterList([0, 0]) ParameterList([0, 0]) >>> neclib.utils.ParameterList(range(5)) ParameterList([0, 1, 2, 3, 4])
- classmethod new(length, initvalue=nan)[source]#
Create new ParameterList instance filled with initial value.
- Parameters:
length (int) – Length of
ParameterList
to be created.initvalue (Any) – Initial value to fill the
ParameterList
.
- Return type:
Examples
>>> neclib.utils.ParameterList.new(3, 100) ParameterList([100, 100, 100])
- push(value)[source]#
Append new value to ParameterList, preserving its length.
- Parameters:
value (Any) – Value to be appended.
- Return type:
None
Examples
>>> param = neclib.utils.ParameterList([1, 2]) >>> param.push(5) >>> param ParameterList([2, 5])
- copy()[source]#
Return copied ParameterList.
Examples
>>> param = neclib.utils.ParameterList([1, 2]) >>> param.copy() ParameterList([1, 2])
- class AzElData(az: Any = None, el: Any = None)[source]#
Bases:
object
- Parameters:
az (Any) –
el (Any) –
- az: Any = None#
Parameter related to azimuth axis.
- el: Any = None#
Parameter related to elevation axis.
- class ParameterMapping[source]#
Bases:
dict
Dict, with attribute access to parameter supported.
Parameter mapping, supports both dict-key syntax and attribute access syntax. Dict methods are fully supported.
Examples
>>> param = neclib.utils.ParameterMapping(a=1, b=2) >>> param["a"] 1 >>> param.a 1 >>> neclib.utils.ParameterMapping({"a": 1, "b": 2}) == param True