Skip to content

Healpix <-> Rectangular needs to ignore nans #2489

@greglucas

Description

@greglucas

Currently, it sounds like if we get a nan value in the healpix subdivision, we are "poisoning" the entire rectangular grid cell with that result. We should ignore those nan values in our calculations, and only set the value to nan if all healpix values are nan within that rectangular cell. i.e. if we have one good healpix value and 5 nan's, we should only use that one good value with the associated exposure time / angle etc. and not anything else.

I think this is the relevant area of the code.

# Weighted mean (weighted by solid angle) of these values over the pixel axis,
# which is the last axis of this array
weighted_hp_vals_at_rect_pix_ctrs = (
hp_vals_at_rect_pix_ctrs * rect_subpix_solid_angle_by_lat
)
mean_pixel_value = (
weighted_hp_vals_at_rect_pix_ctrs.sum(axis=-1) / full_rect_pixel_solid_angle
)

Relevant tests here:

def test_to_rectangular_skymap(

def test_calculate_rect_pixel_value_from_healpix_map_n_subdivisions(

def test_get_rect_pixel_value_recursive_subdivs(

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ins: UltraRelated to the IMAP-Ultra instrumentMapper ToolsWork related to common mapper tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions