goldpan.adapters

Adapters: the only code that knows a file format. Each turns one storage into an Events (and back, where we can write).

  • goldpan.adapters.parquet: the native format (reads and writes); its docstring is the specification.

  • goldpan.adapters.idx: a dump of the NSDF archive (reads).

  • goldpan.adapters.midas: raw SuperCDMS SNOLAB DAQ files, .mid, .mid.gz or .mid.lz4 (reads).

  • goldpan.adapters.rq_root: the RQs of the collaboration’s reconstruction, ROOT files read with uproot (reads a table of quantities, not traces; goldpan.adapters.rq.attach adds it to an Events).

Anyone can add one: a module with read(path, **kw) -> Events, optionally iter_chunks(path, *, chunk, **kw) and write(events, path); goldpan.testing.check_adapter checks it against the contract. register makes it available to read(path, format=...).

A reader can also define REVISION, a whole number (1 if it is absent) that is raised by one whenever a fix changes what it returns for the same file. goldsluice run records the revision of the reader of each output and redoes the outputs made with another one (revision).

Functions

available()

The names of the adapters that read knows.

read(path[, format])

Read path with the adapter format; None guesses: a directory with _goldpan.json or a .parquet file is parquet; a .root file or a folder of them is rq_root; a .mid, .mid.gz or .mid.lz4 file is midas.

register(name, module)

Make module (an adapter) available as read(path, format=name).

revision(name)

The REVISION of the adapter name: raised when a fix changes what the reader returns for the same file, 1 for an adapter that does not say.

goldpan.adapters.register(name, module)[source]

Make module (an adapter) available as read(path, format=name).

Parameters:

name (str)

Return type:

None

goldpan.adapters.revision(name)[source]

The REVISION of the adapter name: raised when a fix changes what the reader returns for the same file, 1 for an adapter that does not say. goldsluice run compares it with the one an output was made with.

Parameters:

name (str)

Return type:

int

goldpan.adapters.available()[source]

The names of the adapters that read knows.

Return type:

list

goldpan.adapters.read(path, format=None, **kwargs)[source]

Read path with the adapter format; None guesses: a directory with _goldpan.json or a .parquet file is parquet; a .root file or a folder of them is rq_root; a .mid, .mid.gz or .mid.lz4 file is midas.

Modules

idx

The idx adapter: a dump of the NSDF archive (NEXUS-DM idx) into an Events.

midas

The MIDAS adapter: raw SuperCDMS SNOLAB DAQ files (.mid, .mid.gz, .mid.lz4) into an Events.

parquet

The native format of goldpan and goldsluice: Parquet (specification, format version 1).

rq

Quantity tables from any RQ source, and how they join an Events.

rq_root

The ROOT RQ adapter: the processed quantities (RQs) of the collaboration's reconstruction, read with uproot; and write, which puts our own processed quantities into the same layout.