# NOT RUN {
image=readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits', package="ProFound"))
profound=profoundProFound(image, magzero=30, rotstats=TRUE)
skyRMS=median(profound$skyRMS)
magoff=profoundFlux2Mag(skyRMS, 30)
totpix=prod(profound$dim)
#We can easily compute the expected number of false positives on an image this size:
data("FPtest")
dim(FPtest)[1]*totpix/1e6/1e3
#And plot the detections and expected false positive distributions:
maghist(profound$segstats$mag, seq(-11,-1,by=0.2)+magoff)
maghist(FPtest$mag+magoff, seq(-6,-1,by=0.2)+magoff, scale=totpix/1e6/1e3, add=TRUE,
border='red')
# }
Run the code above in your browser using DataLab