Package diffpy :: Package srrietveld :: Package convert :: Module datafile :: Class DataFile
[frames] | no frames]

Class DataFile

source code

The data file class

Instance Methods
 
__init__(self, filepath=None, engine=None, xobs=None, yobs=None, ysig=None, rootname=None)
Constructor, the DataFile can be initiated either from a file path or arrays of data filepath - the filepath of the data file engine - the engine type xobs, yobs, ysig - the data arrays to initialize the data file rootname - the rootname of the file when constructed from x/y data arrays.
source code
 
__str__(self)
String conversion
source code
 
dump(self, directory, basename=None)
dump the file to the directory dir: the directory to dump the file rootname: the new file name, if not none will replace self.filename return the file path where the file dumped
source code
 
prepDataFile(self, newDir, instrumentFile=None, filename=None)
Prepare the data file for different engines, and dump the prepared file to a path.
source code
 
write(self, filepath)
Write to filepath
source code
Method Details

__init__(self, filepath=None, engine=None, xobs=None, yobs=None, ysig=None, rootname=None)
(Constructor)

source code 
Constructor, the DataFile can be initiated either from a file path 
or arrays of data
filepath - the filepath of the data file
engine - the engine type
xobs, yobs, ysig - the data arrays to initialize the data file
rootname - the rootname of the file when constructed from x/y data arrays. 
    NOTE: the extension name is always dat in this case

prepDataFile(self, newDir, instrumentFile=None, filename=None)

source code 

Prepare the data file for different engines, and dump the prepared file to a path. If conversion is not needed, the origianl file will be dumped new directory - the path to dump the file engine - the engine rootName - the file name if different from that saved in the object return the path to the prepared data file