RMF
numpy_util.h
Go to the documentation of this file.
1 /**
2  * \file RMF/numpy_util.h
3  * \brief Utility functions to access data from Python with numpy.
4  *
5  * Copyright 2007-2023 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef RMF_NUMPY_UTIL_H
10 #define RMF_NUMPY_UTIL_H
11 
12 #include "RMF/config.h"
13 
14 namespace RMF {
15 
16 // We only document the functions here. The implementations are provided
17 // in swig/RMF.numpy.i
18 
19 #ifdef RMF_DOXYGEN
20 
21 //! Get global XYZ coordinates for everything under the given node.
22 /** This will traverse the subset of the RMF file rooted at the given node
23  in a depth first manner and put the XYZ coordinates for all appropriate
24  nodes into the provided NumPy array, which must be an N*3 float array
25  where N is the number of XYZ particles. The coordinates are global, i.e.
26  they are transformed by any parent ReferenceFrame nodes.
27 
28  This function is primarily intended to extract trajectory frames
29  for visualization packages such as ChimeraX. It is only available to
30  Python and if RMF is built with NumPy support.
31  */
33  FileConstHandle &fh, NodeConstHandle &nh, PyObject *coord);
34 
35 #endif
36 
37 } /* namespace RMF */
38 
39 #endif /* RMF_NUMPY_UTIL_H */
void get_all_global_coordinates(FileConstHandle &fh, NodeConstHandle &nh, PyObject *coord)
Get global XYZ coordinates for everything under the given node.