BuildHeatmap#

class astropathdb.tools.spatial_heatmap.BuildHeatmap(*args, column=None, log_transform=True, scale=256, density=True, cmap='inferno', alpha=0.5, **kwargs)#

Bases: SampleToolsBase

Build a single dimensional heatmap.

Need to update!!!!

Parameters:

BuildHeatmap Attributes#

BuildHeatmap Methods#

get_expression_weights()

Return weights for each x and y spot of the column attribute.

get_2d_mesh_on_astrosample(weights)

Use the 2D mesh function with the given params.

rescale_mesh(mesh)

Rescale the 2D mesh to the image coordinates.

apply_color_mapping_to_matrix(rescaled_mesh)

Apply the cmap to get a colored version of a mesh.

alpha_shade_with_image(heatmap)

Add two images with alpha shading.

get_heatmap()

Compute a spatial heatmap for the parameters.

get_overlaid_heatmap()

Get a heatmap overlaid with it's correspondin image.

store_spatial_heatmap(heatmap[, label])

Stores the spatial heatmap in the images section of the data object.

BuildHeatmap References#

Attribute Reference#

attribute column: str = None#
attribute log_transform: bool = True#
attribute scale: float = 256#
attribute density: bool = True#
attribute cmap = 'inferno'#
attribute alpha = 0.5#
attribute table_id#
attribute image_id#
attribute sdata#
attribute astrodb = None#
attribute sampleid = None#

Method Reference#

method get_expression_weights()#

Return weights for each x and y spot of the column attribute.

Return type:

ndarray | None

method get_2d_mesh_on_astrosample(weights)#

Use the 2D mesh function with the given params.

Parameters:

weights (ndarray | None)

Return type:

tuple[ndarray, ndarray, ndarray]

method rescale_mesh(mesh)#

Rescale the 2D mesh to the image coordinates.

Parameters:

mesh (ndarray)

Return type:

ndarray

method apply_color_mapping_to_matrix(rescaled_mesh)#

Apply the cmap to get a colored version of a mesh.

Parameters:

rescaled_mesh (ndarray)

Return type:

ndarray

method alpha_shade_with_image(heatmap)#

Add two images with alpha shading.

Parameters:

heatmap (ndarray)

Return type:

ndarray

method get_heatmap()#

Compute a spatial heatmap for the parameters.

Return type:

ndarray

method get_overlaid_heatmap()#

Get a heatmap overlaid with it’s correspondin image.

Return type:

ndarray

method store_spatial_heatmap(heatmap, label=None)#

Stores the spatial heatmap in the images section of the data object.

Parameters:
Return type:

None