Skip to content

Commit d02e55c

Browse files
up doc
1 parent 54db138 commit d02e55c

22 files changed

+268
-1021
lines changed

NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ export(plot_cluster_spectra)
1212
export(reconstruct_cluster_cube)
1313
export(reconstruct_flux_preserving_cube)
1414
export(segment)
15-
export(segment_approx)
1615
export(segment_big_cube)
17-
export(segment_blockward)
18-
export(segment_masked)
19-
export(segment_robust)
2016
export(segment_starlet)
2117
export(summarize_cluster_spectra)
2218
export(torch_dist)

NEWS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Released: 2026-03-18
44

55
## Added
66

7-
- `segment_masked()` for missing-data-safe segmentation with the same clustering logic as `segment()`.
8-
- `segment_big_cube()` as a clearer user-facing name for scalable large-cube segmentation when exact all-pairs distances would exceed available RAM.
7+
- `segment_big_cube()` as the user-facing scalable segmentation path for cubes where exact all-pairs distances would exceed available RAM.
98
- `build_starlet_mask()` and `segment_starlet()` for Sagui-style white-light starlet masking before clustering.
109
- `summarize_cluster_spectra()` for median, summed, and inverse-variance-weighted cluster spectra.
1110
- `choose_ncomp_by_snr()` for variance-aware component selection from an SNR threshold.
@@ -14,9 +13,11 @@ Released: 2026-03-18
1413

1514
## Changed
1615

17-
- `segment()` and `segment_masked()` now share the same internal segmentation core.
16+
- `segment()` now handles missing spectral channels directly in the exact workflow.
17+
- `segment_big_cube()` now uses block medoids rather than block averages, improving compact structures in large cubes.
18+
- `segment_starlet()` can now apply the white-light mask before either the exact or big-cube backend.
1819
- `torch` is now optional; Capivara falls back to base R distance calculations when `torch` is unavailable.
19-
- `segment_robust()` and `cube_cluster_with_snr()` are preserved as compatibility wrappers around the new API.
20+
- The public segmentation API is now limited to `segment()`, `segment_big_cube()`, and `segment_starlet()` to avoid duplicate legacy entry points.
2021
- GitHub and website documentation now describe the missing-data, starlet-mask, and variance-aware workflows.
2122

2223
## Fixed

R/cube_cluster_with_snr.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' @importFrom stats cutree
2727
#'
2828
#' @seealso \code{\link{choose_ncomp_by_snr}}, \code{\link{segment}},
29-
#' \code{\link{segment_masked}}
29+
#' \code{\link{segment}}
3030
#'
3131
#' @examples
3232
#' if (torch::torch_is_installed()) {

R/segment.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
#' with the original spatial dimensions. The function also retains the original data cube
88
#' for reference and post-processing.
99
#'
10+
#' Missing spectral channels are handled automatically: non-finite values produced
11+
#' during row-wise scaling are replaced with zero before distances are computed.
12+
#' This keeps the standard exact workflow usable for masked cubes without a
13+
#' separate public entry point.
14+
#'
1015
#' @param input A FITS object representing the input data cube. Typically, this is an IFU data cube.
1116
#' @param Ncomp Integer, the number of clusters to form.
1217
#' @param redshift Numeric, the redshift to apply for wavelength correction. Defaults to 0 (no correction).
@@ -35,7 +40,9 @@
3540
#' This process is often used in IFU data analysis, where clustering is applied to grouped
3641
#' spectral profiles of spatial pixels to identify regions with similar characteristics.
3742
#'
38-
#' @seealso \code{\link{torch_dist}}, \code{\link[fastcluster]{hclust}}, \code{\link[stats]{cutree}}
43+
#' @seealso \code{\link{segment_big_cube}}, \code{\link{segment_starlet}},
44+
#' \code{\link{torch_dist}}, \code{\link[fastcluster]{hclust}},
45+
#' \code{\link[stats]{cutree}}
3946
#'
4047
#' @examples
4148
#' if (torch::torch_is_installed()) {
@@ -56,6 +63,6 @@ segment <- function(input, Ncomp = 5, redshift = 0, scale_fn = median_scale) {
5663
Ncomp = Ncomp,
5764
redshift = redshift,
5865
scale_fn = scale_fn,
59-
na_to_zero = FALSE
66+
na_to_zero = TRUE
6067
)
6168
}

R/segment_approx.R

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)