From a5d5dfbffa1fb6d633d439bf91b0900540954ac0 Mon Sep 17 00:00:00 2001 From: Erik Tollerud Date: Mon, 11 Nov 2024 14:33:41 -0500 Subject: [PATCH 1/4] update datamodels example to include more info --- docs/imviz/import_data.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/imviz/import_data.rst b/docs/imviz/import_data.rst index df682e66ee..510e78ad9f 100644 --- a/docs/imviz/import_data.rst +++ b/docs/imviz/import_data.rst @@ -99,7 +99,7 @@ object, you can load it into Imviz as follows: from jdaviz import Imviz # mydatamodel is a jwst.datamodels object - ndd = NDData(np.array(mydatamodel.data), wcs=mydatamodel.get_fits_wcs()) + ndd = NDData(mydatamodel.data, StdDevUncertainty(mydatamodel.err), mydatamodel.dq, mydatamodel.meta.wcs, meta=dict(mydatamodel.meta.items())) imviz = Imviz() imviz.load_data(ndd, data_label='my_data_model') imviz.show() From ee484eaa5cee16c3e363617c7261869e8c4b2ee9 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:15:40 -0500 Subject: [PATCH 2/4] Use API with keywords as keywords --- docs/imviz/import_data.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/imviz/import_data.rst b/docs/imviz/import_data.rst index 510e78ad9f..468f6a99cb 100644 --- a/docs/imviz/import_data.rst +++ b/docs/imviz/import_data.rst @@ -99,7 +99,7 @@ object, you can load it into Imviz as follows: from jdaviz import Imviz # mydatamodel is a jwst.datamodels object - ndd = NDData(mydatamodel.data, StdDevUncertainty(mydatamodel.err), mydatamodel.dq, mydatamodel.meta.wcs, meta=dict(mydatamodel.meta.items())) + 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() From 9b0a96382b1ff0027bbdb9efacd5216e909d6530 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:16:58 -0500 Subject: [PATCH 3/4] Clean up doc --- docs/imviz/import_data.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/imviz/import_data.rst b/docs/imviz/import_data.rst index 468f6a99cb..4693b23eb1 100644 --- a/docs/imviz/import_data.rst +++ b/docs/imviz/import_data.rst @@ -98,8 +98,12 @@ object, you can load it into Imviz as follows: from astropy.nddata import NDData from jdaviz import Imviz - # mydatamodel is a jwst.datamodels object - ndd = NDData(mydatamodel.data, uncertainty=StdDevUncertainty(mydatamodel.err), mask=mydatamodel.dq, wcs=mydatamodel.meta.wcs, meta=dict(mydatamodel.meta.items())) + # 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() From 7082c38662a6ebe718fdf06a2b147c4c40bb3d7c Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:28:20 -0500 Subject: [PATCH 4/4] Fix imports in example --- docs/imviz/import_data.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/imviz/import_data.rst b/docs/imviz/import_data.rst index 4693b23eb1..6e94873b23 100644 --- a/docs/imviz/import_data.rst +++ b/docs/imviz/import_data.rst @@ -94,8 +94,7 @@ 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 with stddev ERR array