Skip to content

Commit

Permalink
Merge pull request #658 from adokter/integrate_to_ppi_NA_fix
Browse files Browse the repository at this point in the history
ignore NA in integrate_to_ppi
  • Loading branch information
iskandari authored Jun 4, 2024
2 parents 5c378e8 + 94bea73 commit 5604d79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/integrate_to_ppi.R
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ add_expected_eta_to_scan <- function(scan, vp, quantity = "dens",
attributes(eta_expected)$param <- "eta_expected"
scan$params$eta_expected <- eta_expected

# set eta_expected values to zero whenever the reflectivity quantity is NA
# NA values indicate the pixel was never irradiated, so no reflectivity return expected
na_idx <- is.na(scan$params[[param]]) & !is.nan(scan$params[[param]])
scan$params[["eta_expected"]][na_idx] <- 0

# return the scan with added scan parameters 'eta' and 'eta_expected'
scan
}

0 comments on commit 5604d79

Please sign in to comment.