GSBPhasedHeader¶
- class baseband.gsb.header.GSBPhasedHeader(words=None, mode=None, nbytes=None, utc_offset=<Quantity 5.5 h>, verify=True)[source] [edit on github]¶
Bases:
GSBRawdumpHeader
GSB phased header.
Attributes Summary
Mode in which data was taken: 'phased' or 'rawdump'.
Whether the header can be modified.
Size of the header in characters.
Methods Summary
copy
(**kwargs)Create a mutable and independent copy of the header.
fromfile
(fh, *args, **kwargs)Read GSB Header from a line from a timestamp file.
fromkeys
([mode, nbytes])Initialise a header from parsed values.
fromvalues
([mode, nbytes])Initialise a header from parsed values.
keys
()All keys defined for this header.
seek_offset
(n[, nbytes])Offset in bytes needed to move a file pointer to another header.
tofile
(fh)Write GSB header as a line to the filehandle.
update
(*[, verify])Update the header by setting keywords or properties.
verify
()Base verification always passes.
Attributes Documentation
- gps_time¶
- mode¶
Mode in which data was taken: ‘phased’ or ‘rawdump’.
- mutable¶
Whether the header can be modified.
- nbytes¶
Size of the header in characters.
Assumes the string terminates in one blank space and one carriage return.
- pc_time¶
- time¶
Methods Documentation
- copy(**kwargs) [edit on github]¶
Create a mutable and independent copy of the header.
Keyword arguments can be passed on as needed by possible subclasses.
- classmethod fromfile(fh, *args, **kwargs) [edit on github]¶
Read GSB Header from a line from a timestamp file.
Arguments are the same as for class initialisation. The header constructed will be immutable.
- classmethod fromkeys(mode=None, nbytes=None, *args, **kwargs) [edit on github]¶
Initialise a header from parsed values.
Like fromvalues, but without any interpretation of keywords.
- Raises:
- KeyErrorif not all keys required are present in
kwargs
- KeyErrorif not all keys required are present in
- classmethod fromvalues(mode=None, nbytes=None, *args, **kwargs) [edit on github]¶
Initialise a header from parsed values.
Here, the parsed values must be given as keyword arguments, i.e., for any
header = cls(<words>)
,cls.fromvalues(**header) == header
.However, unlike for the
fromkeys
class method, data can also be set using arguments named after header methods, such astime
.- Parameters:
- *args
Possible arguments required to initialize an empty header.
- **kwargs
Values used to initialize header keys or methods.
- keys() [edit on github]¶
All keys defined for this header.
- seek_offset(n, nbytes=None)[source] [edit on github]¶
Offset in bytes needed to move a file pointer to another header.
GSB headers for phased data differ in size depending on the sequence number, making it impossible to trivially jump to another entry in a timestamp file. This routine allows one to calculate the offset required to move the file pointer
n
headers.- Parameters:
- nint
The number of headers to move to, relative to the present header.
- nbytesint, optional
The size in bytes of the present header (if not given, will use the header’s
nbytes
property).
- tofile(fh) [edit on github]¶
Write GSB header as a line to the filehandle.
- update(*, verify=True, **kwargs) [edit on github]¶
Update the header by setting keywords or properties.
Here, any keywords matching header keys are applied first, and any remaining ones are used to set header properties, in the order set by the class (in
_properties
).- Parameters:
- verifybool, optional
If
True
(default), verify integrity after updating.- **kwargs
Arguments used to set keywords and properties.
- verify() [edit on github]¶
Base verification always passes.
Only here for subclasses to be able to do super().