Skip to content

Commit c70d8ab

Browse files
authored
Shim class for loading G3SuperTimestream objects from disk (#192)
This PR is the first step in integrating the G3SuperTimestream class used by the Simons Observatory team into the core library. This class is a very thin wrapper around the core G3TimestreamMap class. It is designed only to load G3SuperTimestream objects from G3 files on disk for immediate conversion to G3TimestreamMap objects. It is also not exposed to the public or python API. Detector names maintain their ordering from file. Missing samples are gap-filled with zeros (integer data) or nans (float data). For integer data, missing samples are also marked with an extra `"_nanmask"` detector in the data, wherein 1=missing sample, 0=good data. Data are decompressed immediately on read, using openmp for effiicency.
1 parent 59e91f8 commit c70d8ab

File tree

2 files changed

+470
-0
lines changed

2 files changed

+470
-0
lines changed

core/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ else(APPLE)
55
set(CORE_EXTRA_SRCS "")
66
endif(APPLE)
77

8+
if(NOT DEFINED WITHOUT_SUPERTIMESTREAM)
9+
set(WITHOUT_SUPERTIMESTREAM FALSE CACHE BOOL "Build G3SuperTimestream class")
10+
endif()
11+
if(NOT WITHOUT_SUPERTIMESTREAM)
12+
set(CORE_EXTRA_SRCS ${CORE_EXTRA_SRCS} src/G3SuperTimestream.cxx)
13+
endif()
14+
815
add_spt3g_library(core SHARED
916
src/G3Logging.cxx src/G3PrintfLogger.cxx src/G3SyslogLogger.cxx
1017
src/crc32.c src/G3Frame.cxx src/G3Data.cxx src/G3TimeStamp.cxx
@@ -40,6 +47,13 @@ if(FLAC_FOUND)
4047
target_link_libraries(core PRIVATE FLAC::FLAC)
4148
endif()
4249

50+
if(NOT WITHOUT_SUPERTIMESTREAM)
51+
find_package(OpenMP QUIET)
52+
if(OpenMP_FOUND)
53+
target_link_libraries(core PRIVATE OpenMP::OpenMP_CXX)
54+
endif()
55+
endif()
56+
4357
# Link against Z library
4458
if(NOT DEFINED WITH_ZLIB)
4559
set(WITH_ZLIB TRUE CACHE BOOL "Enable gzip fie compression")

0 commit comments

Comments
 (0)