|
3 | 3 | from astropy.io import fits
|
4 | 4 | from astropy.io.votable import parse
|
5 | 5 | from astropy.wcs import WCS
|
| 6 | +from astropy.coordinates import Angle |
| 7 | +import astropy.units as u |
6 | 8 | import numpy as np
|
7 | 9 | import glob
|
8 | 10 | import pandas as pd
|
|
15 | 17 | from bokeh.layouts import layout
|
16 | 18 | from bokeh.io import curdoc
|
17 | 19 | from bokeh.models import ColumnDataSource, Circle, CustomJS
|
| 20 | +from bokeh.models.formatters import FuncTickFormatter |
18 | 21 | from utils import get_joined_table_source, get_scatter_plots, get_mean_image_plot,\
|
19 | 22 | get_light_curve_plot, get_light_curve_plot, get_epoch_image_plots, load_mean_image, mean_image_data, get_imdata
|
20 | 23 |
|
|
69 | 72 | sky.x_range = mean_image.x_range = epochs.x_range
|
70 | 73 | sky.y_range = mean_image.y_range = epochs.y_range
|
71 | 74 |
|
| 75 | +# make the plot coords be in hms/dms format |
| 76 | +dms = """ |
| 77 | +var s = Math.sign(tick); |
| 78 | +var t = Math.abs(tick); |
| 79 | +var deg = Math.floor(t); |
| 80 | +t = (t -deg)*60; |
| 81 | +var min = Math.floor(t); |
| 82 | +t = (t-min)*60; |
| 83 | +var sec = Math.floor(t); |
| 84 | +var tk = "" |
| 85 | +if (s < 0) { |
| 86 | + tk = String(s)[0] |
| 87 | +} |
| 88 | +tk = tk + String(deg).padStart(2,'0') + ":"+String(min).padStart(2,'0')+":"+String(sec).padStart(2,'0'); |
| 89 | +return tk; |
| 90 | +""" |
| 91 | +hms = """ |
| 92 | +var s = Math.sign(tick); |
| 93 | +var t = Math.abs(tick/15); |
| 94 | +var deg = Math.floor(t); |
| 95 | +t = (t -deg)*60; |
| 96 | +var min = Math.floor(t); |
| 97 | +t = (t-min)*60; |
| 98 | +var sec = Math.floor(t); |
| 99 | +var tk = "" |
| 100 | +if (s < 0) { |
| 101 | + tk = String(s)[0] |
| 102 | +} |
| 103 | +tk = tk + String(deg).padStart(2,'0') + ":"+String(min).padStart(2,'0')+":"+String(sec).padStart(2,'0'); |
| 104 | +return tk; |
| 105 | +""" |
| 106 | + |
| 107 | +sky.yaxis.formatter = mean_image.yaxis.formatter = epochs.yaxis.formatter = FuncTickFormatter(code=dms) |
| 108 | +sky.xaxis.formatter = mean_image.xaxis.formatter = epochs.xaxis.formatter = FuncTickFormatter(code=hms) |
| 109 | + |
| 110 | + |
72 | 111 | # # Callback to update epochs
|
73 | 112 | # def update_epochs():
|
74 | 113 |
|
|
0 commit comments