ICP  1
Macros | Functions | Variables
nexuswriter.cpp File Reference
#include "stdafx.h"
#include "isiscrpt.h"
#include "isisraw.h"
#include "nexuswriter.h"
#include "icputils.h"
#include "selogger.h"
#include "NeXusEventWriter.h"

Go to the source code of this file.

Macros

#define MIN_COMP_LEN   25
 

Functions

static int * makeNewRawData (const isisU32_t *raw_data, int nper_daq, int nsp1, int ntc1)
 only used by muons and hence OK for it only to work for one TR More...
 
static char * remove_invalid_chars (const char *str, int len)
 
template<typename T >
static const T * nullValue (const T *, int NXTYPE)
 
template<typename T , int NXTYPE>
static int writeAttribute (NXhandle fileid, const char *data_name, const char *attr_name, const T *value, int len, bool convert_null)
 
template<typename T , int NXTYPE>
static int writeAttribute (NXhandle fileid, const char *data_name, const char *attr_name, T value, bool convert_null)
 
template<typename T , int NXTYPE>
static int writeData (NXhandle fileid, const char *data_name, const T *value, const int *dims_array, int ndims, bool convert_null, int compression_type)
 
template<typename T , int NXTYPE>
static int addSlab (NXhandle fileid, const T *value, const int64_t *dims_array, int ndims, const int64_t *slab_start, const int64_t *slab_size, const int64_t *dest_start, int compression_type)
 
template<typename T , int NXTYPE>
static int addSlab (NXhandle fileid, const T *value, const int *dims_array, int ndims, const int *slab_start, const int *slab_size, const int *dest_start, int compression_type)
 
template<typename T , int NXTYPE>
static int addSlab (NXhandle fileid, const char *data_name, const T *value, const int *dims_array, int ndims, const int *slab_start, const int *slab_size, const int *dest_start, int compression_type)
 
template<typename T , int NXTYPE>
static int writeSlab (NXhandle fileid, const char *data_name, const T *value, const int *dims_array, int ndims, const int *slab_start, const int *slab_size, bool convert_null, int compression_type)
 
template<int NXTYPE>
static int makeDataSlab (NXhandle fileid, const char *data_name, const int *dims_array, int ndims, int compression_type, int spectra_chunk)
 
template<typename T , int NXTYPE>
static int addSlabList (NXhandle fileid, const char *data_name, const T *value, const int *dims_array, int ndims, int dest_start[], const int *slab_start, const int *slab_size, const std::vector< int > &slab_list, bool convert_null, int compression_type, int spectra_chunk)
 
template<typename T , int NXTYPE>
static int writeSlabList (NXhandle fileid, const char *data_name, const T *value, const int *dims_array, int ndims, const int *slab_start, const int *slab_size, const std::vector< int > &slab_list, bool convert_null, int compression_type, int spectra_chunk)
 
template<typename T , int NXTYPE>
static int writeData (NXhandle fileid, const char *data_name, T value, bool convert_null, int compression_type)
 
template<typename T , int NXTYPE>
static int writeData (NXhandle fileid, const char *data_name, const T *value, int len, bool convert_null, int compression_type)
 
template<typename T , int NXTYPE>
static int writeData (NXhandle fileid, const char *data_name, const T *value, int dim1, int dim2, bool convert_null, int compression_type)
 
static int readDeadTimes (float *deadtimes_array, int ndet, const char *file)
 
static int readTZero (float &tzero, float &tzero_offset, const char *file)
 
static int readGrouping (int *grouping, int ndet, const char *file)
 
static void nxErrorFunc (void *arg, char *text)
 
static void computeDetectorAverage (const float *det_vals, float *spec_vals, const std::vector< int > *det_lookup, const std::vector< int > &spec_list)
 
static int addMonitors (IXNeXusFile &ixnf, const ISISCRPT_STRUCT *crpt, const isisU32_t *raw_data, isisU32_t raw_data_size, NXlink *tof_links, NXlink &period_link, bool update, DAEstatus &dstatus)
 
static int writeSummaryNeXus (const ISISCRPT_STRUCT *crpt, DAEstatus &dstatus)
 

Variables

const char * detector_base = "detector"
 
const char * detector_format = "detector_%d"
 

Macro Definition Documentation

#define MIN_COMP_LEN   25

minimum number of elements before compaction of a dataset

Definition at line 10 of file nexuswriter.cpp.

Referenced by IXNeXusFile::makeData(), makeDataSlab(), writeData(), and writeSlab().

Function Documentation

static int addMonitors ( IXNeXusFile ixnf,
const ISISCRPT_STRUCT crpt,
const isisU32_t raw_data,
isisU32_t  raw_data_size,
NXlink *  tof_links,
NXlink &  period_link,
bool  update,
DAEstatus dstatus 
)
static
template<typename T , int NXTYPE>
static int addSlab ( NXhandle  fileid,
const T *  value,
const int64_t *  dims_array,
int  ndims,
const int64_t *  slab_start,
const int64_t *  slab_size,
const int64_t *  dest_start,
int  compression_type 
)
static

Definition at line 168 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int addSlab ( NXhandle  fileid,
const T *  value,
const int *  dims_array,
int  ndims,
const int *  slab_start,
const int *  slab_size,
const int *  dest_start,
int  compression_type 
)
static

