Open nkarast opened 6 years ago
Hello,
Can you reproduce the situtation below?
t1 = pd.Timestamp("2018-07-25 20:26:41") t2 = pd.Timestamp("2018-07-26 02:11:49") importLSA.LHCLsa2pd(parameterList=['ADTHorM1.B2/PH_SHIFT_1'], beamprocessList=['RAMP_PELP-SQUEEZE-ATS-65cm_HighTele_V1'], t1=t1, t2=t2)
ValueErrorTraceback (most recent call last) <ipython-input-104-9f858522582a> in <module>() ----> 1 importLSA.LHCLsa2pd(parameterList=['ADTHorM1.B2/PH_SHIFT_1'], beamprocessList=['RAMP_PELP-SQUEEZE-ATS-65cm_HighTele_V1'], t1=t1, t2=t2) /eos/user/n/nkarast/.local/lib/python2.7/site-packages/cl2pd/importLSA.pyc in LHCLsa2pd(parameterList, beamprocessList, t1, t2, verbose) 54 start=t1, end=t2) 55 if len(trims): ---> 56 a=pd.merge(a,pd.DataFrame(index=pd.to_datetime(trims[i].time,unit='s'),data=trims[i].data, columns=[i]), how='outer',left_index=True,right_index=True) 57 58 beamprocessDFList.append(a); /cvmfs/sft.cern.ch/lcg/views/LCG_93/x86_64-slc6-gcc62-opt/lib/python2.7/site-packages/pandas/core/frame.pyc in __init__(self, data, index, columns, dtype, copy) 383 else: 384 mgr = self._init_ndarray(data, index, columns, dtype=dtype, --> 385 copy=copy) 386 else: 387 mgr = self._init_dict({}, index, columns, dtype=dtype) /cvmfs/sft.cern.ch/lcg/views/LCG_93/x86_64-slc6-gcc62-opt/lib/python2.7/site-packages/pandas/core/frame.pyc in _init_ndarray(self, values, index, columns, dtype, copy) 511 # by definition an array here 512 # the dtypes will be coerced to a single dtype --> 513 values = _prep_ndarray(values, copy=copy) 514 515 if dtype is not None: /cvmfs/sft.cern.ch/lcg/views/LCG_93/x86_64-slc6-gcc62-opt/lib/python2.7/site-packages/pandas/core/frame.pyc in _prep_ndarray(values, copy) 6222 values = values.reshape((values.shape[0], 1)) 6223 elif values.ndim != 2: -> 6224 raise ValueError('Must pass 2-d input') 6225 6226 return values ValueError: Must pass 2-d input
While for the '_END' point of the BP it's working fine.
importLSA.LHCLsa2pd(parameterList=['ADTHorM1.B2/PH_SHIFT_1'], beamprocessList=['RAMP_PELP-SQUEEZE-ATS-65cm_HighTele_V1@1210_[END]'], t1=t1, t2=t2)
I think it is related to the fact that the trim tuple returned by pjLSA contains a single index array for the time record and then for the data record you get a 2D ndarray with times and data points. I can have a look at some point.
importLSA.lsa.getTrims(beamprocess='RAMP_PELP-SQUEEZE-ATS-65cm_HighTele_V1', parameter=['ADTHorM1.B2/PH_SHIFT_1'], start=t1, end=t2)
`{u'ADTHorM1.B2/PH_SHIFT_1': TrimTuple(time=[1532559603L], data=[array([[ 0. , 241. , 293. , 545. , 649. , 749. , 824. ,
N.
Hello,
Can you reproduce the situtation below?
While for the '_END' point of the BP it's working fine.
I think it is related to the fact that the trim tuple returned by pjLSA contains a single index array for the time record and then for the data record you get a 2D ndarray with times and data points. I can have a look at some point.
`{u'ADTHorM1.B2/PH_SHIFT_1': TrimTuple(time=[1532559603L], data=[array([[ 0. , 241. , 293. , 545. , 649. , 749. , 824. ,
N.