data reading interface not clear yet, major changes have to be done to the data structure and the data reading part of PyLoT (DataStructure superclass is needed providing generalized methods to use by the Data object)

This commit is contained in:
Sebastian Wehling-Benatelli 2015-05-04 05:31:10 +02:00
parent 367610d032
commit 15bdc47f84

View File

@ -36,26 +36,34 @@ def autoPyLoT(fnames, inputfile):
data = Data() data = Data()
cfP = METHOD[parameter.getParam('algoP')]() meth = parameter.getParam('algoP')
tsnr1 = parameter.getParam('tsnr1')
tsnr2 = parameter.getParam('tsnr2')
tnoise = parameter.getParam('pnoiselen')
tsignal = parameter.getParam('tlim')
order = parameter.getParam('hosorder')
thosmw = parameter.getParam('tlta')
if parameter.hasParam('datastructure'): if parameter.hasParam('datastructure'):
datastructure = DATASTRUCTURE[parameter.getParam('datastructure')]() datastructure = DATASTRUCTURE[parameter.getParam('datastructure')]()
dsfields = {'root':parameter.getParam('rootpath')} #see TODO: in data.py
datastructure.modifyFields(dsfields)
dsfields = {'root':parameter.rootpath} #see TODO: in data.py def expandSDS(datastructure):
return datastructure.expandDataPath()
datastructure.modifyFields(dsfields) def expandPDS(datastructure):
return os.path.join(datastructure.expandDataPath(),'*')
def expandSDS(datastructure): dsem = {'PDS':expandPDS, 'SDS':expandSDS}
return datastructure.expandDataPath()
def expandPDS(datastructure): expandMethod = dsem[datastructure.getName()]
return os.path.join(datastructure.expandDataPath(),'*')
dsem = {'PDS':expandPDS, 'SDS':expandSDS}
expandMethod = dsem[datastructure.getName()]
data.setWFData(expandMethod())
else:
data.setWFData()
cfP = METHOD[meth](data.getWFData(), (tnoise, tsignal), thosmw, order)
if __name__ == "__main__": if __name__ == "__main__":
# parse arguments # parse arguments
@ -70,8 +78,8 @@ if __name__ == "__main__":
action='store', action='store',
help='''full path to the file containing the input help='''full path to the file containing the input
parameters for autoPyLoT''', parameters for autoPyLoT''',
default=os.path.join([os.path.expanduser('~'), default=os.path.join(os.path.expanduser('~'), '.pylot',
'autoPyLoT.in']) 'autoPyLoT.in')
) )
parser.add_argument('-v', '-V', '--version', action='version', parser.add_argument('-v', '-V', '--version', action='version',
version='autoPyLoT ' + __version__, version='autoPyLoT ' + __version__,
@ -79,4 +87,4 @@ if __name__ == "__main__":
cla = parser.parse_args() cla = parser.parse_args()
autoPyLoT(cla.data, cla.input) autoPyLoT(cla.data, str(cla.inputfile))