NcmSphereMap

NcmSphereMap — An re-implementation of Healpix.

Functions

NcmSphereMap * ncm_sphere_map_new ()
NcmSphereMap * ncm_sphere_map_ref ()
void ncm_sphere_map_free ()
void ncm_sphere_map_clear ()
void ncm_sphere_map_set_nside ()
gint64 ncm_sphere_map_get_nside ()
gint64 ncm_sphere_map_get_npix ()
gint64 ncm_sphere_map_get_nsmap ()
gint64 ncm_sphere_map_get_cap_size ()
gint64 ncm_sphere_map_get_middle_size ()
gint64 ncm_sphere_map_get_nrings ()
gint64 ncm_sphere_map_get_nrings_cap ()
gint64 ncm_sphere_map_get_nrings_middle ()
gint64 ncm_sphere_map_get_ring_size ()
gint64 ncm_sphere_map_get_ring_first_index ()
void ncm_sphere_map_set_order ()
NcmSphereMapOrder ncm_sphere_map_get_order ()
void ncm_sphere_map_set_coordsys ()
NcmSphereMapCoordSys ncm_sphere_map_get_coordsys ()
void ncm_sphere_map_set_lmax ()
guint ncm_sphere_map_get_lmax ()
void ncm_sphere_map_clear_smapels ()
gint64 ncm_sphere_map_nest2ring ()
gint64 ncm_sphere_map_ring2nest ()
void ncm_sphere_map_pix2ang_nest ()
void ncm_sphere_map_pix2ang_ring ()
void ncm_sphere_map_pix2vec_nest ()
void ncm_sphere_map_pix2vec_ring ()
void ncm_sphere_map_ang2pix_nest ()
void ncm_sphere_map_ang2pix_ring ()
void ncm_sphere_map_vec2pix_ring ()
void ncm_sphere_map_vec2pix_nest ()
void ncm_sphere_map_add_to_vec ()
void ncm_sphere_map_add_to_ang ()
void ncm_sphere_map_load_fits ()
void ncm_sphere_map_save_fits ()
void ncm_sphere_map_load_from_fits_catalog ()
void ncm_sphere_map_prepare_alm ()
void ncm_sphere_map_update_Cl ()
void ncm_sphere_map_get_alm ()
void ncm_sphere_map_set_alm ()
gdouble ncm_sphere_map_get_Cl ()
gdouble ncm_sphere_map_get_pix ()
void ncm_sphere_map_add_noise ()
void ncm_sphere_map_set_map ()
void ncm_sphere_map_set_Cls ()
void ncm_sphere_map_alm2map ()
NcmSpline * ncm_sphere_map_calc_Ctheta ()
#define NCM_SPHERE_MAP_N()
#define NCM_SPHERE_MAP_INT_TO_XY()
#define NCM_SPHERE_MAP_XY_TO_INT()
#define NCM_SPHERE_MAP_ALM_SIZE()
#define NCM_SPHERE_MAP_M_START()
#define NCM_SPHERE_MAP_ALM_INDEX()

Properties

NcmSphereMapCoordSys coordsys Read / Write / Construct
guint lmax Read / Write / Construct
gint64 nside Read / Write / Construct
NcmSphereMapOrder order Read / Write / Construct

Types and Values

Object Hierarchy

    GEnum
    ├── NcmSphereMapCoordSys
    ╰── NcmSphereMapOrder
    GObject
    ╰── NcmSphereMap

Description

Map pixalization/manipulation algorithms, Ylm decomposition.

Functions

ncm_sphere_map_new ()

NcmSphereMap *
ncm_sphere_map_new (const gint64 nside);

Creates a new NcmSphereMap for a given nside .

Parameters

nside

the healpix nside parameter

 

Returns

a new NcmSphereMap.

[transfer full]


ncm_sphere_map_ref ()

NcmSphereMap *
ncm_sphere_map_ref (NcmSphereMap *smap);

Increases the reference count of smap .

Parameters

smap

a NcmSphereMap

 

Returns

smap .

[transfer full]


ncm_sphere_map_free ()

void
ncm_sphere_map_free (NcmSphereMap *smap);

Decreases the reference count of smap . When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

Parameters

smap

a NcmSphereMap

 

ncm_sphere_map_clear ()

void
ncm_sphere_map_clear (NcmSphereMap **smap);

If *smap is not NULL, decreases the reference count of smap . When its reference count drops to 0, the object is finalized (i.e. its memory is freed). Set *smap to NULL.

