Filters
C++ SDK API Documentation - Filters
-
class AsciiFilter : public AbstractFileFilter
Public Functions
-
virtual void write(const QString &fileName, AbstractDataSource*) override
write
Writing the content of the datasource to the file with filename
fileName
- Parameters:
fileName –
Public Static Functions
-
static QStringList separatorCharacters()
returns the list of all predefined separator characters.
-
static QStringList commentCharacters()
returns the list of all predefined comment characters.
-
static size_t lineCount(const QString &fileName, size_t maxLines = std::numeric_limits<std::size_t>::max())
returns number of lines in file ‘fileName’ optional: only check ‘maxLines’ (returns minimum of line count and maxLines)
-
struct Properties
-
virtual void write(const QString &fileName, AbstractDataSource*) override
-
class BinaryFilter : public AbstractFileFilter
Manages the import/export of data organized as columns (vectors) from/to a binary file.
Public Functions
-
void readDataFromDevice(QIODevice&, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace, int lines = -1)
reads the content of the device
device
.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource*, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
Public Static Functions
-
static QStringList dataTypes()
returns the list of all predefined data formats.
-
static int dataSize(BinaryFilter::DataType)
returns the size of the predefined data types
-
static size_t rowNumber(const QString &fileName, size_t vectors, BinaryFilter::DataType, size_t maxRows = std::numeric_limits<std::size_t>::max())
returns the number of rows (length of vectors) in the file
fileName
.
-
void readDataFromDevice(QIODevice&, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace, int lines = -1)
-
class FITSFilter : public AbstractFileFilter
Manages the import/export of data from/to a FITS file.
- Since
2.2.0
Public Functions
-
virtual void write(const QString &fileName, AbstractDataSource*) override
write
Writing the content of the datasource to the file with filename
fileName
- Parameters:
fileName –
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
void setStartRow(const int)
Sets the startRow to row.
- Parameters:
row – the row to be set
-
int startRow() const
Returns startRow.
- Returns:
The startRow
-
void setEndRow(const int)
Sets the endRow to row.
- Parameters:
row – the row to be set
-
int endRow() const
Returns endRow.
- Returns:
The endRow
-
void setStartColumn(const int)
Sets the startColumn to column.
- Parameters:
column – the column to be set
-
int startColumn() const
Returns startColumn.
- Returns:
The startColumn
-
void setEndColumn(const int)
Sets the endColumn to column.
- Parameters:
column – the column to be set
-
int endColumn() const
Returns endColumn.
- Returns:
The endColumn
-
void setCommentsAsUnits(const bool)
Sets commentsAsUnits to commentsAsUnits.
This is used when spreadsheets are exported to FITS table extensions and comments are used as the units of the table’s columns.
- Parameters:
commentsAsUnits –
-
void setExportTo(const int)
Sets exportTo to exportTo.
This is used to decide whether the container should be exported to a FITS image or a FITS table For an image exportTo should be 0, for a table 1
- Parameters:
exportTo –
Public Static Functions
-
static QStringList standardKeywords()
contains the {StandardKeywords \ MandatoryKeywords} keywords
- Returns:
A list of keywords
-
static QStringList mandatoryImageExtensionKeywords()
Returns a list of keywords, that are mandatory for an image extension of a FITS file see: https://archive.stsci.edu/fits/fits_standard/node64.html.
- Returns:
A list of keywords
-
static QStringList mandatoryTableExtensionKeywords()
Returns a list of keywords, that are mandatory for a table extension (ascii or bintable) of a FITS file see: https://archive.stsci.edu/fits/fits_standard/node58.html https://archive.stsci.edu/fits/fits_standard/node68.html.
- Returns:
A list of keywords
-
static QStringList units()
Returns a list of strings that represent units which are used for autocompletion when adding keyword units to keywords.
- Returns:
A list of strings that represent units
-
struct Keyword
-
struct KeywordUpdate
-
class HDF5Filter : public AbstractFileFilter
Manages the import/export of data from/to a HDF5 file.
Public Functions
-
int parse(const QString &fileName, QTreeWidgetItem *rootItem)
parses the content of the file
fileName
.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
to the data sourcedataSource
.
-
QVector<QStringList> readCurrentDataSet(const QString &fileName, AbstractDataSource*, bool &ok, ImportMode = ImportMode::Replace, int lines = -1)
reads the content of the data set
dataSet
from filefileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
Public Static Functions
-
static QString fileDDLString(const QString&)
Get file content in DDL (Data Description Language) format uses “h5dump”
-
int parse(const QString &fileName, QTreeWidgetItem *rootItem)
-
class ImageFilter : public AbstractFileFilter
Manages the import/export of data from/to an image file.
Public Functions
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
to the data sourcedataSource
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
Public Static Functions
-
static QStringList importFormats()
returns the list of all predefined import formats.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
-
class JsonFilter : public AbstractFileFilter
Manages the import/export of data from/to a file formatted using JSON.
Public Functions
-
void readDataFromDevice(QIODevice &device, AbstractDataSource*, ImportMode = ImportMode::Replace, int lines = -1)
reads the content of the device
device
.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
void readDataFromDevice(QIODevice &device, AbstractDataSource*, ImportMode = ImportMode::Replace, int lines = -1)
-
class MatioFilter : public AbstractFileFilter
Manages the import/export of data from/to a Matio file.
Public Functions
-
void parse(const QString &fileName)
parses the content of the file
ileName
.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
to the data sourcedataSource
.
-
QVector<QStringList> readCurrentVar(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace, int lines = -1)
reads the content of the current variable from file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
void parse(const QString &fileName)
-
class McapFilter : public AbstractFileFilter
ManagesreadDataFromFile the import/export of data from/to a file formatted using JSON.
Public Functions
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, AbstractFileFilter::ImportMode = AbstractFileFilter::ImportMode::Replace) override
reads the content of the file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, AbstractFileFilter::ImportMode = AbstractFileFilter::ImportMode::Replace) override
-
class NetCDFFilter : public AbstractFileFilter
Manages the import/export of data from/to a NetCDF file.
Public Functions
-
void parse(const QString &fileName, QTreeWidgetItem *rootItem)
parses the content of the file
ileName
.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
to the data sourcedataSource
.
-
QString readAttribute(const QString &fileName, const QString &name, const QString &varName)
reads the content of the selected attribute from file
fileName
.
-
QVector<QStringList> readCurrentVar(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace, int lines = -1)
reads the content of the current variable from file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
Public Static Functions
-
static QString fileCDLString(const QString&)
Get file content in CDL (Common Data form Language) format uses “ncdump”
-
void parse(const QString &fileName, QTreeWidgetItem *rootItem)
-
class OdsFilter : public AbstractFileFilter
Public Functions
-
virtual void write(const QString &fileName, AbstractDataSource*) override
write
Writing the content of the datasource to the file with filename
fileName
- Parameters:
fileName –
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
void setStartRow(int)
Sets the startRow to row.
- Parameters:
row – the row to be set
-
int startRow() const
Returns startRow.
- Returns:
The startRow
-
void setEndRow(int)
Sets the endRow to row.
- Parameters:
row – the row to be set
-
int endRow() const
Returns endRow.
- Returns:
The endRow
-
void setStartColumn(int)
Sets the startColumn to column.
- Parameters:
column – the column to be set
-
int startColumn() const
Returns startColumn.
- Returns:
The startColumn
-
void setEndColumn(int)
Sets the endColumn to column.
- Parameters:
column – the column to be set
-
int endColumn() const
Returns endColumn.
- Returns:
The endColumn
-
virtual void write(const QString &fileName, AbstractDataSource*) override
-
class ROOTFilter : public AbstractFileFilter
Manages the importing of histograms from ROOT files.
Public Functions
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
Read data from the currently selected histogram.
The ROOT file is kept open until the file name is changed
-
virtual void write(const QString &fileName, AbstractDataSource*) override
Currently writing to ROOT files is not supported.
-
Directory listHistograms(const QString &fileName) const
List names of histograms contained in ROOT file.
-
QVector<QStringList> listLeaves(const QString &fileName, qint64 pos) const
List names of leaves contained in ROOT tree.
-
void setCurrentObject(const QString&)
Set the current histograms, which is one out of listHistograms.
-
const QString currentObject() const
Get the name of the currently set object.
-
QVector<QStringList> previewCurrentObject(const QString &fileName, int first, int last) const
Get preview data of the currently set object.
-
int rowsInCurrentObject(const QString &fileName) const
Get the number of rows in the current object.
-
void setStartRow(const int bin)
Set the last bin of the object to be read.
-1 skips the underflow bin of histograms
-
int startRow() const
Get the index of the first row to be read.
-
void setEndRow(const int bin)
Set the last row of the object to be read.
-1 skips the overflow bin of histograms
-
int endRow() const
Get the index of the last row to be read.
-
void setColumns(const QVector<QStringList> &columns)
Set the columns of the object to be read.
For histograms the following are available: center, low, content, error
-
QVector<QStringList> columns() const
Get the columns to be read.
For histograms, the identifiers for location, content and error are given as the first part, the corresponding translation as the second part. For trees, the branch name and the leaf name are returned.
- Returns:
A pair of strings with different content depending on the object type
-
virtual void save(QXmlStreamWriter*) const override
Save bin limitation settings.
-
virtual bool load(XmlStreamReader*) override
Load bin limitation settings.
-
struct Directory
Internal directory structure in a ROOT file.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
-
class ReadStatFilter : public AbstractFileFilter
Manages the import/export of data from/to a ReadStat file.
Public Functions
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
to the data sourcedataSource
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
-
class SpiceFilter : public AbstractFileFilter
Public Functions
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
reads the content of the file
fileName
.
-
virtual void write(const QString &fileName, AbstractDataSource*) override
writes the content of the data source
dataSource
to the filefileName
.
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
-
virtual void readDataFromFile(const QString &fileName, AbstractDataSource* = nullptr, ImportMode = ImportMode::Replace) override
-
class VectorBLFFilter : public CANFilter
Manages the import/export of data from/to a Vector BLF file.
Public Functions
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
virtual bool load(XmlStreamReader*) override
Loads from XML.
Public Static Functions
-
static QString fileInfoString(const QString&)
fileInfoString Information about the file content
- Returns:
-
virtual void save(QXmlStreamWriter*) const override
-
class XLSXFilter : public AbstractFileFilter
Public Functions
-
virtual void write(const QString &fileName, AbstractDataSource*) override
write
Writing the content of the datasource to the file with filename
fileName
- Parameters:
fileName –
-
virtual void save(QXmlStreamWriter*) const override
Saves as XML.
-
void setStartRow(const int)
Sets the startRow to row.
- Parameters:
row – the row to be set
-
int startRow() const
Returns startRow.
- Returns:
The startRow
-
void setEndRow(const int)
Sets the endRow to row.
- Parameters:
row – the row to be set
-
int endRow() const
Returns endRow.
- Returns:
The endRow
-
void setStartColumn(const int)
Sets the startColumn to column.
- Parameters:
column – the column to be set
-
int startColumn() const
Returns startColumn.
- Returns:
The startColumn
-
void setEndColumn(const int)
Sets the endColumn to column.
- Parameters:
column – the column to be set
-
int endColumn() const
Returns endColumn.
- Returns:
The endColumn
-
virtual void write(const QString &fileName, AbstractDataSource*) override