Skip to content

Commit

Permalink
Fixed the tap tool for contam plots
Browse files Browse the repository at this point in the history
  • Loading branch information
hover2pi committed Sep 5, 2023
1 parent 0b190ac commit efcc196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 3 additions & 7 deletions exoctk/contam_visibility/field_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def calc_v3pa(V3PA, stars, aperture, data=None, c0x0=885, c0y0=1462, c1x0=-0.11,
star['yord1'] = star['yord0'] - y_sweet + aper['subarr_y'][1] + y_shift

# Just stars in FOV (Should always have at least 1, the target)
lft, rgt, top, bot = 700, 5000, 2000, 1400
lft, rgt, top, bot = 700, 5100, 1940, 1400
FOVstars = stars[(lft < stars['xord0']) & (stars['xord0'] < rgt) & (bot < stars['yord0']) & (stars['yord0'] < top)]

if verbose:
Expand All @@ -393,17 +393,13 @@ def calc_v3pa(V3PA, stars, aperture, data=None, c0x0=885, c0y0=1462, c1x0=-0.11,
tips = [('Name', '@name'), ('RA', '@ra'), ('DEC', '@dec'), ('scale', '@fluxscale'), ('Teff', '@Teff'), ('ord0', '@xord0{int}, @yord0{int}')]
hover = HoverTool(tooltips=tips, name='stars')
crosshair = CrosshairTool(dimensions="height")
taptool = TapTool(behavior='select', callback=OpenURL(url="@url"))

# Make the plot
tools = ['pan', crosshair, 'reset', 'box_zoom', 'wheel_zoom', 'save', hover]
tools = ['pan', crosshair, 'reset', 'box_zoom', 'wheel_zoom', 'save', taptool, hover]
fig = figure(title='Generated FOV from Gaia EDR3', width=900, height=subY, match_aspect=True, tools=tools)
fig.title = '({}, {}) at PA={} in {}'.format(stars[0]['ra'], stars[0]['dec'], V3PA, aperture.AperName)

# Add clickable order 0
taptool = fig.select(type=TapTool)
taptool.behavior = 'select'
taptool.callback = OpenURL(url="@url")

# Plot config
scale = 'log'
color_map = 'Viridis256'
Expand Down
1 change: 1 addition & 0 deletions exoctk/exoctk_app/templates/contam_visibility_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ <h3> Target Contamination at PA={{ pa_val }}</h3>
{% else %}
<ul>
<li>The top plot shows the simulated observation at the given position angle.</li>
<li>The circles show the detector location of the 0th order, which you can click to resolve in Vizier.</li>
<li>Red lines show the predicted order 1, 2, and 3 trace positions for the target (solid) as well as all contaminant sources (dashed).</li>
<li>The bottom plot shows the fractional contamination of orders 1 (blue), 2 (red), and 3 (green) in each detector column.</li>
</ul>
Expand Down

0 comments on commit efcc196

Please sign in to comment.