# Last edited on 2008-02-04 13:01:49 by stolfi # Creates "eps" figures showing close-ups of selected candidates found # by the program (FILTERTAG = "f", REFINETAG = "r"). Also generates # figures that show the accuracy of the data acquisition protocol # (FILTERTAG = "r", REFINETAG = "t"). DATASET = ceramic-3 RUN = 2 FIGS = \ 0089-0106-r000-t \ \ 0067-0096-f002-r \ \ 0047-0100-f002-r \ 0019-0049-f002-r \ 0042-0044-f002-r \ \ 0093-0101-f002-r \ 0080-0108-f002-r \ 0082-0099-f002-r \ \ 0060-0068-f002-r .PHONY: all clean single clean: /bin/rm -f ${addsufix .eps ${FIGS}} all: clean for fig in ${FIGS}; do \ ${MAKE} FIG=$$fig single; \ done # ====================================================================== # For recursive "make" only -- caller must define ${FIG} FIG = FIG.IS.UNDEFINED ifneq "${FIG}" "FIG.IS.UNDEFINED" # 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/ceramic-3 PROGDIR = ${STOLFIHOME}/programs/pm3-1.1.15/THESES/hcgl/1/bin/${PLATFORM} SETPATH = PATH=".:${PROGDIR}:$$PATH"; export PATH FIELDS := ${subst -, ,${FIG}} FRAGA := ${word 1,${FIELDS}} FRAGB := ${word 2,${FIELDS}} FBAND := ${word 3,${FIELDS}} REFINETAG := ${word 4,${FIELDS}} FILTERTAG := ${shell echo ${FBAND} | sed -e 's/[0-9]//g'} BAND := ${shell echo ${FBAND} | sed -e 's/^.//'} # The ${REFINETAG} tells which candidates to use: ifeq "${REFINETAG}" "r" CANDDIR := ${DATADIR}/results/run-${RUN} else CANDDIR := ${DATADIR}/results/by-hand endif # The ${FILTERTAG} tells which outlines to draw: 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;}'} ALLCANDS := ${CANDDIR}/f${BAND}-${REFINETAG} # Isolate the candidate from the run results: SINGLECAND := ${FRAGA}-${FRAGB}-${FBAND}-${REFINETAG}-s TEMPCAND := /tmp/${SINGLECAND}-x ${SINGLECAND}.can: Makefile ${ALLCANDS}.can cat ${ALLCANDS}.can \ | gawk -v fa=${FRAGA} -v fb=${FRAGB} \ ' /^(begin|end|lambda|candidates) / { print; next; } \ (($$1 == fa+0) && ($$6 == fb+0)) { print; next; } \ (($$6 == fa+0) && ($$1 == fb+0)) { print; next; } \ ' \ > ${TEMPCAND}.can ncands=`cat ${TEMPCAND}.can | egrep '^[0-9]' | wc -l`; export ncands; \ echo "found $$ncands candidates"; \ { cat ${TEMPCAND}.can \ | gawk -v ncd="$$ncands" \ ' /^candidates /{ $$3 = ncd; } //{print; } ' \ > ${SINGLECAND}.can; } && \ if [ $$ncands == 0 ]; then exit 1; fi /bin/rm -f ${TEMPCAND}.can # Plot the candidate as an EPS file: # Decide style options OPTS := -noColors -noPointers -scaleBar 1 -scaleBarStep 11.81 OPTS := ${OPTS} -labelSize 0 -mismatchSize 0 OPTS := ${OPTS} -displace 20 ifeq "${REFINETAG}" "t" OPTS := ${OPTS} -noThicker endif # Decide plotting resolution for the chains: OPTS := ${OPTS} ${shell \ if [ ${BAND} -ge 032 ]; then \ echo ' -drawAllSamples -sampleDots'; \ elif [ ${BAND} == 000 ]; then \ echo ' -drawAllSamples'; \ fi} # Decide whether to show the matching, and its resolution: OPTS := ${OPTS} ${shell \ if [ "${REFINETAG}" == "r" ]; then \ if [ ${BAND} == 000 ]; then \ dm=1; \ elif [ ${BAND} -le 064 ]; then \ dm=`echo "scale=0; 64 / ${BAND}" | bc -q`; \ else \ dm=1; \ fi; \ echo ' -drawMatchEvery' $$dm; \ fi} EPSNAME := ${SINGLECAND} single: ${EPSNAME}.eps ${EPSNAME}.eps: ${SINGLECAND}.can Makefile ${PROGDIR}/PZDrawCands @echo "lambda = ${LAMBDA} step = ${STEP}" ${SETPATH}; nice PZDrawCands \ -input ${SINGLECAND} \ -chainDir ${CURVEDIR} -chainPrefix ${FILTERTAG} \ -band ${BAND} -step ${STEP} \ -output ${EPSNAME} \ -epsFormat \ -maxCands 60 \ -actualSize 120 20 -objectSize 720 120 \ ${OPTS} for f in ${EPSNAME}-00*.eps; do \ ghostview $$f; echo foo; \ done endif # End of "single" part. # ======================================================================