# Last edited on 2008-02-04 13:01:39 by stolfi # Creates "eps" figures showing the clusters of pieces found by the # program # Which test data: DATASET = ceramic-3 # Which candidate sets to show: SOLS = \ run-2/f/002/r-AND-t NONSOLS = .PHONY: all clean \ sol-clean sol-all sol-findclusters sol-drawclusters sol-showclusters \ clu-draw clu-show clu-print all: clean for sol in ${SOLS}; do \ ${MAKE} SOL=$$sol sol-all; \ done clean: for sol in ${SOLS}; do \ ${MAKE} SOL=$$sol sol-clean; \ done # ====================================================================== # For recursive "make" only (once per solution) # Caller must define ${SOL} SOL := SOL.IS.UNDEFINED ifneq "${SOL}" "SOL.IS.UNDEFINED" # singleset: singleclean singlejoin singleshow singleset: singleclean singlejoin # Get sol attributes FIELDS := ${subst /, ,${SOL}} RUN := ${word 1,${FIELDS}} FILTERTAG := ${word 2,${FIELDS}} BAND := ${word 3,${FIELDS}} CANDTAG := ${word 4,${FIELDS}} FIRSTCAND := 00000 LASTCAND := 99999 # The /l/sdb version only works on "amelia". The /home/amelia version # has been giving bogus "no such file" errors to FileRd.Open(). # DATADIR = /l/sdb/staff/stolfi/hcgl/tests-for-export/${DATASET} DATADIR = /home/amelia/stolfi/hcgl/tests-for-export/${DATASET} PROGDIR = ${STOLFIHOME}/programs/pm3-1.1.15/THESES/hcgl/1/bin/${PLATFORM} SETPATH = PATH=".:${PROGDIR}:$$PATH"; export PATH # Which chain scale to use: FBAND = ${FILTERTAG}${BAND} # Output file names: OUTPREFIX := ${RUN}-${FBAND}-${CANDTAG} # Candidate file name CANDFILE := ${DATADIR}/results/${RUN}/${FBAND}-${CANDTAG} ifeq "${FILTERTAG}" "r" CURVEDIR := ${DATADIR}/data/fragments LAMBDA := 0.0 else CURVEDIR := ${DATADIR}/data/multiscale LAMBDA := ${shell echo `cat ${CURVEDIR}/f${BAND}.lambda`} endif STEP := ${shell gawk -v lam=${LAMBDA} 'BEGIN{printf "%.4f", lam/4;}'} PLOTSTEP := 5.0 # PZFindCluster options: CLUOPTS := -linTolerance 45 -angTolerance 0.50 sol-all: sol-findclusters sol-drawclusters sol-showclusters # sol-all: sol-findclusters sol-findclusters: ${OUTPREFIX}-fclu.log ${OUTPREFIX}-fclu.log: ${CANDFILE}.can Makefile ${PROGDIR}/PZFindClusters /bin/rm -rf ${OUTPREFIX}-*.pos ${OUTPREFIX}-*.can ${SETPATH}; PZFindClusters \ -input ${CANDFILE} \ -chainDir ${CURVEDIR} -chainPrefix ${FILTERTAG} \ -band ${BAND} \ -candsRange ${FIRSTCAND} ${LASTCAND} \ ${CLUOPTS} \ -output ${OUTPREFIX} -minClusterSize 2 \ | tee ${OUTPREFIX}-fclu.log sol-drawclusters: /bin/rm -f ${OUTPREFIX}-*.eps for clu in ${OUTPREFIX}-*.pos; do \ ${MAKE} SOL=${SOL} CLUPOSFILE=$$clu CLUGRAPHPREFIX=${OUTPREFIX} clu-draw; \ done sol-showclusters: for clu in ${OUTPREFIX}-*.pos; do \ ${MAKE} SOL=${SOL} CLUPOSFILE=$$clu CLUGRAPHPREFIX=${OUTPREFIX} clu-show; \ done sol-clean: /bin/rm -f ${OUTPREFIX}*.eps ${OUTPREFIX}*.pos ${OUTPREFIX}*.log /bin/rm -f ${OUTPREFIX}-tree.can ${OUTPREFIX}-ok.can ${OUTPREFIX}-bad.can # ====================================================================== # For doubly recursive "make" (once for each cluster found) # Caller must define ${SOL}, ${CLUPOSFILE}, ${CLUGRAPHPREFIX} # Positions of pieces in cluster: CLUPOSFILE = CLUPOSFILE.IS.UNDEFINED # Prefix for candidate files: "-tree.can", "-ok.can", "-bad.can" CLUGRAPHPREFIX = CLUGRAPHPREFIX.IS.UNDEFINED ifneq "${CLUPOSFILE}" "CLUPOSFILE.IS.UNDEFINED" CLUPREFIX := ${basename ${CLUPOSFILE}} CLUOUTPREFIX := ${CLUPREFIX} # Drawing program options: CLUDRAWOPTS := CLUDRAWOPTS := ${CLUDRAWOPTS} -scaleBar 1 -scaleBarStep 118.1 CLUDRAWOPTS := ${CLUDRAWOPTS} -labelSize 8 -labelFrames -spread 0.1 CLUDRAWOPTS := ${CLUDRAWOPTS} -grid 118.0 clu-draw: ${CLUOUTPREFIX}.eps ${CLUOUTPREFIX}.eps: ${CANDFILE}.can Makefile ${PROGDIR}/PZDrawCluster @echo CLUPOSFILE = "${CLUPOSFILE}" @echo CLUGRAPHPREFIX = "${CLUGRAPHPREFIX}" ${SETPATH}; PZDrawCluster @M3stackdump \ -input ${CLUPREFIX} \ -chainDir ${CURVEDIR} -chainPrefix ${FILTERTAG} \ -band ${BAND} -step ${PLOTSTEP} -blurFactor 3 \ -candSet ${CLUGRAPHPREFIX}-ok both lineWidth 0.20 color 0.0 0.5 0.0 \ -candSet ${CLUGRAPHPREFIX}-tree both lineWidth 0.20 color 0.0 0.0 0.0 \ -candSet ${CLUGRAPHPREFIX}-bad both lineWidth 0.10 color 1.0 0.0 0.0 \ -output ${CLUOUTPREFIX} \ -epsFormat \ -actualSize 160 160 -objectSize 1800 1800 \ ${CLUDRAWOPTS} \ | tee ${CLUOUTPREFIX}.log clu-show: ${CLUOUTPREFIX}.eps kghostview ${CLUOUTPREFIX}.eps clu-print: ${CLUOUTPREFIX}.eps cat ${CLUOUTPREFIX}.eps \ | gawk '/%%EOF/{print "showpage";} //{print}' \ | lpr -Ppr1 endif # End of single cluster part. # ====================================================================== endif # End of single sol part. # ======================================================================