Description Usage Arguments Value See Also Examples
View source: R/break_spectrum.R
Break a spectrum into segments when one or more wide masks (i.e.
sequences of many consecutively-masked pixels) exist. The spectrum can be
polarized or unpolarized. When the spectrum is polarized, the set of masked
spectral pixels used to define the spectrum's segmentation is
taken to be the union set of pixels that are masked for any of the
\mjseqnIQU Stokes parameters. Note that denoise_spectrum()
calls
break_spectrum()
internally. So while break_spectrum()
is an exported
function, it typically does not need to be called directly.
1 | break_spectrum(df, break_at = 10L, min_pix_segment = 10L)
|
df |
A tibble that includes a column titled |
break_at |
The minimum number of consecutively-masked spectral pixels
that will trigger a break in the spectrum. Defaults to |
min_pix_segment |
After the segmentation procedure is complete, the
resulting segments are examined to ensure that each is sufficiently long for
a non-trivial/well-defined denoising analysis. In particular, any segment
that has fewer than |
A list of tibbles, with one for each segment of the segmented
spectrum. Masked rows are now dropped and each tibble in the list has the
same format as the input df
, minus the mask columns.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(dplyr)
data(polarized_spectrum_WR_star)
wavelength <- seq(
from = sci$axDat$crval[1],
by = sci$axDat$cdelt[1],
length = sci$axDat$len[1]
) %>%
tibble::as_tibble_col(column_name = "wavelength")
flux <- as_tibble(sci$imDat) %>%
rename_with(function(.cols) c("I", "Q", "U"))
variance <- as_tibble(var$imDat) %>%
select(1:3) %>%
rename_with(function(.cols) c("I_var", "Q_var", "U_var"))
mask <- as_tibble(bpm$imDat) %>%
rename_with(function(.cols) c("I_mask", "Q_mask", "U_mask"))
df <- bind_cols(wavelength, flux, variance, mask)
df_list <- break_spectrum(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.