Skip to content

Commit

Permalink
better docs, fix ARCFileReader constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Sep 8, 2023
1 parent a00f655 commit 243acae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion core/src/G3Reader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ PYBINDINGS("core") {
"streams, resulting in EOF behavior on expiry; unfortunately this "
"cannot be used for polling, you have to close the connection. "
"Use the `tell` and `seek` methods to record the position of and "
"seek to the beginning of a particular frame in the file.",
"seek to the beginning of a particular frame in the file. Set "
"track_filename to True to record the filename for each frame in "
"the ._filename attribute (fragile).",
init<std::string, int, float, bool>((arg("filename"),
arg("n_frames_to_read")=0,arg("timeout")=-1.,arg("track_filename")=false)))
.def(init<std::vector<std::string>, int, float, bool>((arg("filename"),
Expand Down
2 changes: 1 addition & 1 deletion doc/frames.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Frames have fast serialization to and from disk (see the G3Reader and G3Writer m

Each frame has a type defined under the ``core.G3FrameType`` namespace. These are meant to indicate different types of data (calibration vs. scan data, for example) and, in general, many types of frames will be interleaved in the same data stream. A good general rule for whether data should be in a different frame type is to consider the rates at which the data change: data that change at the same speed (e.g. bolometer data and pointing) should share a frame, while data that change at different speeds (e.g. calibration constants and bolometer data) should be separated.

Each frame also has a ``._filename`` attribute, which is set when frames are read in using the ``core.G3Reader`` pipeline module. This attribute is not serialized with the frame, so will be an empty string when used with pickling or multiprocessing. This attribute is fragile and should not be relied upon for production code.
Each frame also has a ``._filename`` attribute, which is set when frames are read in using the ``core.G3Reader`` pipeline module with the ``track_filename`` option set to ``True``. This attribute is not serialized with the frame, so will be an empty string when used with pickling or multiprocessing. This attribute is fragile and should not be relied upon for production code.

A brief description of the intention of each frame type follows along with a table containing a representative minimal set of data likely to be contained by a frame of a given type. The list is neither exhaustive nor truly minimal: other data can and will be present and some of the data listed here may have been removed or renamed. Neither is this an exhaustive list of frame types: any single character code can be [ab]used as a frame type for special purpose tools.

Expand Down
15 changes: 8 additions & 7 deletions gcp/src/ARCFileReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -876,13 +876,14 @@ PYBINDINGS("gcp") {
// Instead of EXPORT_G3MODULE since there are two constructors
class_<ARCFileReader, bases<G3Module>, boost::shared_ptr<ARCFileReader>,
boost::noncopyable>("ARCFileReader",
"Read GCP archive file (or files if you pass an iterable of paths)."
" For non-SPT ARC file formats, please set Experiment to the "
" appropriate value.",
init<std::string, optional<Experiment> >(
args("filename", "experiment")))
.def(init<std::vector<std::string>, optional<Experiment> >(
args("filename", "experiment")))
"Read GCP archive file (or files if you pass an iterable of paths). "
"For non-SPT ARC file formats, please set Experiment to the "
"appropriate value. Set track_filename to True to record the "
"filename for each frame in the ._filename attribute (fragile).",
init<std::string, Experiment, bool>((arg("filename"),
arg("experiment")=Experiment::SPT, arg("track_filename")=false)))
.def(init<std::vector<std::string>, Experiment, bool>((arg("filename"),
arg("experiment")=Experiment::SPT, arg("track_filename")=false)))
.def_readonly("__g3module__", true)
;
}
Expand Down

0 comments on commit 243acae

Please sign in to comment.