comparison sitesurvey.py @ 43:7ba7207df078

Manually range check, older scipy's don't have bound_error.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 28 Sep 2011 17:14:30 +0930
parents 184ea77c10e7
children 91b476ebc0f2
comparison
equal deleted inserted replaced
42:184ea77c10e7 43:7ba7207df078
86 86
87 self.calfreqs = freqs 87 self.calfreqs = freqs
88 self.calgains = gains 88 self.calgains = gains
89 89
90 # Create interpolation function 90 # Create interpolation function
91 self.interp = scipy.interpolate.interp1d(self.calfreqs, self.calgains, bound_error = True) 91 self._interp = scipy.interpolate.interp1d(self.calfreqs, self.calgains)
92 92
93 def interp(self, freqs):
94 if numpy.any(freqs < self.calfreqs[0]) or numpy.any(freqs > self.calfreqs[-1]):
95 raise exceptions.SyntaxError("Frequency out of range of calibration %f - %f" % (calfreqs[0], calfreqs[-1]))
96 return self._interp(freqs)
97
93 def getexpt(sequence): 98 def getexpt(sequence):
94 '''Given a sequence return the experiment which should be run next and how long until it should start''' 99 '''Given a sequence return the experiment which should be run next and how long until it should start'''
95 100
96 now = datetime.datetime.utcnow() 101 now = datetime.datetime.utcnow()
97 #print "now is " + str(now) 102 #print "now is " + str(now)