Esempio n. 1
0
 def testBinLengthSuitable(self):
     multifetcher = mf.MultiJsonFetcher()
     self.assertIsInstance(multifetcher.bin_length, int,
                           "Bin_Length must be an int")
     multifetcher = mf.MultiJsonFetcher(bin_length=1.5)
     self.assertIsInstance(multifetcher.bin_length, int,
                           "Bin_Length must be an int")
Esempio n. 2
0
    def testTimesAreLength2TuplesA(self):
        tz = get_localzone()
        startA = tz.localize(datetime(2019, 5, 2, 14))
        endA = tz.localize(datetime(2019, 5, 2, 15))
        startB = tz.localize(datetime(2019, 5, 2, 16))
        endB = tz.localize(datetime(2019, 5, 2, 17))

        multifetcher = mf.MultiJsonFetcher(times=[(startA, endA), (startB,
                                                                   endB)])
        if isinstance(multifetcher.times, list):
            for key in multifetcher.times:
                for time in key:
                    self.assertIsInstance(
                        time, datetime,
                        "Time " + str(time) + " is not a datetime object")
Esempio n. 3
0
 def testTimesAreLength2Tuples(self):
     multifetcher = mf.MultiJsonFetcher()
     if isinstance(multifetcher.times, list):
         for time in multifetcher.times:
             self.assertIsInstance(time, tuple,
                                   "Time " + str(time) + " is not a tuple")
Esempio n. 4
0
 def testTimesAreList(self):
     multifetcher = mf.MultiJsonFetcher()
     self.assertIsInstance(multifetcher.times, list,
                           "times are not as list")
Esempio n. 5
0
 def testPVsInMultiFetcherIsList(self):
     multifetcher = mf.MultiJsonFetcher()
     self.assertIsInstance(multifetcher.pvs, list, "PVs are not as list")
Esempio n. 6
0
 def testMultifetcherInits(self):
     multifetcher = mf.MultiJsonFetcher()
     self.assertIsInstance(multifetcher, mf.MultiJsonFetcher)
Esempio n. 7
0
from aa.js import JsonFetcher
from datetime import datetime
from tzlocal import get_localzone
import matplotlib as dnp
from ArchiverTool import multifetcher as mf
import radia as rad

tz = get_localzone()


multifetcher = mf.MultiJsonFetcher(times=[('a','b','c')])

for key in multifetcher.times:
    print(key)

ArchiverBessy = 'archiver.bessy.de'
CurrentBessy = 'TOPUPCC:rdCur'


start = tz.localize(datetime(2019, 5, 2,14))

end = tz.localize(datetime(2019, 5, 2, 15))

jfetcher_Bessy = JsonFetcher(ArchiverBessy,80)


#eventBessy = jfetcher_Bessy.get_values(CurrentBessy, start, end,1,{'firstFill':60})
eventffBessy = jfetcher_Bessy.get_values(CurrentBessy, start, end, binning_params={'firstFill':60})
eventBessy = jfetcher_Bessy.get_values(CurrentBessy, start, end)
#plot1 = dnp.pyplot.