Skip to content

Two-point generators tutorial does not work for real space #508

@tilmantroester

Description

@tilmantroester

As pointed out by @arthurmloureiro, adapting the two-point generators tutorial from harmonic to real space gives an error:

import numpy as np
from firecrown.metadata_functions import make_all_photoz_bin_combinations, TwoPointReal

from firecrown.generators.inferred_galaxy_zdist import (
    LSST_Y1_LENS_BIN_COLLECTION,
    LSST_Y1_SOURCE_BIN_COLLECTION,
)

count_bins = LSST_Y1_LENS_BIN_COLLECTION.generate()
shear_bins = LSST_Y1_SOURCE_BIN_COLLECTION.generate()
all_y1_bins = count_bins + shear_bins

all_two_point_xy = make_all_photoz_bin_combinations(all_y1_bins)

thetas = np.geomspace(0.5, 300, 128)
all_two_point_xi = [TwoPointReal(XY=xy, thetas=thetas) for xy in all_two_point_xy]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[7], line 16
     13 all_two_point_xy = make_all_photoz_bin_combinations(all_y1_bins)
     15 thetas = np.geomspace(0.5, 300, 128)
---> 16 all_two_point_xi = [TwoPointReal(XY=xy, thetas=thetas) for xy in all_two_point_xy]

File <string>:5, in __init__(self, XY, thetas)

File ~/Research/LSST/dev/firecrown/firecrown/metadata_types.py:584, in TwoPointReal.__post_init__(self)
    579     raise ValueError("Thetas should be a 1D array.")
    581 if not measurement_supports_real(
    582     self.XY.x_measurement
    583 ) or not measurement_supports_real(self.XY.y_measurement):
--> 584     raise ValueError(
    585         f"Measurements {self.XY.x_measurement} and "
    586         f"{self.XY.y_measurement} must support real-space calculations."
    587     )

ValueError: Measurements Galaxies.COUNTS and Galaxies.SHEAR_E must support real-space calculations.

I believe the issue is that the there is a specific measurement (SHEAR_E) attached to the shear_bins n(z), which is at best unintuitive, since the n(z) should be the same, whether it's in real or harmonic space. It should also not matter if it's used in GGL, cosmic shear, photometric clustering, etc but I guess at some point some meta information needs to be attached for make_all_photoz_bin_combinations to know what combinations to build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions