Mark4TrackHeader¶
-
class
baseband.mark4.header.
Mark4TrackHeader
(words, decade=None, ref_time=None, verify=True)[source] [edit on github]¶ Bases:
baseband.vlbi_base.header.VLBIHeaderBase
Decoder/encoder of a Mark 4 Track Header.
See http://www.haystack.mit.edu/tech/vlbi/mark5/docs/230.3.pdf
- Parameters
- wordstuple of int, or None
Five 32-bit unsigned int header words. If
None
, set to a list of zeros for later initialisation.- decadeint or None
Decade in which the observations were taken (needed to remove ambiguity in the Mark 4 time stamp). Can instead pass an approximate
ref_time
.- ref_time
Time
or None Reference time within 4 years of the observation time, used to infer the full Mark 4 timestamp. Used only if
decade
is not given.- verifybool, optional
Whether to do basic verification of integrity. Default:
True
.
- Returns
- header
Mark4TrackHeader
- header
Attributes Summary
Fractional seconds (decoded from ‘bcd_fraction’).
Whether the header can be modified.
Size of the header in bytes.
Convert BCD time code to Time object.
Methods Summary
copy
(self, \*\*kwargs)Create a mutable and independent copy of the header.
fromfile
(fh, \*args, \*\*kwargs)Read VLBI Header from file.
fromkeys
(\*args, \*\*kwargs)Initialise a header from parsed values.
fromvalues
(\*args, \*\*kwargs)Initialise a header from parsed values.
get_time
(self)Convert BCD time code to Time object.
infer_decade
(self, ref_time)Uses a reference time to set a header’s
decade
.keys
(self)set_time
(self, time)tofile
(self, fh)Write VLBI frame header to filehandle.
update
(self, \*[, verify])Update the header by setting keywords or properties.
verify
(self)Verify header integrity.
Attributes Documentation
-
decade
= None¶
-
fraction
¶ Fractional seconds (decoded from ‘bcd_fraction’).
-
mutable
¶ Whether the header can be modified.
-
nbytes
¶ Size of the header in bytes.
-
time
¶ Convert BCD time code to Time object.
Calculate time using bcd-encoded ‘bcd_unit_year’, ‘bcd_day’, ‘bcd_hour’, ‘bcd_minute’, ‘bcd_second’ header items, as well as the
fraction
property (inferred from ‘bcd_fraction’) anddecade
from the initialisation. See See http://www.haystack.mit.edu/tech/vlbi/mark5/docs/230.3.pdf
-
track_id
¶
Methods Documentation
-
copy
(self, **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 VLBI Header from file.
Arguments are the same as for class initialisation. The header constructed will be immutable.
-
classmethod
fromkeys
(*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
(*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.
-
get_time
(self)[source] [edit on github]¶ Convert BCD time code to Time object.
Calculate time using bcd-encoded ‘bcd_unit_year’, ‘bcd_day’, ‘bcd_hour’, ‘bcd_minute’, ‘bcd_second’ header items, as well as the
fraction
property (inferred from ‘bcd_fraction’) anddecade
from the initialisation. See See http://www.haystack.mit.edu/tech/vlbi/mark5/docs/230.3.pdf
-
infer_decade
(self, ref_time)[source] [edit on github]¶ Uses a reference time to set a header’s
decade
.- Parameters
- ref_time
Time
Reference time within 5 years of the observation time.
- ref_time
-
keys
(self) [edit on github]¶
-
set_time
(self, time)[source] [edit on github]¶
-
tofile
(self, fh) [edit on github]¶ Write VLBI frame header to filehandle.
-
update
(self, *, 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
(self)[source] [edit on github]¶ Verify header integrity.