# NOT RUN {
# Analyse a simulated open cluster using spatial and photometric data
# Create strings with filenames
fileNameI <- "oc_12_500_1000_1.0_p019_0880_1_25km_120nR_withcolors.dat"
inputFileName <- system.file("extdata", fileNameI, package="UPMASK")
outputFileName <- file.path(tempdir(), "up-RESULTS.dat")
# Example of how to run UPMASK using data from a file
# (serious analysis require at least larger nRuns)
posIdx <- c(1,2)
photIdx <- c(3,5,7,9,11,19,21,23,25,27)
photErrIdx <- c(4,6,8,10,12,20,22,24,26,28)
UPMASKfile(inputFileName, outputFileName, posIdx, photIdx, photErrIdx, nRuns=5,
starsPerClust_kmeans=25, verbose=TRUE, fileWithHeader=TRUE)
# Open the resulting file to inspect the results
tempResults <- read.table(outputFileName, header=TRUE)
# Create a simple raw plot to see the results
pCols <- tempResults[,length(tempResults)]/max(tempResults[,length(tempResults)])
plot(tempResults[,1], tempResults[,2], col=rgb(0,0,0,pCols), cex=0.5, pch=19)
# Clean the environment
rm(list=c("tempResults", "inputFileName", "outputFileName", "pCols", "fileNameI"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab