EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: EPICS data extraction with mysql and compressed data
From: Ghribi Adnan <[email protected]>
To: "[email protected]" <[email protected]>
Date: Tue, 9 Jan 2018 07:37:50 +0000
Dear all,

I have a question regarding recovering data archived by epics using mysql. I use a python code to automatically recover and analyse a set of data. Some of these data are constant and compressed by EPICS so when I extract them with respect to a given data stamp, it gives “nan”. The only way to get value is to have a variation. Looping the time stamps is not feasible as I can easily miss the right time stamp. Do you of of any way that could allow to directly extract constant compressed data ? 

Here is the code I use for the extraction :

def db_fetch1(variable, time1, time2):
    import pymysql
    import numpy as np
    conn = pymysql.connect(host='accmysqlslv', port=3306, user='archive', passwd='archive', db='archive2')
    cur = conn.cursor()
    command = "select float_val from sample s where s.channel_id = (select channel_id from channel where name = '" + variable + "') and smpl_time >= '" + time1 + "' and smpl_time < '"+ time2 + "'"
    cur.execute(command)
    output = []
    for row in cur:
        if np.isreal(row[0]) == True:
            output.append(row[0])
    cur.close()
    conn.close()
    output = np.array(output,dtype=float)
    return output

Thank you,

Best regards,
Adnan Ghribi

 

CNRS - GANIL PhD, Adnan GHRIBI

a: Bvd Henri Becquerel, 14000, Caen, France t: +33 2 31 45 46 80 f: +33 2 31 45 46 47

w: http://www.ganil-spiral2.eu/?set_language=en

 
                                                           

Attachment: signature.asc
Description: Message signed with OpenPGP


Replies:
Re: EPICS data extraction with mysql and compressed data Kasemir, Kay

Navigate by Date:
Prev: Re: compress record FIFI/LIFO not working Michael Davidsaver
Next: Example for User Created File Types in the build system Jeong Han Lee
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: compress record FIFI/LIFO not working Daniel Schick
Next: Re: EPICS data extraction with mysql and compressed data Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 13 Apr 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·