libatomprobe
Library for Atom Probe Tomography (APT) computation
Classes | Namespaces | Typedefs | Enumerations | Functions
dataFiles.cpp File Reference
#include "atomprobe/io/dataFiles.h"
#include "atomprobe/primitives/ionHit.h"
#include "atomprobe/helper/stringFuncs.h"
#include "atomprobe/helper/endianTest.h"
#include "atomprobe/helper/sampling.h"
#include "helper/helpFuncs.h"
#include "atomprobe/helper/aptAssert.h"
#include <vector>
#include <string>
#include <fstream>
#include <map>
#include <algorithm>
#include <sys/time.h>
Include dependency graph for dataFiles.cpp:

Go to the source code of this file.

Classes

struct  AtomProbe::IONHIT
 Record as stored in a .POS file. More...
 

Namespaces

 AtomProbe
 

Typedefs

typedef struct AtomProbe::IONHIT AtomProbe::IONHIT
 Record as stored in a .POS file. More...
 

Enumerations

enum  {
  AtomProbe::POS_ALLOC_FAIL =1, AtomProbe::POS_OPEN_FAIL, AtomProbe::POS_SIZE_MODULUS_ERR, AtomProbe::POS_SIZE_EMPTY_ERR,
  AtomProbe::POS_READ_FAIL, AtomProbe::POS_NAN_LOAD_ERROR, AtomProbe::POS_FILE_ENUM_END
}
 
enum  { AtomProbe::TAPSIM_FILE_FORMAT_FAIL =1, AtomProbe::TAPSIM_OPEN_FAIL }
 

Functions

template<class T >
unsigned int AtomProbe::fixedRecordReader (const char *filename, bool(*recordReader)(const char *bufRead, const char *destBuf), size_t recordSize, std::vector< T > &outputData)
 
template<class T >
unsigned int AtomProbe::fixedRecordChunkReader (const char *filename, bool(*recordReader)(const char *bufRead, const char *destBuf), size_t recordSize, std::vector< T > &outputData, unsigned int chunkSize, unsigned int chunkOffset, unsigned int &nEntriesLeft)
 
const char * AtomProbe::getPosFileErrString (unsigned int errMesg)
 
unsigned int AtomProbe::loadPosFile (std::vector< IonHit > &posIons, const char *posFile)
 Load a pos file directly into a single ion list. More...
 
unsigned int AtomProbe::loadPosFile (std::vector< IonHit > &posIons, const char *posFile, unsigned int nSamplesMax)
 As per loadPosFile, but with an additional setting for the maximum number of ions to load. More...
 
unsigned int AtomProbe::savePosFile (const std::vector< IonHit > &data, const char *name, bool append=false)
 Save a vector of IonHits into a "pos" file, return nonzero on error. More...
 
unsigned int AtomProbe::savePosFile (const std::vector< Point3D > &points, float mass, const char *name, bool append=false)
 Save a vector of Point3Ds into a pos file, using a fixed mass, return nonzero on error. More...
 
unsigned int AtomProbe::loadTapsimBinFile (vector< IonHit > &posIons, const char *posfile)
 
unsigned int AtomProbe::saveTapsimBin (const std::vector< IonHit > &posIons, std::ostream &f)
 Write a tapsim file from a vector of IonHits. More...
 
unsigned int AtomProbe::saveTapsimBin (const std::vector< IonHit > &posIons, const char *filename)
 Write a tapsim file from a vector of ionHits. More...
 
bool AtomProbe::readEposRecord (const char *src, const char *dest)
 
size_t AtomProbe::loadEposFile (std::vector< EPOS_ENTRY > &outData, const char *filename)
 Load an entire "EPOS" File. More...
 
size_t AtomProbe::chunkLoadEposFile (std::vector< EPOS_ENTRY > &outData, const char *filename, unsigned int chunkSize, unsigned int chunkOffset, unsigned int &nEntriesLeft)
 Load an "EPOS" file, with a maximum chunk size. More...
 
unsigned int AtomProbe::readPosapOps (const char *file, THREEDAP_EXPERIMENT &data, unsigned int &badLine, unsigned int &progress, std::atomic< bool > &wantAbort, unsigned int nDelayLines=2, bool strictMode=false)
 Function to read POSAP "OPS" files. More...
 
unsigned int AtomProbe::loadATOFile (const char *fileName, std::vector< ATO_ENTRY > &ions, unsigned int forceEndian=0)
 Load a LAWATAP "ATO" file. More...
 
bool AtomProbe::strhas (const char *cpTest, const char *cpPossible)
 
unsigned int AtomProbe::loadTextData (const char *cpFilename, std::vector< std::vector< float > > &dataVec, std::vector< std::string > &headerVec, const char *delim="\", bool allowNan=true, bool allowConvFails=false, unsigned int headerCount=-1)
 Load a CSV, TSV or similar text file. Assumes "C" Locale for input (ie "." as decimal separator). More...