Parameters

smap

a NcmSphereMap

 

ncm_sphere_map_set_nside ()

void
ncm_sphere_map_set_nside (NcmSphereMap *smap,
                          gint64 nside);

Sets the nside parameter of smap .

Parameters

smap

a NcmSphereMap

 

nside

the healpix nside parameter

 

ncm_sphere_map_get_nside ()

gint64
ncm_sphere_map_get_nside (NcmSphereMap *smap);

Get the nside parameter of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the nside parameter of smap .


ncm_sphere_map_get_npix ()

gint64
ncm_sphere_map_get_npix (NcmSphereMap *smap);

Gets the number of pixels of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the number of pixels of smap .


ncm_sphere_map_get_nsmap ()

gint64
ncm_sphere_map_get_nsmap (NcmSphereMap *smap);

ncm_sphere_map_get_cap_size ()

gint64
ncm_sphere_map_get_cap_size (NcmSphereMap *smap);

Get the number of pixels of the north cap of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the number of pixels of the north cap of smap .


ncm_sphere_map_get_middle_size ()

gint64
ncm_sphere_map_get_middle_size (NcmSphereMap *smap);

Get the number of pixels of the middle of smap . That is the number of pixels of the middle rings.

Parameters

smap

a NcmSphereMap

 

Returns

the number of pixels of the middle of smap .


ncm_sphere_map_get_nrings ()

gint64
ncm_sphere_map_get_nrings (NcmSphereMap *smap);

Get the number of rings of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the number of rings of smap .


ncm_sphere_map_get_nrings_cap ()

gint64
ncm_sphere_map_get_nrings_cap (NcmSphereMap *smap);

Get the number of rings of the north cap of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the number of rings of the north cap of smap .


ncm_sphere_map_get_nrings_middle ()

gint64
ncm_sphere_map_get_nrings_middle (NcmSphereMap *smap);

Get the number of rings of the middle of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the number of rings of the middle of smap .


ncm_sphere_map_get_ring_size ()

gint64
ncm_sphere_map_get_ring_size (NcmSphereMap *smap,
                              gint64 r_i);

Get the number of pixels of the ring r_i of smap .

Parameters

smap

a NcmSphereMap

 

r_i

ring index

 

Returns

the number of pixels of the ring r_i of smap .


ncm_sphere_map_get_ring_first_index ()

gint64
ncm_sphere_map_get_ring_first_index (NcmSphereMap *smap,
                                     gint64 r_i);

Get the first pixel index of the ring r_i of smap .

Parameters

smap

a NcmSphereMap

 

r_i

ring index

 

Returns

the first pixel index of the ring r_i of smap .


ncm_sphere_map_set_order ()

void
ncm_sphere_map_set_order (NcmSphereMap *smap,
                          NcmSphereMapOrder order);

Sets the pixel ordering of smap .

Parameters

smap

a NcmSphereMap

 

order

the pixel ordering

 

ncm_sphere_map_get_order ()

NcmSphereMapOrder
ncm_sphere_map_get_order (NcmSphereMap *smap);

Gets the pixel ordering of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the pixel ordering of smap .


ncm_sphere_map_set_coordsys ()

void
ncm_sphere_map_set_coordsys (NcmSphereMap *smap,
                             NcmSphereMapCoordSys coordsys);

Sets the coordinate system of smap .

Parameters

smap

a NcmSphereMap

 

coordsys

the coordinate system

 

ncm_sphere_map_get_coordsys ()

NcmSphereMapCoordSys
ncm_sphere_map_get_coordsys (NcmSphereMap *smap);

Gets the coordinate system of smap .

Parameters

smap

a NcmSphereMap

 

Returns

the coordinate system of smap .


ncm_sphere_map_set_lmax ()

void
ncm_sphere_map_set_lmax (NcmSphereMap *smap,
                         guint lmax);

Prepare the object to calculate $a_{\ell{}m}$ and/or $C_\ell$, up to $\ell=$lmax .

Parameters

smap

a NcmSphereMap

 

lmax

max value of $\ell$

 

ncm_sphere_map_get_lmax ()

guint
ncm_sphere_map_get_lmax (NcmSphereMap *smap);

ncm_sphere_map_clear_smapels ()

void
ncm_sphere_map_clear_smapels (NcmSphereMap *smap);

ncm_sphere_map_nest2ring ()

