diff --git a/man/as.rimg.Rd b/man/as.rimg.Rd index 04207317..ecd5b452 100644 --- a/man/as.rimg.Rd +++ b/man/as.rimg.Rd @@ -32,12 +32,13 @@ to an \code{rimg} object. \examples{ # Generate some fake image data -fake <- array(c( - as.matrix(rep(c(0.2, 0.4, 0.6), each = 250)), - as.matrix(rep(c(0.4, 0.7, 0.8), each = 250)), - as.matrix(rep(c(0.6, 0.1, 0.2), each = 250)) -), -dim = c(750, 750, 3) +fake <- array( + c( + as.matrix(rep(c(0.2, 0.4, 0.6), each = 250)), + as.matrix(rep(c(0.4, 0.7, 0.8), each = 250)), + as.matrix(rep(c(0.6, 0.1, 0.2), each = 250)) + ), + dim = c(750, 750, 3) ) # Inspect it diff --git a/man/jnd2xyz.Rd b/man/jnd2xyz.Rd index d7e78481..429e1428 100644 --- a/man/jnd2xyz.Rd +++ b/man/jnd2xyz.Rd @@ -54,7 +54,7 @@ perceptually-corrected (i.e. noise-weighted Euclidean distances) data(flowers) # Estimate quantum catches visual phenotype of a Blue Tit -vis.flowers <- vismodel(flowers, visual = 'bluetit') +vis.flowers <- vismodel(flowers, visual = "bluetit") # Estimate noise-weighted colour distances between all flowers cd.flowers <- coldist(vis.flowers) diff --git a/man/jndplot.Rd b/man/jndplot.Rd index 06144acc..3d44f7ac 100644 --- a/man/jndplot.Rd +++ b/man/jndplot.Rd @@ -74,7 +74,7 @@ argument, in which case they cannot be interpreted as described. data(flowers) # Estimate quantum catches visual phenotype of a Blue Tit -vis.flowers <- vismodel(flowers, visual = 'bluetit') +vis.flowers <- vismodel(flowers, visual = "bluetit") # Estimate noise-weighted colour distances between all flowers cd.flowers <- coldist(vis.flowers) diff --git a/man/jndrot.Rd b/man/jndrot.Rd index 029e106b..af150b1e 100644 --- a/man/jndrot.Rd +++ b/man/jndrot.Rd @@ -46,7 +46,7 @@ Rotate Cartesian coordinates obtained from \code{\link[=jnd2xyz]{jnd2xyz()}} data(flowers) # Estimate quantum catches visual phenotype of a Blue Tit -vis.flowers <- vismodel(flowers, visual = 'bluetit') +vis.flowers <- vismodel(flowers, visual = "bluetit") # Estimate noise-weighted colour distances between all flowers cd.flowers <- coldist(vis.flowers) diff --git a/man/simulate_spec.Rd b/man/simulate_spec.Rd index 263e8c24..e12e663f 100644 --- a/man/simulate_spec.Rd +++ b/man/simulate_spec.Rd @@ -77,29 +77,31 @@ reflect5 <- simulate_spec(wl_inflect = 575, wl_peak = c(340, 430), width_gauss = # Simulate a set of Gaussian reflectance curves with peaks varying between 400-600nm # in increments of 10, then combine into a single rspec object, and plot the result -peaks <- seq(400, 600, 10) # Peak locations -reflectances <- lapply(seq_along(peaks), function(x) simulate_spec(wl_peak = peaks[x])) # Simulate -reflectances <- Reduce(merge, reflectances) # Combine -plot(reflectances) # Plot +peaks <- seq(400, 600, 10) # Peak locations +reflectances <- lapply(seq_along(peaks), function(x) simulate_spec(wl_peak = peaks[x])) # Simulate +reflectances <- Reduce(merge, reflectances) # Combine +plot(reflectances) # Plot # Simulate a set of Gaussian reflectance curves with a single peak at 500 nm, but # with maximum reflectance varying from 30 to 90\% in 10\% increments, then combine # into a single rspec object, and plot the result -ymax <- lapply(seq(30, 90, 10), function(x) c(0, x)) # Varying reflectance maxima -reflectances2 <- lapply(ymax, function(x) simulate_spec(wl_peak = 500, ylim = x)) # Simulate -reflectances2 <- Reduce(merge, reflectances2) # Combine -plot(reflectances2) # Plot +ymax <- lapply(seq(30, 90, 10), function(x) c(0, x)) # Varying reflectance maxima +reflectances2 <- lapply(ymax, function(x) simulate_spec(wl_peak = 500, ylim = x)) # Simulate +reflectances2 <- Reduce(merge, reflectances2) # Combine +plot(reflectances2) # Plot # To simulate non-reflectance spectra (like irradiances or radiances), it's often useful # to explore more 'extreme' parameters. Here's a simple example which simulates # natural daylight, as represented by the D65 standard daylight spectrum. -D65_real <- procspec(sensdata(illum = 'D65'), opt = 'smooth') # Official D65 daylight spectrum -D65_sim <- simulate_spec(wl_peak = 400, - width_gauss = 1300, - skew_gauss = 10, - ylim = c(0, 1)) # Simulated D65 -cor.test(D65_real$D65, D65_sim$spec_p400) # >0.99 correlation -plot(merge(D65_real, D65_sim), lty = 1:2, ylab = 'Irradiance (\%)') # Merge and plot the two spectra +D65_real <- procspec(sensdata(illum = "D65"), opt = "smooth") # Official D65 daylight spectrum +D65_sim <- simulate_spec( + wl_peak = 400, + width_gauss = 1300, + skew_gauss = 10, + ylim = c(0, 1) +) # Simulated D65 +cor.test(D65_real$D65, D65_sim$spec_p400) # >0.99 correlation +plot(merge(D65_real, D65_sim), lty = 1:2, ylab = "Irradiance (\%)") # Merge and plot the two spectra } \references{