Take into account parameter extent when writing header for PyLoT-input file.

This commit is contained in:
Ludger Küperkoch 2017-06-23 11:32:08 +02:00
parent 5958e05f3b
commit 27597e6b4b
2 changed files with 11 additions and 12 deletions

View File

@ -1 +1 @@
33d8-dirty 5958-dirty

View File

@ -221,24 +221,23 @@ class PylotParameter(object):
# for key, value in self.iteritems(): # for key, value in self.iteritems():
# lines.append('{key}\t{value}\n'.format(key=key, value=value)) # lines.append('{key}\t{value}\n'.format(key=key, value=value))
# fid_out.writelines(lines) # fid_out.writelines(lines)
header = ('%This is a parameter input file for PyLoT/autoPyLoT.\n'+ header = ('%This is a parameter input file for PyLoT/autoPyLoT.\n'+
'%All main and special settings regarding data handling\n'+ '%All main and special settings regarding data handling\n'+
'%and picking are to be set here!\n'+ '%and picking are to be set here!\n'+
'%Parameters are optimized for local data sets!\n') '%Parameters are optimized for %{} data sets!\n'.format(self.get_main_para_names()['pick'][0]))
seperator = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n' separator = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n'
fid_out.write(header) fid_out.write(header)
self.write_section(fid_out, self.get_main_para_names()['dirs'], self.write_section(fid_out, self.get_main_para_names()['dirs'],
'main settings', seperator) 'main settings', separator)
self.write_section(fid_out, self.get_main_para_names()['nlloc'], self.write_section(fid_out, self.get_main_para_names()['nlloc'],
'NLLoc settings', seperator) 'NLLoc settings', separator)
self.write_section(fid_out, self.get_main_para_names()['smoment'], self.write_section(fid_out, self.get_main_para_names()['smoment'],
'parameters for seismic moment estimation', seperator) 'parameters for seismic moment estimation', separator)
self.write_section(fid_out, self.get_main_para_names()['localmag'], self.write_section(fid_out, self.get_main_para_names()['localmag'],
'settings local magnitude', seperator) 'settings local magnitude', separator)
self.write_section(fid_out, self.get_main_para_names()['pick'], self.write_section(fid_out, self.get_main_para_names()['pick'],
'common settings picker', seperator) 'common settings picker', separator)
fid_out.write(('#special settings for calculating CF#\n'+ fid_out.write(('#special settings for calculating CF#\n'+
'%!!Edit the following only if you know what you are doing!!%\n')) '%!!Edit the following only if you know what you are doing!!%\n'))
self.write_section(fid_out, self.get_special_para_names()['z'], self.write_section(fid_out, self.get_special_para_names()['z'],
@ -250,9 +249,9 @@ class PylotParameter(object):
self.write_section(fid_out, self.get_special_para_names()['quality'], self.write_section(fid_out, self.get_special_para_names()['quality'],
'quality assessment', None) 'quality assessment', None)
def write_section(self, fid, names, title, seperator): def write_section(self, fid, names, title, separator):
if seperator: if separator:
fid.write(seperator) fid.write(separator)
fid.write('#{}#\n'.format(title)) fid.write('#{}#\n'.format(title))
l_val = 50 l_val = 50
l_name = 15 l_name = 15