aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis/make/delete-me.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-01-01 19:39:36 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-01-01 20:12:07 +0000
commitbc860926afc0f5486d59f3f186847445bf6f314a (patch)
tree77b7659805c7706e453ceb2b85ed2b8103a30e5d /reproduce/analysis/make/delete-me.mk
parent3d8e3fc072525f0b811a8b104a944cc6fbf76c1c (diff)
Verification of output values and data added within template
Until now, the only verification that the template provided was the published PDF. Users had to manually compare the published and generated PDFs (numbers, plots, tables) and see if they obtained the same result. However, this type of manual verification is not good and is prone to frustration and missing important differences. With this commit, a new Makefile has been added in the analysis steps: `verify.mk'. It provides facilities to easily verify the results that go into the paper. For example tables that go into making the paper's plots, or the LaTeX macros that blend into the text. See the updated parts in `README-hacking.md` for a more complete explanation. This completes task #15497.
Diffstat (limited to 'reproduce/analysis/make/delete-me.mk')
-rw-r--r--reproduce/analysis/make/delete-me.mk37
1 files changed, 20 insertions, 17 deletions
diff --git a/reproduce/analysis/make/delete-me.mk b/reproduce/analysis/make/delete-me.mk
index eb6d919..3ba4909 100644
--- a/reproduce/analysis/make/delete-me.mk
+++ b/reproduce/analysis/make/delete-me.mk
@@ -23,10 +23,10 @@
# -------------
#
# We will use AWK to generate a table showing X and X^2 and draw its plot.
-dmdir = $(texdir)/delete-me
-dm = $(dmdir)/data.txt
-$(dmdir): | $(texdir); mkdir $@
-$(dm): $(pconfdir)/delete-me-num.mk | $(dmdir)
+delete-numdir = $(texdir)/delete-me-num
+delete-num = $(delete-numdir)/data.txt
+$(delete-numdir): | $(texdir); mkdir $@
+$(delete-num): $(pconfdir)/delete-me-num.mk | $(delete-numdir)
# When the plotted values are re-made, it is necessary to also
# delete the TiKZ externalized files so the plot is also re-made.
@@ -44,10 +44,10 @@ $(dm): $(pconfdir)/delete-me-num.mk | $(dmdir)
#
# For an example image, we'll make a PDF copy of the WFPC II image to
# display in the paper.
-dddemodir = $(texdir)/delete-me-demo
-$(dddemodir): | $(texdir); mkdir $@
-demopdf = $(dddemodir)/wfpc2.pdf
-$(demopdf): $(dddemodir)/%.pdf: $(indir)/%.fits | $(dddemodir)
+delete-demodir = $(texdir)/delete-me-demo
+$(delete-demodir): | $(texdir); mkdir $@
+delete-pdf = $(delete-demodir)/wfpc2.pdf
+$(delete-pdf): $(delete-demodir)/%.pdf: $(indir)/%.fits | $(delete-demodir)
# When the plotted values are re-made, it is necessary to also
# delete the TiKZ externalized files so the plot is also re-made.
@@ -64,8 +64,9 @@ $(demopdf): $(dddemodir)/%.pdf: $(indir)/%.fits | $(dddemodir)
# ------------------------
#
# For an example plot, we'll show the pixel value histogram also.
-histogram = $(dddemodir)/wfpc2-hist.txt
-$(histogram): $(dddemodir)/%-hist.txt: $(indir)/%.fits | $(dddemodir)
+delete-histogram = $(delete-demodir)/wfpc2-hist.txt
+$(delete-histogram): $(delete-demodir)/%-hist.txt: $(indir)/%.fits \
+ | $(delete-demodir)
# When the plotted values are re-made, it is necessary to also
# delete the TiKZ externalized files so the plot is also re-made.
@@ -83,8 +84,9 @@ $(histogram): $(dddemodir)/%-hist.txt: $(indir)/%.fits | $(dddemodir)
#
# This is just as a demonstration on how to get analysic configuration
# parameters from variables defined in `reproduce/analysis/config/'.
-stats = $(dddemodir)/wfpc2-stats.txt
-$(stats): $(dddemodir)/%-stats.txt: $(indir)/%.fits | $(dddemodir)
+delete-stats = $(delete-demodir)/wfpc2-stats.txt
+$(delete-stats): $(delete-demodir)/%-stats.txt: $(indir)/%.fits \
+ | $(delete-demodir)
aststatistics $< -h0 --mean --median > $@
@@ -98,7 +100,8 @@ $(stats): $(dddemodir)/%-stats.txt: $(indir)/%.fits | $(dddemodir)
#
# NOTE: In LaTeX you cannot use any non-alphabetic character in a variable
# name.
-$(mtexdir)/delete-me.tex: $(dm) $(demopdf) $(histogram) $(stats)
+$(mtexdir)/delete-me.tex: $(delete-num) $(delete-pdf) $(delete-histogram) \
+ $(delete-stats)
# Write the number of random values used.
echo "\newcommand{\deletemenum}{$(delete-me-num)}" > $@
@@ -112,15 +115,15 @@ $(mtexdir)/delete-me.tex: $(dm) $(demopdf) $(histogram) $(stats)
# values, then using it again to read each separately to use in the
# macro definition.
mm=$$(awk 'BEGIN{min=99999; max=-min}
- {if($$2>max) max=$$2; if($$2<min) min=$$2;}
- END{print min, max}' $(dm));
+ !/^#/{if($$2>max) max=$$2; if($$2<min) min=$$2;}
+ END{print min, max}' $(delete-num));
v=$$(echo "$$mm" | awk '{printf "%.3f", $$1}');
echo "\newcommand{\deletememin}{$$v}" >> $@
v=$$(echo "$$mm" | awk '{printf "%.3f", $$2}');
echo "\newcommand{\deletememax}{$$v}" >> $@
# Write the statistics of the WFPC2 image as a macro.
- mean=$$(awk '{printf("%.2f", $$1)}' $(stats))
+ mean=$$(awk '{printf("%.2f", $$1)}' $(delete-stats))
echo "\newcommand{\deletemewfpctwomean}{$$mean}" >> $@
- median=$$(awk '{printf("%.2f", $$2)}' $(stats))
+ median=$$(awk '{printf("%.2f", $$2)}' $(delete-stats))
echo "\newcommand{\deletemewfpctwomedian}{$$median}" >> $@