spacetelescope / jdaviz

JWST astronomical data analysis tools in the Jupyter platform
https://jdaviz.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
138 stars 73 forks source link

Have cubeviz spectral models have "infinite resolution" #65

Open eteq opened 4 years ago

eteq commented 4 years ago

This is a forward-looking "user story", as some of this capability doesn't exist. The gist of it is as follows:

1a. Separately we know we want a spectral modeling plugin, which would result in models fit to the current spectrum that's been extracted from the cube. In that case the model object will already be associated with the Cubeviz app object. 1b. A user could also make a model, and they should be able to load it via something like cubeviz.add_spectral_model(my_preferred_model) (which should be pretty accommodating but at least check that it's a model that's valid for a spectral x-axis).

  1. Once the model exists, it should get plotted in the spectral view of cubeviz.
  2. When the user moves or zooms the view, the model (unlike the data) should update to evaluate the model to acheive a reasonable resolution based on the view. The exact resolution is debatable, but some initial items to try might be either 1 resolution item per screen pixel (which may or may not be easy to compute) or a fixed but high number like "1000 points per visualization".

cc @nmearl @astrofrog

eteq commented 4 years ago

Some technical corollaries to this: the model cannot be a glue derived component (as currently imagined) because those are restricted to only get evaluated at the grid points of a spectrum itself. So the initial implementation would probably involve just storing the model on the Cubeviz object and plotting when an event is triggered in bqplot.