Definition at line 210 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int addSlab ( NXhandle  fileid,
const char *  data_name,
const T *  value,
const int *  dims_array,
int  ndims,
const int *  slab_start,
const int *  slab_size,
const int *  dest_start,
int  compression_type 
)
static

Definition at line 223 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int addSlabList ( NXhandle  fileid,
const char *  data_name,
const T *  value,
const int *  dims_array,
int  ndims,
int  dest_start[],
const int *  slab_start,
const int *  slab_size,
const std::vector< int > &  slab_list,
bool  convert_null,
int  compression_type,
int  spectra_chunk 
)
static

we want to write a portion of an array to the file the passed array "value" is of size (dims_array[ndims]) but we only want to write a slab of it only for ndims = 1 or 2 at moment slab_start and slab_size refer to the array "value" start_index referes to the offset in the file to write to

Definition at line 362 of file nexuswriter.cpp.

static void computeDetectorAverage ( const float *  det_vals,
float *  spec_vals,
const std::vector< int > *  det_lookup,
const std::vector< int > &  spec_list 
)
static

Definition at line 945 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeISISNeXus().

template<int NXTYPE>
static int makeDataSlab ( NXhandle  fileid,
const char *  data_name,
const int *  dims_array,
int  ndims,
int  compression_type,
int  spectra_chunk 
)
static

Definition at line 310 of file nexuswriter.cpp.

References MIN_COMP_LEN.

static int* makeNewRawData ( const isisU32_t raw_data,
int  nper_daq,
int  nsp1,
int  ntc1 
)
static

only used by muons and hence OK for it only to work for one TR

Definition at line 12 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeMuonFile().

template<typename T >
static const T* nullValue ( const T *  ,
int  NXTYPE 
)
static

Definition at line 53 of file nexuswriter.cpp.

Referenced by writeAttribute(), and writeData().

static void nxErrorFunc ( void *  arg,
char *  text 
)
static
static int readDeadTimes ( float *  deadtimes_array,
int  ndet,
const char *  file 
)
static

Definition at line 805 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeMuonFile().

static int readGrouping ( int *  grouping,
int  ndet,
const char *  file 
)
static

Definition at line 866 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeMuonFile().

static int readTZero ( float &  tzero,
float &  tzero_offset,
const char *  file 
)
static

Definition at line 843 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeMuonFile().

static char* remove_invalid_chars ( const char *  str,
int  len 
)
static

Definition at line 32 of file nexuswriter.cpp.

Referenced by NeXusWriter::writeISISNeXus().

template<typename T , int NXTYPE>
static int writeAttribute ( NXhandle  fileid,
const char *  data_name,
const char *  attr_name,
const T *  value,
int  len,
bool  convert_null 
)
static

Definition at line 79 of file nexuswriter.cpp.

References nullValue().

Referenced by IXNeXusFile::addLog().

template<typename T , int NXTYPE>
static int writeAttribute ( NXhandle  fileid,
const char *  data_name,
const char *  attr_name,
value,
bool  convert_null 
)
static

Definition at line 103 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int writeData ( NXhandle  fileid,
const char *  data_name,
const T *  value,
const int *  dims_array,
int  ndims,
bool  convert_null,
int  compression_type 
)
static

Definition at line 110 of file nexuswriter.cpp.

References MIN_COMP_LEN, and nullValue().

Referenced by IXNeXusFile::addLog().

template<typename T , int NXTYPE>
static int writeData ( NXhandle  fileid,
const char *  data_name,
value,
bool  convert_null,
int  compression_type 
)
static

Definition at line 429 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int writeData ( NXhandle  fileid,
const char *  data_name,
const T *  value,
int  len,
bool  convert_null,
int  compression_type 
)
static

Definition at line 436 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int writeData ( NXhandle  fileid,
const char *  data_name,
const T *  value,
int  dim1,
int  dim2,
bool  convert_null,
int  compression_type 
)
static

Definition at line 442 of file nexuswriter.cpp.

template<typename T , int NXTYPE>
static int writeSlab ( NXhandle  fileid,
const char *  data_name,
const T *  value,
const int *  dims_array,
int  ndims,
const int *  slab_start,
const int *  slab_size,
bool  convert_null,
int  compression_type 
)
static

Definition at line 239 of file nexuswriter.cpp.

References MIN_COMP_LEN.

template<typename T , int NXTYPE>
static int writeSlabList ( NXhandle  fileid,
const char *  data_name,
const T *  value,
const int *  dims_array,
int  ndims,
const int *  slab_start,
const int *  slab_size,
const std::vector< int > &  slab_list,
bool  convert_null,
int  compression_type,
int  spectra_chunk 
)
static

Definition at line 411 of file nexuswriter.cpp.

static int writeSummaryNeXus ( const ISISCRPT_STRUCT crpt,
DAEstatus dstatus 
)
static

Variable Documentation

const char* detector_base = "detector"

Definition at line 1099 of file nexuswriter.cpp.

Referenced by NeXusEventCallback::finish(), and NeXusWriter::writeISISNeXus().

const char* detector_format = "detector_%d"