dendrograms / astrodendro

Generate a dendrogram from a dataset
https://dendrograms.readthedocs.io/
Other
37 stars 38 forks source link

same indices, different data? #154

Closed indebetouw closed 8 years ago

indebetouw commented 8 years ago

I am interested in computing a dendrogram using one cube, and then calculating a PPVCatalog using the same assignment indices, but a different data cube. I've tried setting the .data, ._data, and some other things, but is there a way to re-index, or re-fill all of the individual structures' values, without recomputing? Yes, I know the heirarchical nature of the dendrogram is no longer necessarily self-consistent if I apply it to a new data cube, but I want to compare different emission lines over exactly the same regions. Thanks.

keflavich commented 8 years ago

@indebetouw if your cubes have the same shape, you can access the mask for an individual structure with the .get_mask attribute, e.g.: https://github.com/keflavich/APEX_CMZ_H2CO/blob/master/analysis/dendro_temperature.py#L150

From that mask, you can then compute various attributes (e.g., sum, mean, etc.) of the other molecules and add them to your catalog as in the example script linked.

indebetouw commented 8 years ago

Thanks Adam! Is the view and submask in that script just for speed, or am I missing something critical about doing that way? I liked the Formaldehyde paper too BTW.

keflavich commented 8 years ago

Yes, the submask is just for speed. Thanks!