gint64
ncm_sphere_map_nest2ring (NcmSphereMap *smap,
                          const gint64 nest_index);

Converts a pixel index from NESTED to RING ordering.

Parameters

smap

a NcmSphereMap

 

nest_index

a pixel index in NESTED ordering

 

Returns

the pixel index in RING ordering.


ncm_sphere_map_ring2nest ()

gint64
ncm_sphere_map_ring2nest (NcmSphereMap *smap,
                          const gint64 ring_index);

Converts a pixel index from RING to NESTED ordering.

Parameters

smap

a NcmSphereMap

 

ring_index

a pixel index in RING ordering

 

Returns

the pixel index in NESTED ordering.


ncm_sphere_map_pix2ang_nest ()

void
ncm_sphere_map_pix2ang_nest (NcmSphereMap *smap,
                             const gint64 nest_index,
                             gdouble *theta,
                             gdouble *phi);

Converts a pixel index from NESTED to spherical coordinates and returns the angles theta and phi .

Parameters

smap

a NcmSphereMap

 

nest_index

a pixel index in NESTED ordering

 

theta

the polar angle of the pixel.

[out]

phi

the azimuthal angle of the pixel.

[out]

ncm_sphere_map_pix2ang_ring ()

void
ncm_sphere_map_pix2ang_ring (NcmSphereMap *smap,
                             const gint64 ring_index,
                             gdouble *theta,
                             gdouble *phi);

Converts a pixel index from RING to spherical coordinates and returns the angles theta and phi .

Parameters

smap

a NcmSphereMap

 

ring_index

a pixel index in RING ordering

 

theta

the polar angle of the pixel.

[out]

phi

the azimuthal angle of the pixel.

[out]

ncm_sphere_map_pix2vec_nest ()

void
ncm_sphere_map_pix2vec_nest (NcmSphereMap *smap,
                             const gint64 nest_index,
                             NcmTriVec *vec);

Converts a pixel index from NESTED to a unit vector.

Parameters

smap

a NcmSphereMap

 

nest_index

a pixel index in NESTED ordering

 

vec

a NcmTriVec

 

ncm_sphere_map_pix2vec_ring ()

void
ncm_sphere_map_pix2vec_ring (NcmSphereMap *smap,
                             const gint64 ring_index,
                             NcmTriVec *vec);

Converts a pixel index from RING to a unit vector.

Parameters

smap

a NcmSphereMap

 

ring_index

a pixel index in RING ordering

 

vec

a NcmTriVec

 

ncm_sphere_map_ang2pix_nest ()

void
ncm_sphere_map_ang2pix_nest (NcmSphereMap *smap,
                             const gdouble theta,
                             const gdouble phi,
                             gint64 *nest_index);

Converts spherical coordinates to a pixel index in NESTED ordering.

Parameters

smap

a NcmSphereMap

 

theta

a polar angle

 

phi

an azimuthal angle

 

nest_index

the pixel index in NESTED ordering.

[out]

ncm_sphere_map_ang2pix_ring ()

void
ncm_sphere_map_ang2pix_ring (NcmSphereMap *smap,
                             const gdouble theta,
                             const gdouble phi,
                             gint64 *ring_index);

Converts spherical coordinates to a pixel index in RING ordering.

Parameters

smap

a NcmSphereMap

 

theta

a polar angle

 

phi

an azimuthal angle

 

ring_index

the pixel index in RING ordering.

[out]

ncm_sphere_map_vec2pix_ring ()

void
ncm_sphere_map_vec2pix_ring (NcmSphereMap *smap,
                             NcmTriVec *vec,
                             gint64 *ring_index);

Converts a unit vector to a pixel index in RING ordering.

Parameters

smap

a NcmSphereMap

 

vec

a NcmTriVec

 

ring_index

the pixel index in RING ordering.

[out]

ncm_sphere_map_vec2pix_nest ()

void
ncm_sphere_map_vec2pix_nest (NcmSphereMap *smap,
                             NcmTriVec *vec,
                             gint64 *nest_index);

Converts a unit vector to a pixel index in NESTED ordering.

Parameters

smap

a NcmSphereMap

 

vec

a NcmTriVec

 

nest_index

the pixel index in NESTED ordering.

[out]

ncm_sphere_map_add_to_vec ()

void
ncm_sphere_map_add_to_vec (NcmSphereMap *smap,
                           NcmTriVec *vec,
                           const gdouble s);

