Skip to content
Snippets Groups Projects
Commit cf79c2ac authored by Kipp Cannon's avatar Kipp Cannon
Browse files

lal_whiten: encode PSD timestamps in message timestamps

instead of adding an extra timestamp structure element to the message
parent 5ea4ff8a
No related branches found
No related tags found
No related merge requests found
......@@ -538,15 +538,17 @@ static GstMessage *psd_message_new(GSTLALWhiten *element, REAL8FrequencySeries *
char units[50];
GstStructure *s = gst_structure_new(
"spectrum",
"timestamp", G_TYPE_UINT64, (guint64) XLALGPSToINT8NS(&psd->epoch),
"delta-f", G_TYPE_DOUBLE, psd->deltaF,
"sample-units", G_TYPE_STRING, XLALUnitAsString(units, sizeof(units), &psd->sampleUnits),
"magnitude", G_TYPE_VALUE_ARRAY, va,
NULL
);
GstMessage *m = gst_message_new_element(GST_OBJECT(element), s);
g_value_array_free(va);
return gst_message_new_element(GST_OBJECT(element), s);
GST_MESSAGE_TIMESTAMP(m) = XLALGPSToINT8NS(&psd->epoch);
return m;
}
......
......@@ -143,7 +143,7 @@ def parse_spectrum_message(message):
"""
return laltypes.REAL8FrequencySeries(
name = "PSD",
epoch = laltypes.LIGOTimeGPS(0, message.structure["timestamp"]),
epoch = laltypes.LIGOTimeGPS(0, message.timestamp),
f0 = 0.0,
deltaF = message.structure["delta-f"],
sampleUnits = laltypes.LALUnit(message.structure["sample-units"].strip()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment