def checkOAfile(afile, verbose=0): """ Return pointer to array file Automatically check for compressed array files """ af = oapackage.arrayfile_t(afile, verbose) nm = af.filename if af.isopen(): return nm else: return None
def checkOAfile(afile, verbose=0): """ Return pointer to array file Automatically check for compressed array files Args: afile (str): location of array file Returns: arrayfile_t or None """ af = oapackage.arrayfile_t(afile, verbose) nm = af.filename if af.isopen(): return nm else: return None
def oaIsBinary(afile): """ Return true if array file is in binary format """ af = oapackage.arrayfile_t(afile) ret = af.isbinary() af.closefile() return ret
def oainfo(afile, verbose=1): """ Print information about a file containing arrays """ af = oapackage.arrayfile_t(afile, verbose) print(af.showstr()) af.closefile()
def oaIsBinary(filename): """ Return true if array file is in binary format """ af = oapackage.arrayfile_t(filename) ret = af.isbinary() af.closefile() return ret
def oainfo(filename, verbose=1): """ Print information about a file containing arrays """ af = oapackage.arrayfile_t(filename, verbose) print(af.showstr()) af.closefile()
oaformat=args.format inputfile=args.inputfile outputfile=args.outputfile #%% if __name__=='__main__' and 0: # testing inputfile='/home/eendebakpt/tmp/mee3.oa' outputfile='/home/eendebakpt/tmp/test.oa' fname='eoc' oaformat='T' verbose=2 #%% Load file fmode=oapackage.arrayfile_t.parseModeString(oaformat) infile = oapackage.arrayfile_t(inputfile) narrays=infile.narrays #outfile = oapackage.arrayfile_t(outputfile, infile.nrows, infile.ncols, -1, fmode ) if not infile.isopen(): raise Exception('could not open file %s' % inputfile) print('oaselect: reading %d arrays from %s' % (infile.narrays, inputfile) ) #%% Loop over the arrays outlist=[] if narrays==-1: narrays=oapackage.arrayfile_t.NARRAYS_MAX for ii in range(narrays): oapackage.tprint('oaselect: parse array %d/%d' % (ii, narrays) )