@@ -55,14 +55,20 class Figure: | |||||
55 |
|
55 | |||
56 | def getTimeLim(self, x, xmin, xmax): |
|
56 | def getTimeLim(self, x, xmin, xmax): | |
57 |
|
57 | |||
|
58 | if self.timerange != None: | |||
|
59 | txmin = x[0] - x[0]%self.timerange | |||
|
60 | else: | |||
|
61 | txmin = numpy.min(x) | |||
|
62 | ||||
58 | thisdatetime = datetime.datetime.utcfromtimestamp(numpy.min(x)) |
|
63 | thisdatetime = datetime.datetime.utcfromtimestamp(numpy.min(x)) | |
59 | thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0)) |
|
64 | thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0)) | |
60 |
|
65 | |||
61 | #################################################### |
|
66 | #################################################### | |
62 | #If the x is out of xrange |
|
67 | #If the x is out of xrange | |
63 | if xmax < (thisdatetime - thisdate).seconds/(60*60.): |
|
68 | if xmax != None: | |
64 | xmin = None |
|
69 | if xmax < (thisdatetime - thisdate).seconds/(60*60.): | |
65 |
|
|
70 | xmin = None | |
|
71 | xmax = None | |||
66 |
|
72 | |||
67 | if xmin == None: |
|
73 | if xmin == None: | |
68 | td = thisdatetime - thisdate |
|
74 | td = thisdatetime - thisdate |
General Comments 0
You need to be logged in to leave comments.
Login now