diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-01-18 00:57:43 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-01-18 00:57:43 +0000 |
commit | 4483a81c4254596dd2fa977e7a2faf6f28a7ac6f (patch) | |
tree | 1150c399a436c0ef1c44d4f1673b6c85e1eaff4c | |
parent | 0c120cbc1575675f96a99703af28a45d8adda2db (diff) |
First set of customizations done
The unnecessary parts were removed and the project now runs.
-rw-r--r-- | paper.tex | 136 | ||||
-rw-r--r-- | reproduce/analysis/config/delete-me-num.mk | 2 | ||||
-rw-r--r-- | reproduce/analysis/config/verify-outputs.mk | 2 | ||||
-rw-r--r-- | reproduce/analysis/make/delete-me.mk | 129 | ||||
-rw-r--r-- | reproduce/analysis/make/top-make.mk | 1 | ||||
-rw-r--r-- | reproduce/analysis/make/verify.mk | 3 | ||||
-rw-r--r-- | reproduce/software/config/installation/TARGETS.mk | 4 | ||||
-rw-r--r-- | reproduce/software/config/installation/texlive.mk | 3 | ||||
-rw-r--r-- | tex/src/delete-me-demo.tex | 51 | ||||
-rw-r--r-- | tex/src/delete-me.tex | 32 |
10 files changed, 11 insertions, 352 deletions
@@ -56,17 +56,7 @@ %% Project abstract and keywords. \includeabstract{ - You have completed the reproducible paper template and are ready to - configure and implement it for your own research. This template contains - almost all the elements that you will need in a research project - containing the downloading of raw data and necessary software, building - the software, and processing the data with the software in a - highly-controlled environment. It then allows including the results in - plots and producing the final report, including this abstract, figures - and bibliography. If you design your project with this template's - infra-structure in your work, don't forget to add a notice and clearly - let the readers know that your work is reproducible. If this template - proves useful in your research, please cite \citet{gnuastro}. + To be filled. \vspace{0.25cm} @@ -84,117 +74,8 @@ %% Start of main body. -\section{Congratulations!} -Congratulations on running the raw template project! You can now follow the -checklist in the \texttt{README.md} file to customize this template to your -exciting research project. - -Just don't forget to \emph{never} use numbers or fixed strings (for example -database urls like \url{\wfpctwourl}) directly within your \LaTeX{} -source. Read them directly from your configuration files, or processing -outputs, and import them into \LaTeX{} as macros through the -\texttt{tex/build/macros/project.tex} file (created after running the -project). See the several existing examples within the template for a -demonstration. For some recent real-world examples, the reproducible -project sources for Sections 4 and 7.3 of \citet{bacon17} are available at -\href{https://doi.org/10.5281/zenodo.1164774}{zenodo.1164774}\footnote{\url{https://gitlab.com/makhlaghi/muse-udf-origin-only-hst-magnitudes}}, -or -\href{https://doi.org/10.5281/zenodo.1163746}{zenodo.1163746}\footnote{\url{https://gitlab.com/makhlaghi/muse-udf-photometry-astrometry}}. Working -in this way, will let you focus clearly on your science and not have to -worry about fixing this or that number/name in the text. - -Figure \ref{delete-me} shows a simple plot as a demonstration of creating -plots within \LaTeX{} (using the {\small PGFP}lots package). The minimum -value in this distribution is $\deletememin$, and $\deletememax$ is the -maximum. Take a look into the \LaTeX{} source and you'll see these numbers -are actually macros that were calculated from the same dataset (they will -change if the dataset, or function that produced it, changes). - -The individual {\small PDF} file of Figure \ref{delete-me} is available -under the \texttt{tex/tikz/} directory of your build directory. You can use -this PDF file in other contexts (for example in slides showing your -progress or after publishing the work). If you want to directly use the -{\small PDF} file in the figure without having to let {\small T}i{\small - KZ} decide if it should be remade or not, you can also comment the -\texttt{makepdf} macro at the top of this \LaTeX{} source file. - -\begin{figure}[t] - \includetikz{delete-me} - - \captionof{figure}{\label{delete-me} A very basic $X^2$ plot for - demonstration.} -\end{figure} - -Figure \ref{delete-me-demo} is another demonstration of showing images -(datasets) using PGFPlots. It shows a small crop of an image from the -Wide-Field Planetary Camera 2, on board the Hubble Space Telescope from -1993 to 2009. This cropped image is one of the sample FITS files from the -FITS file standard -webpage\footnote{\url{https://fits.gsfc.nasa.gov/fits_samples.html}}. Just -as another basic reporting of measurements on this dataset within the paper -without using numbers in the \LaTeX{} source, the mean is -$\deletemewfpctwomean$ and the median is $\deletemewfpctwomedian$. The -skewness in the histogram of Figure \ref{delete-me-demo}(b) explains this -difference between the mean and median. The dataset was prepared for -demonstration here with Gnuastro's \textsf{Convert\-Type} program and the -histogram and basic statstics were generated with Gnuastro's -\textsf{Statistics} program. - -{\small PGFP}lots\footnote{\url{https://ctan.org/pkg/pgfplots}} is a great -tool to build the plots within \LaTeX{} and removes the necessity to add -further dependencies (to create the plots) to your project. There are -high-level language libraries like Matplotlib which also generate -plots. However, the problem is that they require many dependencies (Python, -Numpy and etc). Installing these dependencies from source, is not easy and -will harm the reproducibility of your paper. Note that after several years, -the binary files of these high-level libraries, that you easily install -today, will no longer be available in common repositories. Therefore -building the libraries from source is the only option to reproduce your -results. - -Furthermore, since {\small PGFP}lots is built by \LaTeX{} it respects all -the properties of your text (for example line width and fonts and -etc). Therefore the final plot blends in your paper much more nicely. It -also has a wonderful -manual\footnote{\url{http://mirrors.ctan.org/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf}}. - -This template also defines two \LaTeX{} macros that allow you to mark text -within your document as \emph{new} and \emph{notes}. For example, \new{this - text has been marked as \texttt{new}.} \tonote{While this one is marked - as \texttt{tonote}.} If you comment the line (by adding a `\texttt{\%}' -at the start of the line or simply deleting the line) that defines -\texttt{highlightchanges}, then the one that was marked \texttt{new} will -become black (totally blend in with the rest of the text) and the one -marked \texttt{tonote} will not be in the final PDF. You can thus use -\texttt{highlightchanges} to easily make copies of your research for -existing coauthors (who are just interested in the new parts or notes) and -new co-authors (who don't want to be distracted by these issues in their -first time reading). - -\begin{figure}[t] - \includetikz{delete-me-demo} - - \captionof{figure}{\label{delete-me-demo} (a) An example image of the - Wide-Field Planetary Camera 2, on board the Hubble Space Telescope from - 1993 to 2009. This is one of the sample images from the FITS standard - webpage, kept as examples for this file format. (b) Histogram of pixel - values in (a).} -\end{figure} - - - -\section{Notice and citations} -To encourage other scientists to publish similarly reproducible papers, -please add a notice close to the start of your paper or in the end of the -abstract clearly mentioning that your work is fully reproducible. - -For the time being, we haven't written a specific paper only for this -template. Until then, we would be grateful if you could cite the first -paper that used the early versions of this template: \citet{gnuastro}. - -After publication, don't forget to upload all the necessary data, software -source code and the project's source to a long-lasting host like Zenodo -(\url{https://zenodo.org}). +\section{Introduction} + %% End of main body. @@ -202,15 +83,8 @@ source code and the project's source to a long-lasting host like Zenodo \section{Acknowledgements} -\new{Please include the following two paragraphs in the Acknowledgement - section of your paper. This reproducible paper template was developed in - parallel with Gnuastro, so it benefited from the same grants. If you - don't use Gnuastro in your final/customized project, please remove it - from the paragraph below, only mentioning the reproducible paper - template.} - -This research was partly done using GNU Astronomy Utilities (Gnuastro, -ascl.net/1801.009), and the reproducible paper template + +This research was partly done with the reproducible paper template \projectversion. Work on Gnuastro and the reproducible paper template has been funded by the Japanese Ministry of Education, Culture, Sports, Science, and Technology (MEXT) scholarship and its Grant-in-Aid for diff --git a/reproduce/analysis/config/delete-me-num.mk b/reproduce/analysis/config/delete-me-num.mk deleted file mode 100644 index 17f608c..0000000 --- a/reproduce/analysis/config/delete-me-num.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Number of samples to create -delete-me-num = 50 diff --git a/reproduce/analysis/config/verify-outputs.mk b/reproduce/analysis/config/verify-outputs.mk index 5d8eff1..e580e04 100644 --- a/reproduce/analysis/config/verify-outputs.mk +++ b/reproduce/analysis/config/verify-outputs.mk @@ -1,3 +1,3 @@ # To disable verification of output datasets set this variable to yes -verify-outputs = yes +verify-outputs = diff --git a/reproduce/analysis/make/delete-me.mk b/reproduce/analysis/make/delete-me.mk deleted file mode 100644 index 3ba4909..0000000 --- a/reproduce/analysis/make/delete-me.mk +++ /dev/null @@ -1,129 +0,0 @@ -# Dummy Makefile to create a random dataset for plotting. -# -# Copyright (C) 2018-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org> -# -# This Makefile is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This Makefile is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# A copy of the GNU General Public License is available at -# <http://www.gnu.org/licenses/>. - - - - - -# Dummy dataset -# ------------- -# -# We will use AWK to generate a table showing X and X^2 and draw its plot. -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. - rm -f $(tikzdir)/delete-me.pdf - - # Generate the table of random values. - awk 'BEGIN {for(i=1;i<=$(delete-me-num);i+=0.5) print i, i*i; }' > $@ - - - - - -# WFPC2 image PDF -# ----------------- -# -# For an example image, we'll make a PDF copy of the WFPC II image to -# display in the paper. -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. - rm -f $(tikzdir)/delete-me-wfpc2.pdf - - # Convert the dataset to a PDF. - astconvertt --colormap=gray --fluxhigh=4 $< -h0 -o$@ - - - - - -# Histogram of WFPC2 image -# ------------------------ -# -# For an example plot, we'll show the pixel value histogram also. -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. - 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/analysis/config/'. -delete-stats = $(delete-demodir)/wfpc2-stats.txt -$(delete-stats): $(delete-demodir)/%-stats.txt: $(indir)/%.fits \ - | $(delete-demodir) - aststatistics $< -h0 --mean --median > $@ - - - - - -# TeX macros -# ---------- -# -# This is how we write the necessary parameters in the final PDF. -# -# NOTE: In LaTeX you cannot use any non-alphabetic character in a variable -# name. -$(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)}" > $@ - - # Note that since Make variables start with a `$(', if you want to - # use `$' within the shell (not Make), you have to quote any - # occurance of `$' with another `$'. That is why there are `$$' in - # the AWK command below. - # - # Here, we are first using AWK to find the minimum and maximum - # 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}' $(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)}' $(delete-stats)) - echo "\newcommand{\deletemewfpctwomean}{$$mean}" >> $@ - median=$$(awk '{printf("%.2f", $$2)}' $(delete-stats)) - echo "\newcommand{\deletemewfpctwomedian}{$$median}" >> $@ diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk index 0292d3c..acbbafa 100644 --- a/reproduce/analysis/make/top-make.mk +++ b/reproduce/analysis/make/top-make.mk @@ -112,7 +112,6 @@ endif # wild-card like the configuration Makefiles). makesrc = initialize \ download \ - delete-me \ verify \ paper diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk index 1173f2c..a04bce4 100644 --- a/reproduce/analysis/make/verify.mk +++ b/reproduce/analysis/make/verify.mk @@ -114,8 +114,7 @@ $(mtexdir)/verify.tex: $(foreach s, $(verify-dep), $(mtexdir)/$(s).tex) # Verify TeX macros (the values that go into the PDF text). for m in $(verify-check); do file=$(mtexdir)/$$m.tex - if [ $$m == delete-me ]; then s=711e2f7fa1f16ecbeeb3df6bcb4ec705 - elif [ $$m == download ]; then s=6749e17ce606d57d30cebdbc1a5d23ad + if [ $$m == download ]; then s=XXXXX else echo; echo "'$$m' not recognized."; exit 1 fi $(call verify-txt-no-comments-leading-space, $$file, $$s) diff --git a/reproduce/software/config/installation/TARGETS.mk b/reproduce/software/config/installation/TARGETS.mk index 164d606..2ffdbfe 100644 --- a/reproduce/software/config/installation/TARGETS.mk +++ b/reproduce/software/config/installation/TARGETS.mk @@ -36,7 +36,7 @@ # Programs and libraries. -top-level-programs = gnuastro +top-level-programs = # Python libraries/modules. -top-level-python = astropy +top-level-python = diff --git a/reproduce/software/config/installation/texlive.mk b/reproduce/software/config/installation/texlive.mk index 5681795..c53e170 100644 --- a/reproduce/software/config/installation/texlive.mk +++ b/reproduce/software/config/installation/texlive.mk @@ -20,4 +20,5 @@ texlive-packages = tex fancyhdr ec newtx fontaxes xkeyval etoolbox xcolor \ setspace caption footmisc datetime fmtcount titlesec \ preprint ulem biblatex biber logreq pgf pgfplots fp \ courier tex-gyre txfonts times csquotes kastrup \ - trimspaces pdftexcmds pdfescape letltxmacro bitset + trimspaces pdftexcmds pdfescape letltxmacro bitset \ + mweights diff --git a/tex/src/delete-me-demo.tex b/tex/src/delete-me-demo.tex deleted file mode 100644 index a4f8d42..0000000 --- a/tex/src/delete-me-demo.tex +++ /dev/null @@ -1,51 +0,0 @@ -%% Plot the demonstration image and its histogram. -% -%% Copyright (C) 2019-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org> -% -%% This template is free software: you can redistribute it and/or modify it -%% under the terms of the GNU General Public License as published by the -%% Free Software Foundation, either version 3 of the License, or (at your -%% option) any later version. -% -%% This template is distributed in the hope that it will be useful, but -%% WITHOUT ANY WARRANTY; without even the implied warranty of -%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%% General Public License for more details. -% -%% You should have received a copy of the GNU General Public License along -%% with this template. If not, see <http://www.gnu.org/licenses/>. - -\begin{tikzpicture} - - %% The displayed WFPC2 image. - \node[anchor=south west] (img) at (0,0) - {\includegraphics[width=0.5\linewidth] - {tex/build/delete-me-demo/wfpc2.pdf}}; - - %% Its label - \node[anchor=south west] at (0.45\linewidth,0.45\linewidth) - {\textcolor{white}{a}}; - - %% This histogram. - \begin{axis}[at={(0.52\linewidth,0.1\linewidth)}, - no markers, - axis on top, - xmode=normal, - ymode=normal, - yticklabels={}, - scale only axis, - xlabel=Pixel value, - width=0.5\linewidth, - height=0.412\linewidth, - enlarge y limits=false, - enlarge x limits=false, - ] - \addplot [const plot mark mid, fill=red] - table [x index=0, y index=1] - {tex/build/delete-me-demo/wfpc2-hist.txt} - \closedcycle; - \end{axis} - - %% The histogram's label - \node[anchor=south west] at (0.95\linewidth,0.45\linewidth) {b}; -\end{tikzpicture} diff --git a/tex/src/delete-me.tex b/tex/src/delete-me.tex deleted file mode 100644 index ae68441..0000000 --- a/tex/src/delete-me.tex +++ /dev/null @@ -1,32 +0,0 @@ -%% PGFPlots code to plot a random set of numbers as demo -%% -%% Copyright (C) 2019-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org> -% -%% This template is free software: you can redistribute it and/or modify it -%% under the terms of the GNU General Public License as published by the -%% Free Software Foundation, either version 3 of the License, or (at your -%% option) any later version. -% -%% This template is distributed in the hope that it will be useful, but -%% WITHOUT ANY WARRANTY; without even the implied warranty of -%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%% General Public License for more details. -% -%% You should have received a copy of the GNU General Public License along -%% with this template. If not, see <http://www.gnu.org/licenses/>. - -\begin{tikzpicture} - - %% Settings of the plotted axis - \begin{axis}[ - width=\linewidth, - xlabel=$X$, - ylabel=$X^2$, - ] - - %% A particular plot. - \addplot+[scatter, only marks] - table {tex/build/delete-me-num/data.txt}; - - \end{axis} -\end{tikzpicture} |