fix Dockerfile, cython: print_table to print all channels in single table
This commit is contained in:
@@ -16,3 +16,4 @@ cdef extern from "imc_raw.hpp" namespace "imc":
|
||||
vector[string] get_channels(bool json, bool data) except +
|
||||
# print all channels
|
||||
void print_channels(string outputdir) except +
|
||||
void print_table(string outputfile) except +
|
||||
|
@@ -24,6 +24,18 @@ cdef class imctermite:
|
||||
chnlstjn = [jn.loads(chn.decode()) for chn in chnlst]
|
||||
return chnlstjn
|
||||
|
||||
# print a channels
|
||||
# print channels
|
||||
def print_channels(self, string outputdir):
|
||||
self.cpp_imc.print_channels(outputdir)
|
||||
|
||||
# print table including channels
|
||||
def print_table(self, string outputfile):
|
||||
chnlst = self.cpp_imc.get_channels(True,True)
|
||||
chnlstjn = [jn.loads(chn.decode()) for chn in chnlst]
|
||||
with open(outputfile,'w') as fout:
|
||||
for chn in chnlstjn:
|
||||
fout.write(str(chn['yname']).rjust(20)+str(chn['xname']).rjust(20)+'\n')
|
||||
fout.write(str(chn['yunit']).rjust(20)+str(chn['xunit']).rjust(20)+'\n')
|
||||
for n in range(0,len(chn['ydata'])):
|
||||
fout.write(str(chn['ydata'][n]).rjust(20)+
|
||||
str(chn['ydata'][n]).rjust(20)+'\n')
|
||||
|
Reference in New Issue
Block a user