Adds s to the signal at the pixel corresponding to vec .

Parameters

smap

a NcmSphereMap

 

vec

a NcmTriVec

 

s

signal

 

ncm_sphere_map_add_to_ang ()

void
ncm_sphere_map_add_to_ang (NcmSphereMap *smap,
                           const gdouble theta,
                           const gdouble phi,
                           const gdouble s);

Adds s to the signal at the pixel corresponding to theta and phi .

Parameters

smap

a NcmSphereMap

 

theta

$\theta$

 

phi

$\phi$

 

s

signal

 

ncm_sphere_map_load_fits ()

void
ncm_sphere_map_load_fits (NcmSphereMap *smap,
                          const gchar *fits_file,
                          const gchar *signal_name);

Loads a NcmSphereMap from a fits file.

Parameters

smap

a NcmSphereMap

 

fits_file

fits filename

 

signal_name

signal column name in fits_file .

[allow-none]

ncm_sphere_map_save_fits ()

void
ncm_sphere_map_save_fits (NcmSphereMap *smap,
                          const gchar *fits_file,
                          const gchar *signal_name,
                          gboolean overwrite);

Saves a NcmSphereMap to a fits file.

Parameters

smap

a NcmSphereMap

 

fits_file

fits filename

 

signal_name

signal column name in fits_file .

[allow-none]

overwrite

whether to overwrite fits_file if it exists

 

ncm_sphere_map_load_from_fits_catalog ()

void
ncm_sphere_map_load_from_fits_catalog (NcmSphereMap *smap,
                                       const gchar *fits_file,
                                       const gchar *RA,
                                       const gchar *DEC,
                                       const gchar *S);

Loads a NcmSphereMap from a fits catalog.

Parameters

smap

a NcmSphereMap

 

fits_file

fits filename

 

RA

RA column name in fits_file

 

DEC

DEC column name in fits_file

 

S

Signal column name in fits_file .

[allow-none]

ncm_sphere_map_prepare_alm ()

void
ncm_sphere_map_prepare_alm (NcmSphereMap *smap);

Calculates the $a_{\ell{}m}$ from the map smap , using $\ell_\mathrm{max}$ set by ncm_sphere_map_set_lmax(). If $\ell_\mathrm{max} = 0$ nothing is done.

Parameters

smap

a NcmSphereMap

 

ncm_sphere_map_update_Cl ()

void
ncm_sphere_map_update_Cl (NcmSphereMap *smap);

Updates the values of $C_\ell$ based on the current $a_{lm}$.

Parameters

smap

a NcmSphereMap

 

ncm_sphere_map_get_alm ()

void
ncm_sphere_map_get_alm (NcmSphereMap *smap,
                        guint l,
                        guint m,
                        gdouble *Re_alm,
                        gdouble *Im_alm);

Gets the value of $a_{lm}$ previously calculated by ncm_sphere_map_prepare_alm().

Parameters

smap

a NcmSphereMap

 

l

value of $l < \ell_\mathrm{max}$

 

m

value of $m \leq l$.

 

Re_alm

real part of $a_{lm}$.

[out]

Im_alm

imaginary part of $a_{lm}$.

[out]

ncm_sphere_map_set_alm ()

void
ncm_sphere_map_set_alm (NcmSphereMap *smap,
                        guint l,
                        guint m,
                        gdouble Re_alm,
                        gdouble Im_alm);

Sets the value of $a_{lm}$.

Parameters

smap

a NcmSphereMap

 

l

value of $l < \ell_\mathrm{max}$

 

m

value of $m \leq l$.

 

Re_alm

real part of $a_{lm}$

 

Im_alm

imaginary part of $a_{lm}$

 

ncm_sphere_map_get_Cl ()

gdouble
ncm_sphere_map_get_Cl (NcmSphereMap *smap,
                       guint l);

Gets the value of $C_{\ell}$ previously calculated by ncm_sphere_map_prepare_alm().

Parameters

smap

a NcmSphereMap

 

l

value of $l < \ell_\mathrm{max}$

 

ncm_sphere_map_get_pix ()

gdouble
ncm_sphere_map_get_pix (NcmSphereMap *smap,
                        guint i);

Gets the value of pixel index by i .

Parameters

smap

a NcmSphereMap

 

i

pixel index

 

ncm_sphere_map_add_noise ()

