Commit 536254a0 authored by marc's avatar marc

rearranged metadata

parent e7290161
Pipeline #15 failed with stages
from __future__ import print_function from .metadata import MetaData
import logging \ No newline at end of file
import os.path
from configparser import ConfigParser
import time
config = ConfigParser()
config.readfp(open(os.path.join(os.path.dirname(__file__), 'metadata.ini')))
logging.basicConfig(level=logging.DEBUG)
'''
Metadata Class
'''
class MetaData():
def __init__(self):
'''
Generic Data
'''
logging.info('Initialize MetaData')
self.description = ''
self.operator1 =''
self.operator2 =''
self.operator3 =''
self.startTime = time.strftime("%Y%m%d-%h%m%s")
'''
Tool settings
'''
self.tool = 'dumpwide'
self.integrationTime = 2
self.centralFrequency = 1420
self.outputDirectory ='/tmp/Obs/'
self.outputFile = 'DT-20171031.dat'
'''
Pointing
'''
self.guidingMode = 'Tracking'
self.radecSetpoint = None
self.radecActual = None
'''
DT Settings
'''
self.refractionEnabled = 'False'
self.DTModelEnabled = 'False'
'''
Backend Settings
'''
self.mode = 'Pulsar'
self.LSREnabled = 'False'
def __str__(self):
return
def getMetaData(self):
metaData =[
('description' , self.description),
('startTime' , self.startTime),
('operator1' , self.operator1),
('operator2' , self.operator2),
('operator3' , self.operator3),
('tool' , self.tool),
('integrationTime' , self.integrationTime),
('centralFrequency', self.centralFrequency),
('outputDir' , self.outputDirectory),
('outputFile' , self.outputFile),
('guidingMode' , self.guidingMode),
('setpointRaDEC' , self.radecSetpoint),
('actualRaDEC' , self.radecActual),
('refactionEnabled', self.refractionEnabled),
('DTModelEnabled' , self.DTModelEnabled),
('backEndMode' , self.mode),
('LSREnabled' , self.LSREnabled)
]
logging.info('Return Meta data from MetaData class')
return metaData
if __name__ == '__main__':
myData = MetaData()
myData.operator1 = 'Ops01'
myData.operator3 = 'Ops03'
myData.refractionEnabled = True
myData.LSREnabled = True
logging.info(myData.operator3)
logging.info(myData.startTime)
logging.info(myData.tool)
myMetaData = myData.getMetaData()
for data in myMetaData:
logging.info('#{:20}: {:40}'.format(data[0],str(data[1])))
'''
for k, v in myData.getMetaData().items():
logging.info('#key: {}\t value: {}'.format(k,v))
'''
from __future__ import print_function
import logging
import os.path
from configparser import ConfigParser
import time
config = ConfigParser()
config.readfp(open(os.path.join(os.path.dirname(__file__), 'metadata.ini')))
logging.basicConfig(level=logging.DEBUG)
'''
Metadata Class
'''
class MetaData():
def __init__(self):
'''
Generic Data
'''
logging.info('Initialize MetaData')
self.description = ''
self.operator1 =''
self.operator2 =''
self.operator3 =''
self.startTime = time.strftime("%Y%m%d-%h%m%s")
'''
Tool settings
'''
self.tool = 'dumpwide'
self.integrationTime = 2
self.centralFrequency = 1420
self.outputDirectory ='/tmp/Obs/'
self.outputFile = 'DT-20171031.dat'
'''
Pointing
'''
self.guidingMode = 'Tracking'
self.radecSetpoint = None
self.radecActual = None
'''
DT Settings
'''
self.refractionEnabled = 'False'
self.DTModelEnabled = 'False'
'''
Backend Settings
'''
self.mode = 'Pulsar'
self.LSREnabled = 'False'
def __str__(self):
return
def getMetaData(self):
metaData =[
('description' , self.description),
('startTime' , self.startTime),
('operator1' , self.operator1),
('operator2' , self.operator2),
('operator3' , self.operator3),
('tool' , self.tool),
('integrationTime' , self.integrationTime),
('centralFrequency', self.centralFrequency),
('outputDir' , self.outputDirectory),
('outputFile' , self.outputFile),
('guidingMode' , self.guidingMode),
('setpointRaDEC' , self.radecSetpoint),
('actualRaDEC' , self.radecActual),
('refactionEnabled', self.refractionEnabled),
('DTModelEnabled' , self.DTModelEnabled),
('backEndMode' , self.mode),
('LSREnabled' , self.LSREnabled)
]
logging.info('Return Meta data from MetaData class')
return metaData
if __name__ == '__main__':
myData = MetaData()
myData.operator1 = 'Ops01'
myData.operator3 = 'Ops03'
myData.refractionEnabled = True
myData.LSREnabled = True
logging.info(myData.operator3)
logging.info(myData.startTime)
logging.info(myData.tool)
myMetaData = myData.getMetaData()
for data in myMetaData:
logging.info('#{:20}: {:40}'.format(data[0],str(data[1])))
'''
for k, v in myData.getMetaData().items():
logging.info('#key: {}\t value: {}'.format(k,v))
'''
\ No newline at end of file
Markdown is supported
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