Class

NumCosmoMathCatalog

Description [src]

class NumCosmoMath.Catalog : GObject.Object
{
  /* No available fields */
}

Lightweight named-column catalog.

A generic, lightweight container storing a NcmMatrix of double values together with a name for each column. It provides column-name based access to the data and is meant to be used as a derivable base class for catalog-like objects (for example galaxy and halo catalogs), as well as on its own as a simple table that converts cheaply to/from external table formats.

Each column also carries a logical type (NcmCatalogColType): all values are physically stored as doubles, but a column may be tagged as integer or boolean so the intended dtype can be restored when converting to/from external table formats (integers are exact below 2^53, booleans are stored as 0.0/1.0). String and other heterogeneous columns are intentionally not handled here and are left to specialized subclasses or future additive extensions.

This is a pure data container with no cosmological content. It is unrelated to NcmMSetCatalog, which stores Monte Carlo chains.

Ancestors

Constructors

ncm_catalog_new

Creates a new NcmCatalog with nrows rows and the columns named by col_names, with all values initialized to zero.

ncm_catalog_new_full

Creates a new NcmCatalog with nrows rows and the columns named by col_names, with all values initialized to zero. Each column carries the logical type given in col_types (which must have one entry per column).

Functions

ncm_catalog_clear

If catalog is different from NULL, decreases its reference count and sets catalog to NULL.

Instance methods

ncm_catalog_free

Decreases the reference count of catalog by one.

ncm_catalog_get

Gets the value at row i and column col.

ncm_catalog_get_bool

Gets the boolean value at row i and column col.

ncm_catalog_get_col_type

Gets the logical type of the column named col.

ncm_catalog_get_index

Gets the column index from the column name.

ncm_catalog_get_int

Gets the integer value at row i and column col.

ncm_catalog_has_column

Checks whether catalog has a column named col.

ncm_catalog_len

Gets the number of rows (entries) in the catalog.

ncm_catalog_ncols

Gets the number of columns in the catalog.

ncm_catalog_peek_columns

Gets the catalog column names.

ncm_catalog_peek_data

Gets the catalog data matrix.

ncm_catalog_ref

Increases the reference count of catalog by one.

ncm_catalog_set

Sets the value at row i and column col.

ncm_catalog_set_bool

Sets the boolean value at row i and column col, stored as 0.0/1.0 in the double backing matrix.

ncm_catalog_set_int

Sets the integer value at row i and column col. The value is stored in the double backing matrix (lossless for magnitudes below 2^53).

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.Catalog:col-types

The per-column logical types (NcmCatalogColType values), as an array of unsigned integers parallel to NcmCatalog:columns. When unset every column defaults to NCM_CATALOG_COL_TYPE_DOUBLE.

NumCosmoMath.Catalog:columns

The catalog column names.

NumCosmoMath.Catalog:data

The catalog data matrix (rows are entries, columns are named fields).

NumCosmoMath.Catalog:len

The number of rows (entries) in the catalog.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoMathCatalogClass {
  /* no available fields */
}

No description available.