Skip to content

Commit

Permalink
updates required for jdaviz 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Oct 17, 2024
1 parent b8bb530 commit fae2324
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions lcviz/plugins/photometric_extraction/photometric_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ def _set_relevant(self, *args):
else:
self.irrelevant_msg = ''

def _on_global_display_unit_changed(self, msg=None):
if msg is None:
self.flux_units = str(self.app._get_display_unit('flux'))
self.time_units = str(self.app._get_display_unit('time'))
elif msg.axis == 'flux':
self.flux_units = str(msg.unit)
elif msg.axis == 'time':
self.time_units = str(msg.unit)
else:
# ignore
return
# update results_units based on flux_units, sb_units, and currently selected function
self._update_results_units()

@property
def slice_display_unit_name(self):
return 'time'
Expand Down
8 changes: 4 additions & 4 deletions lcviz/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class PlotOptions(PlotOptions):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

@observe('vdocs')
def _update_docs_link(self, *args):
self.docs_link = f"https://lcviz.readthedocs.io/en/{self.vdocs}/plugins.html#plot-options"

def not_spatial_subset_in_scatter_viewer(lyr):
# note: have to check the classname instead of isinstance to avoid circular import
if np.any([isinstance(viewer, CubeView)
Expand All @@ -51,6 +47,10 @@ def not_spatial_subset_in_scatter_viewer(lyr):

self.layer.add_filter(not_spatial_subset_in_scatter_viewer)

@observe('vdocs')
def _update_docs_link(self, *args):
self.docs_link = f"https://lcviz.readthedocs.io/en/{self.vdocs}/plugins.html#plot-options"

def _default_tpf_stretch(
self, vmin_percentile=5, vmax_percentile=99, tpf_viewer_reference='image'
):
Expand Down

0 comments on commit fae2324

Please sign in to comment.