Skip to content

Commit

Permalink
Backport PR spacetelescope#3279: update datamodels example to include…
Browse files Browse the repository at this point in the history
… more info
  • Loading branch information
eteq authored and meeseeksmachine committed Nov 13, 2024
1 parent 7d583da commit c0b59b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/imviz/import_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ object, you can load it into Imviz as follows:

.. code-block:: python
import numpy as np
from astropy.nddata import NDData
from astropy.nddata import NDData, StdDevUncertainty
from jdaviz import Imviz
# mydatamodel is a jwst.datamodels object
ndd = NDData(np.array(mydatamodel.data), wcs=mydatamodel.get_fits_wcs())
# mydatamodel is a jwst.datamodels object with stddev ERR array
ndd = NDData(mydatamodel.data,
uncertainty=StdDevUncertainty(mydatamodel.err),
mask=mydatamodel.dq,
wcs=mydatamodel.meta.wcs,
meta=dict(mydatamodel.meta.items()))
imviz = Imviz()
imviz.load_data(ndd, data_label='my_data_model')
imviz.show()
Expand Down

0 comments on commit c0b59b1

Please sign in to comment.