Skip to content
Snippets Groups Projects
Commit edb94c28 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-436: Fix block_index calculation, and use derived baseline based instead of original one.

parent 7dbb2c48
No related branches found
No related tags found
1 merge request!149L2SS-436: Conjugate XSTs if they are from the other triangle of the matrix...
...@@ -165,7 +165,7 @@ class XSTCollector(StatisticsCollector): ...@@ -165,7 +165,7 @@ class XSTCollector(StatisticsCollector):
raise ValueError("Packet describes baselines starting at %s, but we require a multiple of BLOCK_LENGTH=%d" % (fields.first_baseline, self.MAX_INPUTS)) raise ValueError("Packet describes baselines starting at %s, but we require a multiple of BLOCK_LENGTH=%d" % (fields.first_baseline, self.MAX_INPUTS))
# Make sure we always have a baseline (a,b) with a>=b. If not, we swap the indices and mark that the data must be conjugated when processed. # Make sure we always have a baseline (a,b) with a>=b. If not, we swap the indices and mark that the data must be conjugated when processed.
first_baseline = fields.first_baseline[antenna] first_baseline = fields.first_baseline
if first_baseline[0] < first_baseline[1]: if first_baseline[0] < first_baseline[1]:
conjugated = True conjugated = True
first_baseline = (first_baseline[1], first_baseline[0]) first_baseline = (first_baseline[1], first_baseline[0])
...@@ -177,13 +177,10 @@ class XSTCollector(StatisticsCollector): ...@@ -177,13 +177,10 @@ class XSTCollector(StatisticsCollector):
# #
# we honour this format, as we want to keep the metadata together with these blocks. we do need to put the blocks in a linear # we honour this format, as we want to keep the metadata together with these blocks. we do need to put the blocks in a linear
# and tight order, however, so we calculate a block index. # and tight order, however, so we calculate a block index.
block_index = baseline_index(fields.first_baseline[0] // self.BLOCK_LENGTH, fields.first_baseline[1] // self.BLOCK_LENGTH) block_index = baseline_index(first_baseline[0] // self.BLOCK_LENGTH, first_baseline[1] // self.BLOCK_LENGTH)
# process the packet # process the packet
self.parameters["nof_valid_payloads"][fields.gn_index] += numpy.uint64(1) self.parameters["nof_valid_payloads"][fields.gn_index] += numpy.uint64(1)
block_index = baseline_index(fields.first_baseline[0], fields.first_baseline[1])
self.parameters["xst_blocks"][block_index][:fields.nof_statistics_per_packet] = fields.payload self.parameters["xst_blocks"][block_index][:fields.nof_statistics_per_packet] = fields.payload
self.parameters["xst_timestamps"][block_index] = numpy.float64(fields.timestamp().timestamp()) self.parameters["xst_timestamps"][block_index] = numpy.float64(fields.timestamp().timestamp())
self.parameters["xst_conjugated"][block_index] = conjugated self.parameters["xst_conjugated"][block_index] = conjugated
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment