diff --git a/docs/joss_paper/Makefile b/docs/joss_paper/Makefile new file mode 100644 index 0000000..a450a46 --- /dev/null +++ b/docs/joss_paper/Makefile @@ -0,0 +1,52 @@ +# ============================================================================= +# @file Makefile +# @brief Makefile for generating previews of the paper +# @author Michael Hucka +# @license Please see the file named LICENSE in the project directory +# @website https://github.com/casics/dassie +# ============================================================================= + +# Change the following values to match your configuration. +# ............................................................................. + +input := paper.md +output := paper.pdf +bib := paper.bib + +# Main code -- no more customization variables after this point +# ............................................................................. + +title := $(shell grep title: $(input) | sed 's/title: *//' | tr -d "'") +authors := $(shell sed -n '/authors:/,/affiliations:/p' $(input) | grep name: | sed 's/- name: *//' | paste -d, -s - | sed 's/,/, /g') +repo := $(shell git config --get remote.origin.url | sed 's|git@github.com:|https://github.com/|' | sed 's/\.git//') +#repo := https://github.com/hipspy/hips + +$(output): $(input) $(bib) Makefile + pandoc \ + -V paper_title="$(title)" \ + -V citation_author="$(authors)" \ + -V repository="$(repo)" \ + -V archive_doi="http://dx.doi.org/00.00000/zenodo.0000000" \ + -V formatted_doi="00.00000/joss.00000" \ + -V paper_url="http://joss.theoj.org/papers/" \ + -V review_issue_url="http://joss.theoj.org/papers/" \ + -V issue="0" \ + -V volume="00" \ + -V year="2018" \ + -V submitted="00 January 0000" \ + -V published="00 January 0000" \ + -V page="00" \ + -V graphics="true" \ + -V joss_logo_path="whedon/resources/joss-logo.png" \ + -V logo_path="whedon/resources/joss-logo.png" \ + -V footnote_paper_title="..." \ + -V geometry:margin=1in \ + -V journal_name="JOSS" \ + -o $(output) \ + --pdf-engine=xelatex \ + --filter pandoc-citeproc $(input) \ + --from markdown+autolink_bare_uris \ + --template "whedon/resources/latex.template" + +autorefresh:; + ((ls $(input) $(bib) | entr make $(output)) &) diff --git a/docs/joss_paper/paper.pdf b/docs/joss_paper/paper.pdf new file mode 100644 index 0000000..06418c7 Binary files /dev/null and b/docs/joss_paper/paper.pdf differ diff --git a/docs/joss_paper/plot_jpg.hires.jpg b/docs/joss_paper/plot_jpg.hires.jpg new file mode 100644 index 0000000..048a8de Binary files /dev/null and b/docs/joss_paper/plot_jpg.hires.jpg differ diff --git a/docs/joss_paper/plot_jpg.py b/docs/joss_paper/plot_jpg.py new file mode 100644 index 0000000..4597c0f --- /dev/null +++ b/docs/joss_paper/plot_jpg.py @@ -0,0 +1,16 @@ +"""Basic example how to plot a sky image with the hips package""" +from astropy.coordinates import SkyCoord +from hips import WCSGeometry, HipsPainter + +# Compute the sky image +geometry = WCSGeometry.create( + skydir=SkyCoord(0, 0, unit='deg', frame='galactic'), + width=2000, height=1000, fov="3 deg", + coordsys='galactic', projection='AIT', +) +hips_survey = 'IPAC/P/GLIMPSE360' + +fetch_opts = dict(fetch_package='urllib', timeout=30, n_parallel=10) +painter = HipsPainter(geometry, hips_survey, 'jpg', fetch_opts=fetch_opts) +painter.run() +painter.plot_mpl_hips_tile_number_grid() diff --git a/hips/draw/paint.py b/hips/draw/paint.py index 3cd27fb..a215ba2 100644 --- a/hips/draw/paint.py +++ b/hips/draw/paint.py @@ -221,6 +221,30 @@ def plot_mpl_hips_tile_grid(self) -> None: transform=ax.get_transform('world'), **opts) ax.imshow(self.image, origin='lower') + def plot_mpl_hips_tile_number_grid(self) -> None: + """Plot output image and HiPS grid with matplotlib. + + This is mainly useful for debugging the drawing algorithm, + not something end-users will call or need to know about. + """ + import matplotlib.pyplot as plt + self.make_tile_list() + i = 0 + for tile in self.draw_tiles: + corners = tile.meta.skycoord_corners.transform_to(self.geometry.celestial_frame) + ax = plt.subplot(projection=self.geometry.wcs) + opts = dict(color='red', lw=1, ) + ax.plot(corners.data.lon.deg, corners.data.lat.deg, + transform=ax.get_transform('world'), **opts) + # ax.text(corners.data.lon.deg, corners.data.lat.deg, + # '2', bbox=dict(facecolor='red', alpha=0.5), + # transform=ax.get_transform('world')) + ax.text(0.5, 0.5, + '{:d}'.format(i), color='w', ha='center', va='center') + i += 1 + + ax.imshow(self.image, origin='lower') + def measure_tile_lengths(corners: Tuple[np.ndarray, np.ndarray]) -> Tuple[np.ndarray, np.ndarray]: """Compute length of tile edges and diagonals. diff --git a/paper.pdf b/paper.pdf new file mode 100644 index 0000000..bfe87e1 Binary files /dev/null and b/paper.pdf differ