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:

words : tuple of int, or None

Five 32-bit unsigned int header words. If None, set to a list of zeros for later initialisation.

decade : int 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.

verify : bool, optional

Whether to do basic verification of integrity. Default: True.

Returns:

header : Mark4TrackHeader

Attributes Summary

decade
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.
track_id

Methods Summary

copy(**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() Convert BCD time code to Time object.
infer_decade(ref_time) Uses a reference time to set a header’s decade.
keys()
set_time(time)
tofile(fh) Write VLBI frame header to filehandle.
update(**kwargs) Update the header by setting keywords or properties.
verify() 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’) and decade from the initialisation. See See http://www.haystack.mit.edu/tech/vlbi/mark5/docs/230.3.pdf

track_id

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 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:KeyError : if not all keys required are present in kwargs
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 as time.

Parameters:

*args

Possible arguments required to initialize an empty header.

**kwargs

Values used to initialize header keys or methods.

get_time()[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’) and decade from the initialisation. See See http://www.haystack.mit.edu/tech/vlbi/mark5/docs/230.3.pdf

infer_decade(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.

keys() [edit on github]
set_time(time)[source] [edit on github]
tofile(fh) [edit on github]

Write VLBI frame header to filehandle.

update(**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:

verify : bool, optional

If True (default), verify integrity after updating.

**kwargs

Arguments used to set keywords and properties.

verify()[source] [edit on github]

Verify header integrity.