WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
cnpy Namespace Reference

Classes

struct  NpyArray
 

Typedefs

using npz_t = std::map< std::string, NpyArray >
 

Functions

char BigEndianTest ()
 
char map_type (const std::type_info &t)
 
template<typename T >
std::vector< char > create_npy_header (const std::vector< size_t > &shape)
 
void parse_npy_header (FILE *fp, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order)
 
void parse_npy_header (unsigned char *buffer, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order)
 
void parse_zip_footer (FILE *fp, uint16_t &nrecs, size_t &global_header_size, size_t &global_header_offset)
 
npz_t npz_load (std::string fname)
 
NpyArray npz_load (std::string fname, std::string varname)
 
NpyArray npy_load (std::string fname)
 
template<typename T >
std::vector< char > & operator+= (std::vector< char > &lhs, const T rhs)
 
template<>
std::vector< char > & operator+= (std::vector< char > &lhs, const std::string rhs)
 
template<>
std::vector< char > & operator+= (std::vector< char > &lhs, const char *rhs)
 
template<typename T >
void npy_save (std::string fname, const T *data, const std::vector< size_t > shape, std::string mode="w")
 
template<typename T >
void npz_save (std::string zipname, std::string fname, const T *data, const std::vector< size_t > &shape, std::string mode="w")
 
template<typename T >
void npy_save (std::string fname, const std::vector< T > data, std::string mode="w")
 
template<typename T >
void npz_save (std::string zipname, std::string fname, const std::vector< T > data, std::string mode="w")
 

Typedef Documentation

◆ npz_t

using cnpy::npz_t = typedef std::map<std::string, NpyArray>

Definition at line 63 of file cnpy.h.

Function Documentation

◆ BigEndianTest()

char cnpy::BigEndianTest ( )

Definition at line 16 of file cnpy.cxx.

Here is the caller graph for this function:

◆ create_npy_header()

template<typename T >
std::vector< char > cnpy::create_npy_header ( const std::vector< size_t > &  shape)

Definition at line 240 of file cnpy.h.

Here is the call graph for this function:

◆ map_type()

char cnpy::map_type ( const std::type_info &  t)

Definition at line 21 of file cnpy.cxx.

Here is the caller graph for this function:

◆ npy_load()

cnpy::NpyArray cnpy::npy_load ( std::string  fname)

Definition at line 343 of file cnpy.cxx.

Here is the call graph for this function:

◆ npy_save() [1/2]

template<typename T >
void cnpy::npy_save ( std::string  fname,
const T *  data,
const std::vector< size_t >  shape,
std::string  mode = "w" 
)

Definition at line 88 of file cnpy.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ npy_save() [2/2]

template<typename T >
void cnpy::npy_save ( std::string  fname,
const std::vector< T >  data,
std::string  mode = "w" 
)

Definition at line 228 of file cnpy.h.

Here is the call graph for this function:

◆ npz_load() [1/2]

cnpy::npz_t cnpy::npz_load ( std::string  fname)

Definition at line 246 of file cnpy.cxx.

Here is the call graph for this function:

◆ npz_load() [2/2]

cnpy::NpyArray cnpy::npz_load ( std::string  fname,
std::string  varname 
)

Definition at line 295 of file cnpy.cxx.

Here is the call graph for this function:

◆ npz_save() [1/2]

template<typename T >
void cnpy::npz_save ( std::string  zipname,
std::string  fname,
const T *  data,
const std::vector< size_t > &  shape,
std::string  mode = "w" 
)

Definition at line 138 of file cnpy.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ npz_save() [2/2]

template<typename T >
void cnpy::npz_save ( std::string  zipname,
std::string  fname,
const std::vector< T >  data,
std::string  mode = "w" 
)

Definition at line 234 of file cnpy.h.

Here is the call graph for this function:

◆ operator+=() [1/3]

template<typename T >
std::vector<char>& cnpy::operator+= ( std::vector< char > &  lhs,
const T  rhs 
)

Definition at line 75 of file cnpy.h.

◆ operator+=() [2/3]

template<>
std::vector< char > & cnpy::operator+= ( std::vector< char > &  lhs,
const std::string  rhs 
)

Definition at line 48 of file cnpy.cxx.

◆ operator+=() [3/3]

template<>
std::vector< char > & cnpy::operator+= ( std::vector< char > &  lhs,
const char *  rhs 
)

Definition at line 53 of file cnpy.cxx.

◆ parse_npy_header() [1/2]

void cnpy::parse_npy_header ( FILE *  fp,
size_t &  word_size,
std::vector< size_t > &  shape,
bool &  fortran_order 
)

Definition at line 107 of file cnpy.cxx.

Here is the caller graph for this function:

◆ parse_npy_header() [2/2]

void cnpy::parse_npy_header ( unsigned char *  buffer,
size_t &  word_size,
std::vector< size_t > &  shape,
bool &  fortran_order 
)

Definition at line 63 of file cnpy.cxx.

◆ parse_zip_footer()

void cnpy::parse_zip_footer ( FILE *  fp,
uint16_t &  nrecs,
size_t &  global_header_size,
size_t &  global_header_offset 
)

Definition at line 162 of file cnpy.cxx.

Here is the caller graph for this function: