Skip to content

Commit c7d5247

Browse files
committed
Update output image and add PDF output
1 parent 11310a6 commit c7d5247

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

docs/joss_paper/Makefile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# =============================================================================
2+
# @file Makefile
3+
# @brief Makefile for generating previews of the paper
4+
# @author Michael Hucka <[email protected]>
5+
# @license Please see the file named LICENSE in the project directory
6+
# @website https://github.com/casics/dassie
7+
# =============================================================================
8+
9+
# Change the following values to match your configuration.
10+
# .............................................................................
11+
12+
input := paper.md
13+
output := paper.pdf
14+
bib := paper.bib
15+
16+
# Main code -- no more customization variables after this point
17+
# .............................................................................
18+
19+
title := $(shell grep title: $(input) | sed 's/title: *//' | tr -d "'")
20+
authors := $(shell sed -n '/authors:/,/affiliations:/p' $(input) | grep name: | sed 's/- name: *//' | paste -d, -s - | sed 's/,/, /g')
21+
repo := $(shell git config --get remote.origin.url | sed 's|[email protected]:|https://github.com/|' | sed 's/\.git//')
22+
#repo := https://github.com/hipspy/hips
23+
24+
$(output): $(input) $(bib) Makefile
25+
pandoc \
26+
-V paper_title="$(title)" \
27+
-V citation_author="$(authors)" \
28+
-V repository="$(repo)" \
29+
-V archive_doi="http://dx.doi.org/00.00000/zenodo.0000000" \
30+
-V formatted_doi="00.00000/joss.00000" \
31+
-V paper_url="http://joss.theoj.org/papers/" \
32+
-V review_issue_url="http://joss.theoj.org/papers/" \
33+
-V issue="0" \
34+
-V volume="00" \
35+
-V year="2018" \
36+
-V submitted="00 January 0000" \
37+
-V published="00 January 0000" \
38+
-V page="00" \
39+
-V graphics="true" \
40+
-V joss_logo_path="whedon/resources/joss-logo.png" \
41+
-V logo_path="whedon/resources/joss-logo.png" \
42+
-V footnote_paper_title="..." \
43+
-V geometry:margin=1in \
44+
-V journal_name="JOSS" \
45+
-o $(output) \
46+
--pdf-engine=xelatex \
47+
--filter pandoc-citeproc $(input) \
48+
--from markdown+autolink_bare_uris \
49+
--template "whedon/resources/latex.template"
50+
51+
autorefresh:;
52+
((ls $(input) $(bib) | entr make $(output)) &)

docs/joss_paper/paper.pdf

234 KB
Binary file not shown.

docs/joss_paper/plot_jpg.hires.jpg

101 KB
Loading

docs/joss_paper/plot_jpg.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Basic example how to plot a sky image with the hips package"""
2+
from astropy.coordinates import SkyCoord
3+
from hips import WCSGeometry, HipsPainter
4+
5+
# Compute the sky image
6+
geometry = WCSGeometry.create(
7+
skydir=SkyCoord(0, 0, unit='deg', frame='galactic'),
8+
width=2000, height=1000, fov="3 deg",
9+
coordsys='galactic', projection='AIT',
10+
)
11+
hips_survey = 'IPAC/P/GLIMPSE360'
12+
13+
fetch_opts = dict(fetch_package='urllib', timeout=30, n_parallel=10)
14+
painter = HipsPainter(geometry, hips_survey, 'jpg', fetch_opts=fetch_opts)
15+
painter.run()
16+
painter.plot_mpl_hips_tile_number_grid()

hips/draw/paint.py

+24
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,30 @@ def plot_mpl_hips_tile_grid(self) -> None:
221221
transform=ax.get_transform('world'), **opts)
222222
ax.imshow(self.image, origin='lower')
223223

224+
def plot_mpl_hips_tile_number_grid(self) -> None:
225+
"""Plot output image and HiPS grid with matplotlib.
226+
227+
This is mainly useful for debugging the drawing algorithm,
228+
not something end-users will call or need to know about.
229+
"""
230+
import matplotlib.pyplot as plt
231+
self.make_tile_list()
232+
i = 0
233+
for tile in self.draw_tiles:
234+
corners = tile.meta.skycoord_corners.transform_to(self.geometry.celestial_frame)
235+
ax = plt.subplot(projection=self.geometry.wcs)
236+
opts = dict(color='red', lw=1, )
237+
ax.plot(corners.data.lon.deg, corners.data.lat.deg,
238+
transform=ax.get_transform('world'), **opts)
239+
# ax.text(corners.data.lon.deg, corners.data.lat.deg,
240+
# '2', bbox=dict(facecolor='red', alpha=0.5),
241+
# transform=ax.get_transform('world'))
242+
ax.text(0.5, 0.5,
243+
'{:d}'.format(i), color='w', ha='center', va='center')
244+
i += 1
245+
246+
ax.imshow(self.image, origin='lower')
247+
224248

225249
def measure_tile_lengths(corners: Tuple[np.ndarray, np.ndarray]) -> Tuple[np.ndarray, np.ndarray]:
226250
"""Compute length of tile edges and diagonals.

paper.pdf

1.37 MB
Binary file not shown.

0 commit comments

Comments
 (0)