HDF5RawHeader¶
- class baseband_tasks.io.hdf5.header.HDF5RawHeader(*, verify=True, mutable=True, **kwargs)[source] [edit on github]¶
Bases:
baseband_tasks.io.hdf5.header.HDF5Header
Attributes Summary
The numpy dtype in which the data are stored.
Methods Summary
clear
()copy
()fromfile
(fh[, verify])Create a header from a yaml-encoded 'header' extension.
fromkeys
(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
fromvalues
(template[, whole, verify])Initialise a header from a template and/or values.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised
popitem
()2-tuple; but raise KeyError if D is empty.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
tofile
(fh)Write the header as a yaml-encoded 'header' extension.
update
(*[, verify])Update the header with new values.
values
()verify
()Attributes Documentation
- dtype¶
- encoded_dtype¶
The numpy dtype in which the data are stored.
This is generally the same as the actual
dtype
in which data are produced, except that it can have lower number of bits. Furthermore, theDTYPE_C4
dtype can be used for complex data using half-precision floats (‘<f2’) for the real and imaginary parts.Can be set using a
dtype
or a string (with ‘c4’ representing the above half-precision complex numbers). Will setdtype
as well (with half precision changed to single precision, i.e., ‘f2’ to ‘f4’ and ‘c4’ to ‘c4’).
- frequency¶
- polarization¶
- sample_rate¶
- sample_shape¶
- samples_per_frame¶
- shape¶
- sideband¶
- time¶
Methods Documentation
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D [edit on github]¶
- classmethod fromfile(fh, verify=True) [edit on github]¶
Create a header from a yaml-encoded ‘header’ extension.
- fromkeys(iterable, value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- classmethod fromvalues(template, whole=None, verify=True, **kwargs) [edit on github]¶
Initialise a header from a template and/or values.
- Parameters
- templateheader or stream template, optional
Must have attributes that define a header (‘sample_shape’, ‘samples_per_frame’, ‘sample_rate’, ‘time’, and either ‘dtype’ or ‘bps’ and ‘complex_data’).
- wholebool, optional
If
True
, assume a header for the complete stream is wanted, and use ‘start_time’ for the ‘time’ and the total number of samples for ‘samples_per_frame’. Default:True
if the template has both ‘start_time’ and ‘shape’ (i.e., for streams).- verifybool, optional
Whether to do basic verification. Default:
True
.- **kwargs
Any additional values. These will override values inferred from the template.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- tofile(fh) [edit on github]¶
Write the header as a yaml-encoded ‘header’ extension.
- update(*, verify=True, **kwargs) [edit on github]¶
Update the header with new values.
Here, any keywords matching properties are processed as well, in the order set by the class (in
_properties
), and after all other keywords have been processed.- Parameters
- verifybool, optional
If
True
(default), verify integrity after updating.- **kwargs
Arguments used to set keywords and properties.
- values() an object providing a view on D's values ¶
- verify()[source] [edit on github]¶