#include <StreamerBase.h>
|
string | getOutFilepath () const |
|
StreamerBase & | operator= (const StreamerBase &st) |
|
void | setOutFilepath (string stream) |
|
| StreamerBase () |
|
| ~StreamerBase () |
|
void | clearVec () |
|
void | compareVec (vector< double > other, string op) |
|
void | compareXplot (string fname, string plotname, string op) |
|
const vector< double > & | data () |
|
double | getOutputValue () const |
|
string | getPlotDump () const |
|
vector< double > | getVec () const |
|
unsigned int | getVecSize () const |
|
double | getY (unsigned int index) const |
|
double | interpolate (double x, double xmin, double xmax) const |
|
void | linearTransform (double scale, double offset) |
|
void | loadCSV (string fname, int startLine, int colNum, char separator) |
|
void | loadXplot (string fname, string plotname) |
|
void | loadXplotRange (string fname, string plotname, unsigned int start, unsigned int end) |
|
double * | lookupVec (unsigned int index) |
|
void | plainPlot (string file) |
|
void | setOutputValue (double val) |
|
void | setPlotDump (string v) |
|
void | setVec (vector< double > val) |
|
void | setVecSize (unsigned int num) |
|
| TableBase () |
|
void | xplot (string file, string plotname) |
|
|
static void | writeToCSVFile (const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns) |
| Write data to csv file. See the documentation of writeToOutfile for details. More...
|
|
static void | writeToNPYFile (const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns) |
| Write to NPY format. See the documentation of writeToOutfile for more details. More...
|
|
static void | writeToOutFile (const string &filepath, const string &format, const string &openmode, const vector< double > &data, const vector< string > &columns) |
| Write to a output file in given format. More...
|
|
static const Cinfo * | initCinfo () |
|
|
vector< double > & | vec () |
|
Definition at line 31 of file StreamerBase.h.
StreamerBase::StreamerBase |
( |
| ) |
|
StreamerBase::~StreamerBase |
( |
| ) |
|
string StreamerBase::getOutFilepath |
( |
void |
| ) |
const |
void StreamerBase::setOutFilepath |
( |
string |
stream | ) |
|
void StreamerBase::writeToCSVFile |
( |
const string & |
filepath, |
|
|
const string & |
openmode, |
|
|
const vector< double > & |
data, |
|
|
const vector< string > & |
columns |
|
) |
| |
|
static |
Write data to csv file. See the documentation of writeToOutfile for details.
Definition at line 83 of file StreamerBase.cpp.
References delimiter_, eol, LOG, moose::toString(), and moose::warning.
Referenced by writeToOutFile().
87 FILE* fp = fopen( filepath.c_str(), openmode.c_str() );
97 string headerText =
"";
98 for( vector<string>::const_iterator it = columns.begin();
99 it != columns.end(); it++ )
102 fprintf( fp,
"%s", headerText.c_str() );
106 for(
size_t i = 0; i < data.size(); i+=columns.size() )
109 for(
size_t ii = 0; ii < columns.size(); ii++ )
113 *(text.end()-1) =
eol;
115 fprintf( fp,
"%s", text.c_str() );
string toString(double x)
Convert a given value to string.
#define LOG(t, a)
This macro only expands when not compiling for release.
static const char delimiter_
void StreamerBase::writeToNPYFile |
( |
const string & |
filepath, |
|
|
const string & |
openmode, |
|
|
const vector< double > & |
data, |
|
|
const vector< string > & |
columns |
|
) |
| |
|
static |
Write to NPY format. See the documentation of writeToOutfile for more details.
Definition at line 120 of file StreamerBase.cpp.
References TableBase::data().
Referenced by writeToOutFile().
123 cnpy2::save_numpy<double>( filepath,
data, columns, openmode );
const vector< double > & data()
void StreamerBase::writeToOutFile |
( |
const string & |
filepath, |
|
|
const string & |
format, |
|
|
const string & |
openmode, |
|
|
const vector< double > & |
data, |
|
|
const vector< string > & |
columns |
|
) |
| |
|
static |
Write to a output file in given format.
- Parameters
-
filepath,path | of output file. If parent directories do not exist, they will be created. If creation fails for some reason, data will be saved in current working directory. The name of the file will be computed from the given directory name by replacing '/' or '\' by '_'. |
format | npy : numpy binary format (version 1 and 2), version 1 is default. csv or dat: comma separated value (delimiter ' ' ) |
openmode | (write or append) |
data,vector | of values |
ncols | (number of columns). Incoming data will be formatted into a matrix with ncols. |
Definition at line 58 of file StreamerBase.cpp.
References LOG, moose::warning, writeToCSVFile(), and writeToNPYFile().
Referenced by Streamer::cleanUp(), Table::process(), Streamer::process(), Table::reinit(), Streamer::reinit(), and Table::~Table().
65 if( data.size() == 0 )
68 if(
"npy" == outputFormat )
70 else if(
"csv" == outputFormat or
"dat" == outputFormat )
75 <<
". Use npy or csv. Falling back to default csv"
static void writeToNPYFile(const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns)
Write to NPY format. See the documentation of writeToOutfile for more details.
#define LOG(t, a)
This macro only expands when not compiling for release.
static void writeToCSVFile(const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns)
Write data to csv file. See the documentation of writeToOutfile for details.
const char StreamerBase::delimiter_ = ' ' |
|
staticprivate |
const char StreamerBase::eol = '\n' |
|
staticprivate |
string StreamerBase::outfilePath_ |
|
private |
The documentation for this class was generated from the following files: