aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make/delete-me.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-25 15:22:48 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-25 15:41:00 +0000
commite623102768c426e86b0ed73904168006dfea2af9 (patch)
treeea5f0d95219398ff47fb0dc8ef92aa5e5173a956 /reproduce/src/make/delete-me.mk
parent91eebe85edf38338bc4baed58d6a970c0f6b6b79 (diff)
Pipeline now downloads and uses an input dataset
In most analysis situations (except for simulations), an input dataset is necessary, but that part of the pipeline was just left out and a general `SURVEY' variable was set and never used. So with this commit, we actually use a sample FITS file from the FITS standard webpage, show it (as well as its histogram) and do some basic calculations on it. This preparation of the input datasets is done in a generic way to enable easy addition of more datasets if necessary.
Diffstat (limited to 'reproduce/src/make/delete-me.mk')
-rw-r--r--reproduce/src/make/delete-me.mk71
1 files changed, 67 insertions, 4 deletions
diff --git a/reproduce/src/make/delete-me.mk b/reproduce/src/make/delete-me.mk
index 67f0440..9227fde 100644
--- a/reproduce/src/make/delete-me.mk
+++ b/reproduce/src/make/delete-me.mk
@@ -25,8 +25,7 @@
# Dummy dataset
# -------------
#
-# We will use AWK's random number generator to generate a random dataset to
-# be imported by PGFPlots for a plot in the paper.
+# 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 $@
@@ -43,6 +42,60 @@ $(dm): $(pconfdir)/delete-me-num.mk | $(dmdir)
+# WFPC2 image PDF
+# -----------------
+#
+# For an example image, we'll make a PDF copy of the WFPC II image to
+# display in the paper.
+wfpc2dir = $(texdir)/delete-me-wfpc2
+$(wfpc2dir): | $(texdir); mkdir $@
+wfpc2 = $(wfpc2dir)/wfpc2.pdf
+$(wfpc2): $(indir)/$(WFPC2IMAGE) | $(wfpc2dir)
+
+ # When the plotted values are re-made, it is necessary to also
+ # delete the TiKZ externalized files so the plot is also re-made.
+ rm -f $(tikzdir)/delete-me-wfpc2.pdf
+
+ # Convert the dataset to a PDF.
+ astconvertt --fluxhigh=4 $< -h0 -o$@
+
+
+
+
+
+# Histogram of WFPC2 image
+# ------------------------
+#
+# For an example plot, we'll show the pixel value histogram also.
+wfpc2hist = $(wfpc2dir)/wfpc2-hist.txt
+$(wfpc2hist): $(indir)/$(WFPC2IMAGE) | $(wfpc2dir)
+
+ # When the plotted values are re-made, it is necessary to also
+ # delete the TiKZ externalized files so the plot is also re-made.
+ rm -f $(tikzdir)/delete-me-wfpc2.pdf
+
+ # Generate the pixel value distribution
+ aststatistics --lessthan=5 $< -h0 --histogram -o$@
+
+
+
+
+
+# Basic statistics
+# ----------------
+#
+# This is just as a demonstration on how to get analysic configuration
+# parameters from variables defined in `reproduce/config/pipeline'.
+wfpc2stats = $(wfpc2dir)/wfpc2-stats.txt
+$(wfpc2stats): $(indir)/$(WFPC2IMAGE) $(pconfdir)/delete-me-wfpc2-quant.mk \
+ | $(wfpc2dir)
+ aststatistics $< -h0 --mean --median \
+ --quantile=$(delete-me-wfpc2-quantile) > $@
+
+
+
+
+
# TeX macros
# ----------
#
@@ -50,7 +103,7 @@ $(dm): $(pconfdir)/delete-me-num.mk | $(dmdir)
#
# NOTE: In LaTeX you cannot use any non-alphabetic character in a variable
# name.
-$(mtexdir)/delete-me.tex: $(dm)
+$(mtexdir)/delete-me.tex: $(dm) $(wfpc2) $(wfpc2hist) $(wfpc2stats)
# Write the number of random values used.
echo "\newcommand{\deletemenum}{$(delete-me-num)}" > $@
@@ -67,6 +120,16 @@ $(mtexdir)/delete-me.tex: $(dm)
{if($$2>max) max=$$2; if($$2<min) min=$$2;}
END{print min, max}' $(dm));
v=$$(echo "$$mm" | awk '{printf "%.3f", $$1}');
- echo "\newcommand{\deletememin}{$$v}" >> $@;
+ 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.
+ q=$(delete-me-wfpc2-quantile)
+ echo "\newcommand{\deletemewfpcquantile}{$$q}" >> $@
+ mean=$$(awk '{printf("%.2f", $$1)}' $(wfpc2stats))
+ echo "\newcommand{\deletemewfpctwomean}{$$mean}" >> $@
+ median=$$(awk '{printf("%.2f", $$2)}' $(wfpc2stats))
+ echo "\newcommand{\deletemewfpctwomedian}{$$median}" >> $@
+ quantile=$$(awk '{printf("%.2f", $$3)}' $(wfpc2stats))
+ echo "\newcommand{\deletemewfpctwoquantile}{$$quantile}" >> $@