Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  30 Jan 2025, Pavel Murat, Forum, converting non-MIDAS slow control data into MIDAS history format ? 
    Reply  31 Jan 2025, Pavel Murat, Forum, converting non-MIDAS slow control data into MIDAS history format ? 
    Reply  01 Feb 2025, Pavel Murat, Bug Report, MIDAS history system not using the event timestamps ? test_frontend.pyval_nightly.csv
Message ID: 2936     Entry time: 01 Feb 2025     In reply to: 2934
Author: Pavel Murat 
Topic: Bug Report 
Subject: MIDAS history system not using the event timestamps ? 
> I have a time series of slow control measurements in an ASCII format - 
> data records in a format (run_number, time, temperature, voltage1, ..., voltageN), 
> and, if possible, would like to convert them into a MIDAS history format. 
> 
> Making MIDAS events out of that data is easy, but is it possible to preserve 
> the time stamps?  - Logically, this boils down to whether it is possible to have  
> the event time set by a user frontend

It looks that the original question was not as naive as I expected and may be pointing to a subtle bug. 
I have implemented a python frontend - essentially a clone of 

https://bitbucket.org/tmidas/midas/src/develop/python/midas/frontend.py

reading the old slow control data and setting the event.header.timestamp's to some dates from the year of 2022. 

When I run MIDAS and read the "old slow control events", one event in 10 seconds, 
the MIDAS Event Dump utility shows the data with the correct event timestamps, from the year of 2022. 

However the history plots show the event parameters with the timestamps from Feb 01 2025 and the adjacent 
data points separated by 10 sec.

Is it possible that the history system uses its own timestamp setting instead of using timestamps from the event headers? 
- Under normal circumstances, the two should be very close, and that could've kept the issue hidden... 

-- thanks, regards, Pasha

UPDATE:  I attached the frontend code and the input data file it is reading. The data file should reside in the local directory
- the frontend code doesn't have everything fully automated for the test, 
  -- an integer field "/Mu2e/Offline/Ops/LastTime" would need to be created manually
  -- the history plots would need to be declared manually
Attachment 1: test_frontend.py  6 kB  Uploaded 02 Feb 2025  | Show | Show all
Attachment 2: val_nightly.csv  135 kB  Uploaded 02 Feb 2025  | Show | Show all
ELOG V3.1.4-2e1708b5