PyCOMPLETE / LHCMeasurementTools

0 stars 2 forks source link

Issue with nxcals for BSRT calibration download #10

Closed giadarol closed 2 years ago

giadarol commented 3 years ago

Affects 005z_get_BSRT_calib.py

The following email was sent to the logging support: Hello, I may have found a small issue with pytimber when using nxcals. You can find below an example script. In the example the query with cals works as expected while the one with nxcals gives an error.

import pytimber

variables  = [
 'LHC.BSRT.5L4.B2:BETA_H',
 'LHC.BSRT.5L4.B2:BETA_V',
 'LHC.BSRT.5L4.B2:LSF_H',
 'LHC.BSRT.5L4.B2:LSF_V']

t_ref = 1527662003.558

# CALS
ldb = pytimber.LoggingDB(source='ldb')
ldb.get(variables, t_ref)

# NXCALS
nxc = pytimber.LoggingDB(source='nxcals')
nxc.get(variables, t_ref)

Here the error:

AttributeError                            Traceback (most recent call last)
<ipython-input-1-d7d747e32186> in <module>
     15 # NXCALS
     16 nxc = pytimber.LoggingDB(source='nxcals')
---> 17 nxc.get(variables, t_ref)

/afs/cern.ch/work/l/lhcecld/miniconda/lib/python3.8/site-packages/pytimber/pytimber.py in get(self, pattern_or_list, t1, t2, fundamental, unixtime)
    711                     datatype = None
    712                 else:
--> 713                     datatype = res[0].getVariableDataType().toString()
    714                     self._log.info(
    715                         "Retrieved {0} values for {1}".format(

AttributeError: 'NoneType' object has no attribute 'toString'

Many thanks in advance for your help!

Cheers,

Gianni

kparasch commented 2 years ago

No longer an issue