Skip to content

Add a Simons Observatory sub-module.#190

Closed
tskisner wants to merge 1 commit into
CMB-S4:masterfrom
tskisner:simons
Closed

Add a Simons Observatory sub-module.#190
tskisner wants to merge 1 commit into
CMB-S4:masterfrom
tskisner:simons

Conversation

@tskisner

Copy link
Copy Markdown
Member

This PR is just a proof of principle / reference implementation showing an up-streaming of the G3SuperTimestream class from Simons Observatory tools:

  • To ease downstream use and avoid the need for bundling spt3g core into the so3g package, create a sub-module called "so".

  • Add the only unique class used by S.O. data (G3SuperTimestream) to the so submodule, along with some numpy helper tools.

  • Modify the integrated G3SuperTimestream source slightly to allow compilation with -Wall -Werror on both gcc and clang.

This work may be superceded by a shim that translates to/from G3TimestreamMap on the fly. TBD.

- To ease downstream use and avoid the need for bundling spt3g core
  into the `so3g` package, create a sub-module called "so".

- Add the only unique class used by S.O. data (G3SuperTimestream) to
  the `so` submodule, along with some numpy helper tools.

- Modify the integrated G3SuperTimestream source slightly to allow
  compilation with -Wall -Werror on both gcc and clang.

@arahlin arahlin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some preliminary comments on this with some straightforward changes that would make it easier to merge. We strictly avoid linking against numpy everywhere in the core library, and instead rely directly on the python buffer protocol for array access. I think it's feasible to do the same here, but would take some work. Linking against numpy headers is tricky because of the numpy 2 compatibility issues etc. I'd rather avoid that altogether.

Separately, If the intention is to migrate / integrate this class with G3TimestreamMap, I think it would make sense to strip out any unused features.

G3_POINTERS(G3SuperTimestream);
G3_SERIALIZABLE(G3SuperTimestream, 0);

class g3supertimestream_exception : std::exception

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the G3Logging stuff instead of creating a custom exception -- SET_LOGGER("G3SuperTimestream") in the class definition, and use log_fatal() instead of throw g3supertimestream_exception

@@ -0,0 +1,128 @@
#pragma once

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this header file in favor of standard python exceptions and G3Logging

Comment thread so/tests/imports.py
@@ -0,0 +1,2 @@
import spt3g._libso
from spt3g._libso import G3SuperTimestream

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread so/CMakeLists.txt
@@ -0,0 +1,26 @@
# Find the numpy include path

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this module build conditionally on finding Bzip2 and FLAC, since these are technically optional libraries in core.

@arahlin

arahlin commented Apr 24, 2025

Copy link
Copy Markdown
Member

Closing this in favor of #192

@arahlin arahlin closed this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants