Skip to content

Commit

Permalink
bypass jdaviz unit converter
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed May 24, 2024
1 parent f04a7ab commit 281f32b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lcviz/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@

from lightkurve import LightCurve

from glue.config import settings as glue_settings
from glue.core.component_id import ComponentID
from glue.core.link_helpers import LinkSame
from glue.core.units import unit_converter
from jdaviz.core.helpers import ConfigHelper
from lcviz.viewers import TimeScatterView

__all__ = ['LCviz']


@unit_converter('custom-lcviz')
class UnitConverter:
def equivalent_units(self, data, cid, units):
return set(list(map(str, u.Unit(units).find_equivalent_units(
include_prefix_units=True, equivalencies=u.spectral()))))

def to_unit(self, data, cid, values, original_units, target_units):
return (values * u.Unit(original_units)).to_value(u.Unit(target_units))


glue_settings.UNIT_CONVERTER = 'custom-lcviz'

custom_components = {'plugin-ephemeris-select': 'components/plugin_ephemeris_select.vue'}

# Register pure vue component. This allows us to do recursive component instantiation only in the
Expand Down

0 comments on commit 281f32b

Please sign in to comment.