Commit c2f572f0 authored by marc's avatar marc
Browse files

include centralFrequency in start meas

parent 2493b139
......@@ -15,60 +15,62 @@ class Measurements():
Initializes a measurement instance.
self._tool = None
self._tools = []
self._integrationTime = 2
self._outputFile = None
self._radec = None
self._startTime = time.strftime("%Y%m%d-%h%m%s")
self.tool = None = []
self.integrationTime = 2
self.centralFrequency = 1420
self.outputFile = None
self.radec = None
self.startTime = time.strftime("%Y%m%d-%h%m%s")
Read keys measurement tools from ini file. Value contains the absolute path to the tools.
for key in config['Tools']:
def getTools(self):
read the list of tools to output measurements
''''List of measurements tools: {}'.format(self._tools))
return(self._tools)'List of measurements tools: {}'.format(
def getIntegrationTime(self):
read the integration time
''''Integration time is set to: {}'.format(self._integrationTime))
return(self._integrationTime)'Integration time is set to: {}'.format(self.integrationTime))
def startMeasurement(self, tool, integrationTime, outputFile):
def startMeasurement(self, tool, centralFrequency, integrationTime, outputFile):
Define the required tool to perform the measurement
self._tool = config["Tools"][tool]
self._integrationTime = integrationTime
self._outputFile = outputFile'Used measurement tool set to: {}'.format(self._tool))'Integration time set to: {}'.format(self._integrationTime))'Output file is: {}'.format(
self.tool = config["Tools"][tool]
self.centralFrequency = centralFrequency
self.integrationTime = integrationTime
self.outputFile = outputFile'Used measurement tool set to: {}'.format(self.tool))'Central Frequency set to: {}'.format(self.centralFrequency))'Integration time set to: {}'.format(self.integrationTime))'Output file is: {}'.format(
Compile CLI and execute command
measCLI = self._tool +" "+ str(self._integrationTime)'Excute CLI: {}'.format(measCLI))'Excute CLI: {} {}'.format(self.tool,self.integrationTime))
Note: in the stub dumpwide I added /bin/bash, otherwise you get an Exec format error.
self.measurement = subprocess.Popen(self._tool,self._integrationTime, stdout=subprocess.PIPE)
#self.measurement = subprocess.Popen(self.tool, self.centralFrequency, self.integrationTime, stdout=subprocess.PIPE)
self.measurement = subprocess.Popen(self.tool +" "+ str(self.centralFrequency) +" "+ str(self.integrationTime), shell=True, stdout=subprocess.PIPE)
measResults = self.measurement.stdout
""" Write results into file"""
for line in measResults:
self.outputFile.write(line.decode('utf-8'))'Result written to file: {}'.format('Result written to file: {}'.format(
if __name__ == '__main__':
myMeas = Measurements()
......@@ -78,5 +80,5 @@ if __name__ == '__main__':
for tool in myMeas.getTools():'Defined tools in ini file are: {}'.format(tool))
myMeas.startMeasurement('dumpwide', 120, measFile)
myMeas.startMeasurement('dumpwide', 1420, 120, measFile)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment