Commit b48e7024 authored by Mohammad Akhlaghi's avatar Mohammad Akhlaghi

Outputs in FITS table format

The comments on the final tables were corrected to fit the new
Gnuastro plain text table format. So using the Table program from new
Gnuastro (currently under development) datastruct branch, the plain
text tables were converted to FITS tables. They are then packed into a
`.tar.gz' file to be easily communicated.
parent fd222a3a
# Reproduction pipeline
nolog 1
onlydirconf 1
keepinputdir 1
#onlyversion 0.1
# Input
hdu 1
searchin name
ignorecase 0
# Output:
tabletype fits-binary
\ No newline at end of file
......@@ -177,14 +177,14 @@ $(merged-cats): $(samecat)%.txt: $(samecat)%-h.txt $(samecat)%-m.txt
subfield=$(subst udf,,$(word 1, $(subst -, ,$(notdir $*)))); \
awk 'BEGIN{ \
print "# Reproduction pipeline $(gitdescribe)."; \
print "# Column 1: Sub-field ID."; \
print "# Column 2: ID in segmentation map."; \
print "# Column 3: RA in degraded HST image."; \
print "# Column 4: Dec in degraded HST image."; \
print "# Column 5: Magnitude in degraded HST image."; \
print "# Column 6: RA_MUSE - RA_HST."; \
print "# Column 7: DEC_MUSE - DEC-HST."; \
print "# Column 8: MAG-MUSE - MAG_HST."; \
print "# Column 1: FIELD_ID [label, us] MUSE UDF Field (UDF1, ..., UDF10)."; \
print "# Column 2: SEG_ID [label, us] Segmentation map ID."; \
print "# Column 3: HST_RA [degrees, d] Right Ascension in degraded HST image."; \
print "# Column 4: HST_DEC [degrees, d] Declination in degraded HST image."; \
print "# Column 5: HST_MAG [AB magnitude, f] Magnitude in degraded HST image."; \
print "# Column 6: MUSE_DIFF_RA [degrees, f] MUSE_RA - HST_RA"; \
print "# Column 7: MUSE_DIFF_DEC [degress, f] MUSE_DEC - HST_DEC"; \
print "# Column 8: MUSE_DIFF_MAG [AB magnitude, f] MUSE_MAG - HST_MAG"; \
} \
!/^#/ && $$4!="nan" && $$8!="nan" { \
printf("%-4d%-5d%-14.8f%-14.8f%-8.3f%-14.8f%-14.8f%-8.3f\n", \
......@@ -215,3 +215,51 @@ $(fullmosaic): $(samecat)%.txt: $(foreach i, 1 2 3 4 5 6 7 8 9, \
# Put all the non-commented rows of each subfield.
for file in $^; do awk '!/^#/{print}' $$file >> $@; done
# Catalogs as FITS tables
# -----------------------
#
# The catalog tables are currently in plain text format, to share
# them, it is better to have them in the FITS Binary table format.
#
# To do this, we are using a feature that is not yet in a released
# version of Gnuastro, it is currently in the `datastruct' branch
# (which is available online, but work on other utitilies hasn't
# finished yet). To run this rule, you will need to build the Gnuastro
# you get from that branch and specify its location in the rule below
fitscats = $(foreach fid, udf udf10, \
$(foreach f, $(filters), \
$(foreach d, $(acatdir) $(mcatdir), $(d)/$(fid)-$(f).fits)))
$(fitscats): %.fits: %.txt
~/.gnuastro-dev/build/bin/table/asttable $< -o$@
# FITS tables in one tarball
fitstarball = $(BDIR)/mag-ast-comp.tar.gz
fitstardir=$(BDIR)/mag-ast-comparison
$(fitstarball): $(fitscats)
# Directory to hold the final tables before compressing
mkdir -p $(fitstardir)
# Put all the files in (while correcting their name
for type in mag ast; do \
if [ $$type = mag ]; then tdir=$(mcatdir); \
else tdir=$(acatdir); \
fi; \
for i in $$tdir/*.fits; do \
filename=$$(basename "$$i"); \
extension="$${filename##*.}"; \
filename="$${filename%.*}"; \
cp $$i $(fitstardir)/"$$filename"-$$type.fits; \
done; \
done
# Make the final tarball
cd $(fitstardir); tar cf $@ *.fits
rm -rf $(fitstardir)
......@@ -64,7 +64,7 @@ tex/pipeline.tex: $(foreach t, versions statistics, $(mtexdir)/$(t).tex)
#
# 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.
data-products = $(radec2d) $(mag2d) $(deghst-demo)
data-products = $(radec2d) $(mag2d) $(deghst-demo) $(fitstarball)
description.bbl: $(data-products) tex/ref.tex tex/pipeline.tex | tikz
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment