# NOT RUN {
im1 = im2 = im3 =readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits',
package="ProFound"))$imDat
stack=profoundMakeStack(list(im1, im2, im3),
skyRMS_list = list(8,8,3))
#The new signal-to-noise weighted sky should equal sqrt(1/(1/8^2+1/8^2+1/3^2)) = 2.65
stack$skyRMS
# masking logic, here we have a wedding cake of masked regions:
im1[100:200,100:200]=NA; im2[120:180,120:180]=NA; im3[140:160,140:160]=NA
# masking='or' will conservatively mask any pixel that is masked in the stack:
magimage(profoundMakeStack(list(im1, im2, im3), masking='or')$image)
# masking='and' will optimistically only mask pixels masked in all stacked images:
magimage(profoundMakeStack(list(im1, im2, im3), masking='and')$image)
# }
Run the code above in your browser using DataLab