void
ncm_sphere_map_add_noise (NcmSphereMap *smap,
                          const gdouble sd,
                          NcmRNG *rng);

Adds a Gaussian noise with $\sigma=$ sd and zero mean to each pixel.

Parameters

smap

a NcmSphereMap

 

sd

noise standard deviation

 

rng

a NcmRNG

 

ncm_sphere_map_set_map ()

void
ncm_sphere_map_set_map (NcmSphereMap *smap,
                        GArray *map);

Set map pixels to map using current ordering.

Parameters

smap

a NcmSphereMap

 

map

pixels.

[array][element-type gdouble]

ncm_sphere_map_set_Cls ()

void
ncm_sphere_map_set_Cls (NcmSphereMap *smap,
                        NcmVector *Cls);

Set map $C_l$s.

Parameters

smap

a NcmSphereMap

 

Cls

a NcmVector containing the $C_\ell$

 

ncm_sphere_map_alm2map ()

void
ncm_sphere_map_alm2map (NcmSphereMap *smap);

Compute map pixels from current $a_{\ell{}m}$.

Parameters

smap

a NcmSphereMap

 

ncm_sphere_map_calc_Ctheta ()

NcmSpline *
ncm_sphere_map_calc_Ctheta (NcmSphereMap *smap,
                            const gdouble reltol);

Computes the two-point correlation function $C(\theta)$ from the precomputed $C_\ell$.

Parameters

smap

a NcmSphereMap

 

reltol

required tolerance for $C(\theta)$

 

Returns

the $C(\theta)$ spline.

[transfer full]


NCM_SPHERE_MAP_N()

#define NCM_SPHERE_MAP_N(nside) (12 * (nside) * (nside))

NCM_SPHERE_MAP_INT_TO_XY()

#define             NCM_SPHERE_MAP_INT_TO_XY(i, x, y)

NCM_SPHERE_MAP_XY_TO_INT()

#define             NCM_SPHERE_MAP_XY_TO_INT(x, y, i)

NCM_SPHERE_MAP_ALM_SIZE()

#define NCM_SPHERE_MAP_ALM_SIZE(lmax) (((lmax) * (lmax) + 3 * (lmax) + 2) / 2)

NCM_SPHERE_MAP_M_START()

#define NCM_SPHERE_MAP_M_START(lmax, m) ((2 * (lmax) * (m) - (m) * (m) + 3 * (m)) / 2)

NCM_SPHERE_MAP_ALM_INDEX()

#define NCM_SPHERE_MAP_ALM_INDEX(lmax, l, m) ((l) + ((1 + 2 * (lmax) - (m)) * (m)) / 2)

Types and Values

NCM_TYPE_SPHERE_MAP

#define NCM_TYPE_SPHERE_MAP (ncm_sphere_map_get_type ())

enum NcmSphereMapOrder

FIXME

Members

NCM_SPHERE_MAP_ORDER_NEST

FIXME

 

NCM_SPHERE_MAP_ORDER_RING

FIXME

 

enum NcmSphereMapCoordSys

FIXME

Members

NCM_SPHERE_MAP_COORD_SYS_GALACTIC

FIXME

 

NCM_SPHERE_MAP_COORD_SYS_ECLIPTIC

FIXME

 

NCM_SPHERE_MAP_COORD_SYS_CELESTIAL

FIXME

 

NCM_SPHERE_MAP_HEALPIX_NULLVAL

#define NCM_SPHERE_MAP_HEALPIX_NULLVAL (-1.6375e30)

NCM_SPHERE_MAP_DEFAULT_SIGNAL

#define NCM_SPHERE_MAP_DEFAULT_SIGNAL "SIGNAL"

NcmSphereMap

typedef struct _NcmSphereMap NcmSphereMap;

Property Details

The “coordsys” property

  “coordsys”                 NcmSphereMapCoordSys

Map coordinate system.

Owner: NcmSphereMap

Flags: Read / Write / Construct

Default value: NCM_SPHERE_MAP_COORD_SYS_CELESTIAL


The “lmax” property

  “lmax”                     guint

max ell.

Owner: NcmSphereMap

Flags: Read / Write / Construct

Default value: 0


The “nside” property

  “nside”                    gint64

nside.

Owner: NcmSphereMap

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “order” property

  “order”                    NcmSphereMapOrder

Map pixel ordering.

Owner: NcmSphereMap

Flags: Read / Write / Construct

Default value: NCM_SPHERE_MAP_ORDER_RING