Commit 1f5b0616 authored by Mohammad Akhlaghi's avatar Mohammad Akhlaghi

Plots are built in description.pdf

PDF plots of the magnitude differences are now made and included in
the description. Currently, the description doesn't have any text, but
tha will be added when everything is thoroughly checked.
parent 69a635ba
*~
*.txt
*.aux
*.bbl
*.pdf
reproduce/build
\ No newline at end of file
tikz/
reproduce/build
tex/pipeline.tex
\ No newline at end of file
......@@ -42,24 +42,7 @@ include reproduce/config/internal/*.mk
# First goal is the default
# -------------------------
all: $(BSYM) file.txt
# Top directories under BDIR
# --------------------------
#
# The outputs of the separate steps will be in the build directory. We
# don't want to repeatedly call a command to build those directories,
# so we are defining a pattern rule to do the job for any similarly
# formatted directory. Just note that it is important that you do not
# put a `/' after the directory name when defining its variable, since
# in a pattern rule, an ending `/' will not match. Add the `/'
# everytime you want to call the directory variable.
$(BDIR)/%: | $(BDIR);
mkdir $@
all: $(BSYM) description.pdf
......@@ -81,7 +64,7 @@ $(BDIR)/%: | $(BDIR);
# Note that we cannot simply include `reproduce/src/*.mk'. Because the
# order of reading them into Make actually matters in some cases.
include $(foreach m, preparations download degrade-hst input-cutouts \
catalog, reproduce/src/$(m).mk)
catalog description, reproduce/src/$(m).mk)
......
%% extarticle is part of the extsizes package, which provides extended
%% sizes for the standard classes.
\documentclass{extarticle}
%% If you want to use PDF files (and not build them with TikZ), then
%% comment the next line. To use PDF files, they have to be in a
%% `tikz' directory. To MAKE PDF files with TikZ and PGFPlots, it is
%% assumed that the texfile containing the source are in a `tex'
%% subdirectory relative to the directory which latex is run in.
\newcommand{\makepdf}{}
%% To high-light notes/changes, uncomment this macro:
\newcommand{\highlightchanges}{}
%% Input the style dependent and necessary (style independent)
%% preamble.
\input{tex/preamble-style.tex}
\input{tex/preamble-biblatex.tex}
\input{tex/preamble-necessary.tex}
%% Start the main body
\begin{document}
%% Set the two column structure and build the title.
%%\twocolumn[
%% \begin{@twocolumnfalse}
%% {\setstretch{1.0}
%% \maketitle
%% }
%% \end{@twocolumnfalse}
%%]
%%\setlength{\leftskip}{0pt}
%%\setlength{\rightskip}{0pt}
\twocolumn
%% With the ulem package, marked text will be broken into separate
%% lines. However, it will also cause the `\emph' command to underline
%% the text, instead of making it italic. With this command, `\emph'
%% will behave normally.
\normalem
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf-f606w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure0.pdf}
\fi
\caption{\label{udff606w} UDF F606W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf-f775w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure1.pdf}
\fi
\caption{\label{udff775} UDF F775W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf-f814w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure2.pdf}
\fi
\caption{\label{udf814w} UDF F814W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf-f850lp}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure3.pdf}
\fi
\caption{\label{udff850lp} UDF F850LP comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf10-f606w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure4.pdf}
\fi
\caption{\label{udf10f606w} UDF10 F606W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf10-f775w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure5.pdf}
\fi
\caption{\label{udf10f775} UDF10 F775W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf10-f814w}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure6.pdf}
\fi
\caption{\label{udf10f814w} UDF10 F814W comparison}
\end{figure}
\begin{figure}
\centering
\ifdefined\makepdf
\input{./tex/udf10-f850lp}
\else
\includegraphics[width=\linewidth]{./tikz/paper-figure7.pdf}
\fi
\caption{\label{udf10f850lp} UDF10 F850LP comparison}
\end{figure}
\printbibliography
\end{document}
# Make a 2D histogram of the input data.
#
# Copyright (C) 2016, Mohammad Akhlaghi <mohammad.akhlaghi@univ-lyon1.fr>
#
# This script 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 script 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. See
# <http://www.gnu.org/licenses/>.
#
#
#
#
# This script goes over the given input column and counts how many of
# the data elements (rows) are within the given range.
#
# Library functions:
# ==================
#
# This program needs two outside functions:
#
# checkifset()
# checkifint()
#
#
# Variables:
# ==========
#
# xmin: Minimum value for the histogram.
# xmax: Maximum value for the histogram.
# xnumbins: Number of bins in the histogram.
# ymin: Minimum value for the histogram.
# ymax: Maximum value for the histogram.
# ynumbins: Number of bins in the histogram.
# col: The column that should be used.
# showemptylast: If ==1, then show the last bins if
# they empty (with a zero value).
# extraout: Add an extra empty bin on each side.
#
# Example:
# ========
#
# Lets assume you have put all the variables into the shell variable
# AWKVAR. So you can run this script with:
#
# awk $AWKVAR -i /path/to/checks.awk -f /path/to/histogram.awk input.txt
# Do the preparations:
BEGIN {
# Check if all the variables are set:
checkifset(xmax, "xmax")
checkifset(xmin, "xmin")
checkifset(xmax, "ymax")
checkifset(xmin, "ymin")
checkifset(xnumbins, "xnumbins")
checkifset(xnumbins, "ynumbins")
# Set the optional parameters.
if(extraout=="") extraout=0
# Set the required variables (macros)
xwidth=(xmax-xmin)/xnumbins
ywidth=(ymax-ymin)/ynumbins
}
# Go over each line (record) in the input file. If it is commented
# (starts with a #) then ignore it. This histogram finding method uses
# the special feature of AWK arrays: that the indexs have names, they
# are not ordered, they can be added any time and they initiate with
# zero. For each field checked, the appropriate counter is incremented
# by one.
$0 !~ /^#/ {
# If the value is smaller or larger than the desired region, then
# go to the next record. This is not of interest.
if($1 < xmin || $1 > xmax || $2 < ymin || $2 > ymax) next
# Find the middle point of the bin point for row.
xmidbin = xmin + int( ($1-xmin)/xwidth )*xwidth + xwidth/2
ymidbin = ymin + int( ($2-ymin)/ywidth )*ywidth + ywidth/2
# If $1==xmax, or $2==ymax then the midbins will be larger than
# the maximum value. In that case, we want it to be added to the
# last bin.
if(xmidbin>xmax) {
if($1==xmax) xmidbin-=xwidth
else next
}
# Convert the midbin value to a string, so floating point errors
# don't bother with the counting.
strmidbin=sprintf("%-10.3f%-10.3f", xmidbin, ymidbin)
# Increment the value of this bin by one.
histogram[strmidbin]++;
}
# Print out the results.
END {
minix = extraout==0 ? 0 : -1;
maxix = extraout==0 ? xnumbins : xnumbins+1;
miniy = extraout==0 ? 0 : -1;
maxiy = extraout==0 ? ynumbins : ynumbins+1;
for(x=minix; x<maxix; ++x){
for(y=miniy; y<maxiy; ++y){
# Set the string value of this bin (to read from the array).
strmidbin=sprintf("%-10.3f%-10.3f", xmin+x*xwidth+xwidth/2,
ymin+y*ywidth+ywidth/2)
# Print this value
printf("%-10.3f%-10.3f%-5d\n", xmin+x*xwidth+xwidth/2,
ymin+y*ywidth+ywidth/2, histogram[strmidbin])
}
}
}
......@@ -248,5 +248,43 @@ $(fullmosaic): $(ccatdir)/udf-%.txt: $$(foreach i, 1 2 3 4 5 6 7 8 9, \
file.txt: $(fulludf)
@echo; echo "reached end"; echo;
# Prepare 2D histograms
# ---------------------
#
# For time being, we are plotting 2D histograms.
twodxmin=23
twodxmax=30
twodxnbins=40
twodymin=-1.0125
twodymax=1.0125
twodynbins=42
twoddir = $(BDIR)/tex/2D-histograms
two-d-hists = $(foreach field, udf udf10, \
$(foreach filter, $(filters), \
$(twoddir)/$(field)-$(filter).txt) )
$(two-d-hists): $(twoddir)/%.txt: $(ccatdir)/%.txt | $(twoddir)
# Pull out the two columns to generate the histogram
awk '!/^#/{print $$5, $$8}' $(ccatdir)/$*.txt > $(twoddir)/$*_fh.txt
# Generate the 2D histogram.
awk -vxmin=$(twodxmin) -vxmax=$(twodxmax) -vymin=$(twodymin) \
-vymax=$(twodymax) -vxnumbins=$(twodxnbins) \
-vynumbins=$(twodynbins) -vcol=8 -vshowemptylast=1 \
-vextraout=0 -i reproduce/src/checks.awk \
-f reproduce/src/2dhist.awk $(twoddir)/$*_fh.txt > $@
# Clean up
rm $(twoddir)/$*_fh.txt
# TeX macros
# ----------
$(mtexdir)/catalog.tex: $(two-d-hists) | $(mtexdir)
echo "\\newcommand{\\twodxmin}{$(twodxmin)}" > $@
echo "\\newcommand{\\twodxmax}{$(twodxmax)}" >> $@
echo "\\newcommand{\\twodxnbins}{$(twodxnbins)}" >> $@
echo "\\newcommand{\\twodynbins}{$(twodynbins)}" >> $@
# checks.awk: Library of checks for awk programs.
#
# These are some functions that can be used in any awk script to check
# if the necessary variables are set and if they have certain
# properties (for example being an integer). This library can be
# included into any AWK script using the -i option:
#
# awk -v var1=value1 -v var2=value2 -i this/library -f prog.awk
#
# Copyright (C) 2015, Mohammad Akhlaghi <akhlaghi@gnu.org>
#
# checks.awk 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.
#
# checks.awk 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. See
# <http://www.gnu.org/licenses/>.
# Check if the variable is set (not equal to the empty string).
function checkifset(variable, varname)
{
if(variable==""){
print varname " is not set!" > "/dev/stderr"
exit 1
}
}
# Check if the variable is an integer (mainly for column variables).
function checkifint(variable, varname)
{
if(variable!=int(variable)){
printf ("%s (%s) is not an integer!\n", varname, variable) \
> "/dev/stderr"
exit 1
}
}
# Build the report describing the pipeline. This text/figures is
# finally planned to be a section of the MUSE UDF paper.
#
# This Makefile is indented to be included by a Makefile that is in
# the top directory of this script.
#
# Copyright (C) 2016, Mohammad Akhlaghi <mohammad.akhlaghi@univ-lyon1.fr>
#
# 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. See
# <http://www.gnu.org/licenses/>.
# Build the tikz directory
# ------------------------
#
# TeX's TikZ tool (along with PGFPlots) is used to build all the
# images in the paper. In order to do its job fast and not have to
# rebuild the images on each run of LaTeX we are using its external
# feature so the image is rebuilt only when necessary. All the
# internal TikZ information for each figure is kept in this directory.
tikz:; mkdir tikz
# Merge all LaTeX macros
# ----------------------
#
# All the separate makefiles wrote their necessary information for the
# paper in the $(mtexdir) directory. Here, we will just concatenate
# all of them into one file to easily import into the LaTeX source of
# the paper.
#
# IMPORTANT NOTE: we cannot simply put `$(mtexdir)/*.tex' for the list
# of prerequisites because all these files are targets them selves and
# do not necessarily exist before Make actually starts (for example
# when the pipeline is run for the first time). You just have to add
# their root filename to the prerequisites list manually here.
tex/pipeline.tex: $(foreach t, versions catalog, $(mtexdir)/$(t).tex)
echo "\\newcommand{\\buildtexdir}{$(BDIR)/tex}" > $@
cat $^ >> $@
# BibLaTeX references
# -------------------
#
# To build the BibLaTeX references, we need to run LaTeX once and then
# biber, the rule for building the final PDF will build the final PDF.
description.bbl: tex/ref.tex tex/pipeline.tex | tikz
if pdflatex -shell-escape -halt-on-error description.tex; then \
echo "LaTeX (in preparation for BibLaTeX) is done."; \
else \
rm -f *.auxlock *.bcf *.run.xml *.blg *.aux *.log *.out; \
exit 1; \
fi;
biber description.bcf
pdflatex -shell-escape description.tex;
# Build final PDF
# ---------------
#
# Note that eventhough `tex/pipeline.tex' is in the `tex/' directory
# `tex/*' will not detect it necessarily because it might not be
# present (it is a target to be built by Make).
description.pdf: description.tex tex/* tex/pipeline.tex description.bbl \
$(two-d-hists) | tikz
# Delete some outputs for TeX to rebuild (if needed)
# rm tikz/description-figure0*
# Build the PDF
if pdflatex -shell-escape -halt-on-error description.tex; then \
echo "LaTeX is done."; \
else \
rm description.aux; \
exit 1; \
fi
# Clean up
rm -f description.log description.out description.bcf
rm -f description.blg description.run.xml description.auxlock
# Alert that the versions.tex file is not necessarily up to date
@echo; echo; echo; echo "NOTE: Before sharing this PDF, make sure you have committed your changes, delete $(mtexdir)/versions.tex and run 'make' again so the PDF is stamped with the most recent version."
......@@ -35,8 +35,28 @@ endif
# Version information
# -------------------
# Top directories under BDIR and $(BDIR)/tex
# ------------------------------------------
#
# The outputs of the separate steps will be in the build directory,
# and all the TeX related output are stored in `$(BDIR)/tex'. We don't
# want to repeatedly call a command to build those directories, so we
# are defining a pattern rule to do the job for any similarly
# formatted directory.
#
# Just note that it is important that you do not put a `/' after the
# directory name when defining its variable, since in a pattern rule,
# an ending `/' will not match. Add the `/' everytime you want to call
# the directory variable.
mtexdir = $(BDIR)/tex/macros
$(BDIR)/%: | $(BDIR); mkdir -p $@
# Version information and TeX macros
# ----------------------------------
#
# Write all the necessary information into the TeX file. The versions
# need to be updated whenever the Git file has been updated (for
......
%
% These Macros are taken from the AAS TeX macro package version 5.2
% and are compatible with the macros in the A&A document class
% version 7.0
% Include this file in your LaTeX source only if you are not using
% the AAS TeX macro package or the A&A document class and need to
% resolve the macro definitions in the TeX/BibTeX entries returned by
% the ADS abstract service.
%
% If you plan not to use this file to resolve the journal macros
% rather than the whole AAS TeX macro package, you should save the
% file as ``aas_macros.sty'' and then include it in your LaTeX paper
% by using a construct such as:
% \documentstyle[11pt,aas_macros]{article}
%
% For more information on the AASTeX and A&A packages, please see:
% http://aastex.aas.org
% ftp://ftp.edpsciences.org/pub/aa/readme.html
% For more information about ADS abstract server, please see:
% http://adsabs.harvard.edu/ads_abstracts.html
%
% Abbreviations for journals. The object here is to provide authors
% with convenient shorthands for the most "popular" (often-cited)
% journals; the author can use these markup tags without being concerned
% about the exact form of the journal abbreviation, or its formatting.
% It is up to the keeper of the macros to make sure the macros expand
% to the proper text. If macro package writers agree to all use the
% same TeX command name, authors only have to remember one thing, and
% the style file will take care of editorial preferences. This also
% applies when a single journal decides to revamp its abbreviating
% scheme, as happened with the ApJ (Abt 1991).
\let\jnl@style=\rm
\def\ref@jnl#1{{\jnl@style#1}}
\def\aj{\ref@jnl{AJ}} % Astronomical Journal
\def\actaa{\ref@jnl{Acta Astron.}} % Acta Astronomica
\def\araa{\ref@jnl{ARA\&A}} % Annual Review of Astron and Astrophys
\def\apj{\ref@jnl{ApJ}} % Astrophysical Journal
\def\apjl{\ref@jnl{ApJL}} % Astrophysical Journal, Letters
\def\apjs{\ref@jnl{ApJS}} % Astrophysical Journal, Supplement
\def\ao{\ref@jnl{Appl.~Opt.}} % Applied Optics
\def\apss{\ref@jnl{Ap\&SS}} % Astrophysics and Space Science
\def\aap{\ref@jnl{A\&A}} % Astronomy and Astrophysics
\def\aapr{\ref@jnl{A\&A~Rev.}} % Astronomy and Astrophysics Reviews
\def\aaps{\ref@jnl{A\&AS}} % Astronomy and Astrophysics, Supplement
\def\azh{\ref@jnl{AZh}} % Astronomicheskii Zhurnal
\def\baas{\ref@jnl{BAAS}} % Bulletin of the AAS
\def\bac{\ref@jnl{Bull. astr. Inst. Czechosl.}}
% Bulletin of the Astronomical Institutes of Czechoslovakia
\def\caa{\ref@jnl{Chinese Astron. Astrophys.}}
% Chinese Astronomy and Astrophysics
\def\cjaa{\ref@jnl{Chinese J. Astron. Astrophys.}}
% Chinese Journal of Astronomy and Astrophysics
\def\icarus{\ref@jnl{Icarus}} % Icarus
\def\jcap{\ref@jnl{J. Cosmology Astropart. Phys.}}
% Journal of Cosmology and Astroparticle Physics
\def\jrasc{\ref@jnl{JRASC}} % Journal of the RAS of Canada
\def\memras{\ref@jnl{MmRAS}} % Memoirs of the RAS
\def\mnras{\ref@jnl{MNRAS}} % Monthly Notices of the RAS
\def\na{\ref@jnl{New A}} % New Astronomy
\def\nar{\ref@jnl{New A Rev.}} % New Astronomy Review
\def\pra{\ref@jnl{Phys.~Rev.~A}} % Physical Review A: General Physics
\def\prb{\ref@jnl{Phys.~Rev.~B}} % Physical Review B: Solid State
\def\prc{\ref@jnl{Phys.~Rev.~C}} % Physical Review C
\def\prd{\ref@jnl{Phys.~Rev.~D}} % Physical Review D
\def\pre{\ref@jnl{Phys.~Rev.~E}} % Physical Review E
\def\prl{\ref@jnl{Phys.~Rev.~Lett.}} % Physical Review Letters
\def\pasa{\ref@jnl{PASA}} % Publications of the Astron. Soc. of Australia
\def\pasp{\ref@jnl{PASP}} % Publications of the ASP
\def\pasj{\ref@jnl{PASJ}} % Publications of the ASJ
\def\rmxaa{\ref@jnl{Rev. Mexicana Astron. Astrofis.}}%
% Revista Mexicana de Astronomia y Astrofisica
\def\qjras{\ref@jnl{QJRAS}} % Quarterly Journal of the RAS
\def\skytel{\ref@jnl{S\&T}} % Sky and Telescope
\def\solphys{\ref@jnl{Sol.~Phys.}} % Solar Physics
\def\sovast{\ref@jnl{Soviet~Ast.}} % Soviet Astronomy
\def\ssr{\ref@jnl{Space~Sci.~Rev.}} % Space Science Reviews
\def\zap{\ref@jnl{ZAp}} % Zeitschrift fuer Astrophysik
\def\nat{\ref@jnl{Nature}} % Nature
\def\iaucirc{\ref@jnl{IAU~Circ.}} % IAU Cirulars
\def\aplett{\ref@jnl{Astrophys.~Lett.}} % Astrophysics Letters
\def\apspr{\ref@jnl{Astrophys.~Space~Phys.~Res.}}
% Astrophysics Space Physics Research
\def\bain{\ref@jnl{Bull.~Astron.~Inst.~Netherlands}}
% Bulletin Astronomical Institute of the Netherlands
\def\fcp{\ref@jnl{Fund.~Cosmic~Phys.}} % Fundamental Cosmic Physics
\def\gca{\ref@jnl{Geochim.~Cosmochim.~Acta}} % Geochimica Cosmochimica Acta
\def\grl{\ref@jnl{Geophys.~Res.~Lett.}} % Geophysics Research Letters
\def\jcp{\ref@jnl{J.~Chem.~Phys.}} % Journal of Chemical Physics
\def\jgr{\ref@jnl{J.~Geophys.~Res.}} % Journal of Geophysics Research
\def\jqsrt{\ref@jnl{J.~Quant.~Spec.~Radiat.~Transf.}}
% Journal of Quantitiative Spectroscopy and Radiative Transfer
\def\memsai{\ref@jnl{Mem.~Soc.~Astron.~Italiana}}
% Mem. Societa Astronomica Italiana
\def\nphysa{\ref@jnl{Nucl.~Phys.~A}} % Nuclear Physics A
\def\physrep{\ref@jnl{Phys.~Rep.}} % Physics Reports
\def\physscr{\ref@jnl{Phys.~Scr}} % Physica Scripta
\def\planss{\ref@jnl{Planet.~Space~Sci.}} % Planetary Space Science
\def\procspie{\ref@jnl{Proc.~SPIE}} % Proceedings of the SPIE
\def\lt{\ref@jnl{<}}
\def\gt{\ref@jnl{>}}
\let\astap=\aap
\let\apjlett=\apjl
\let\apjsupp=\apjs
\let\applopt=\ao
%% Since the preamble necessary to make the bibliography is a little
%% long and unclean, and might be used in other places separately
%% later, I have put it here in a separate file.
%% To break up highlighted text (for example texttt when some it is on
%% the line break) and also to no underline emphasized words (like
%% journal titles in the references).
\usepackage[normalem]{ulem}
% Basic BibLaTeX settings
\usepackage[
doi=false,
url=false,
dashed=false,
eprint=false,
maxbibnames=4,
minbibnames=1,
hyperref=true,
maxcitenames=2,
mincitenames=1,
style=authoryear,
uniquelist=false,
backend=biber,natbib]{biblatex}
\DeclareFieldFormat[article]{pages}{#1}
\DeclareFieldFormat{pages}{\mkfirstpage[{\mkpageprefix[bookpagination]}]{#1}}
\addbibresource{./tex/ref.tex}
\renewbibmacro{in:}{}
\renewcommand*{\bibfont}{\footnotesize}
\DefineBibliographyStrings{english}{references = {References}}
%% Include the adsurl field key into those that are recognized:
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=adsurl,fieldtarget=iswc]
\step[fieldsource=gbkurl,fieldtarget=iswc]
}
}
}
%% Set the color of the doi link to mymg (magenta) and the ads links
%% to mypurp (or purple):
\definecolor{mypurp}{cmyk}{0.75,1,0,0}
\newcommand{\doihref}[2]{\href{#1}{\color{magenta}{#2}}}
\newcommand{\adshref}[2]{\href{#1}{\color{mypurp}{#2}}}
\newcommand{\blackhref}[2]{\href{#1