From 2c5b34571b9cf7cfb8fb3446d1862a7ef81188f7 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Fri, 10 May 2024 15:18:39 -0400 Subject: [PATCH 1/8] add a regression test for JP-3604 --- pyproject.toml.local | 307 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 pyproject.toml.local diff --git a/pyproject.toml.local b/pyproject.toml.local new file mode 100644 index 0000000000..0f34a64185 --- /dev/null +++ b/pyproject.toml.local @@ -0,0 +1,307 @@ +[project] +name = "jwst" +description = "Library for calibration of science observations from the James Webb Space Telescope" +requires-python = ">=3.10" +authors = [ + { name = "JWST calibration pipeline developers" }, +] +classifiers = [ + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Astronomy", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "asdf>=3.1.0,<4", + "astropy>=5.3", + "BayesicFitting>=3.0.1", + "crds>=11.17.14", + "drizzle>=1.15.0", + "gwcs>=0.21.0,<0.22.0", + "numpy>=1.22", + #"opencv-python-headless>=4.6.0.66", + "opencv-python", + "photutils>=1.5.0", + "psutil>=5.7.2", + "poppy>=1.0.2", + "pyparsing>=2.2.1", + "requests>=2.22", + "scikit-image>=0.19", + "scipy>=1.9.3", + "spherical-geometry>=1.2.22", + "stcal>=1.7.0,<1.8.0", + "stdatamodels>=1.10.1,<1.11.0", + "stpipe>=0.5.2,<0.6.0", + "stsci.image>=2.3.5", + "stsci.imagestats>=1.6.3,<1.7.0", + "synphot>=1.2", + "tweakwcs>=0.8.6", + "asdf-astropy>=0.3.0", + "wiimatch>=0.2.1", + "packaging>20.0", + "importlib-metadata>=4.11.4", + "jsonschema>=4.8", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +file = "LICENSE" +content-type = "text/plain" + +[project.urls] +Homepage = "https://github.com/spacetelescope/jwst" +Tracker = "https://github.com/spacetelescope/jwst/issues" +Documentation = "https://jwst-pipeline.readthedocs.io/en/stable/" +"Source Code" = "https://github.com/spacetelescope/jwst" + +[project.scripts] +adjust_wcs = "jwst.scripts.adjust_wcs:main" +asn_edit = "jwst.scripts.asn_edit:main" +asn_from_list = "jwst.associations.asn_from_list:main" +asn_gather = "jwst.scripts.asn_gather:main" +asn_generate = "jwst.associations.main:main" +asn_make_pool = "jwst.scripts.asn_make_pool:main" +assign_wcs = "jwst.scripts.assign_wcs:main" +collect_pipeline_cfgs = "jwst.scripts.collect_pipeline_cfgs:main" +coron = "jwst.scripts.coron:main" +create_data = "jwst.scripts.create_data:main" +csvconvert = "jwst.csv_tools.csvconvert:CSVConvertScript" +cube_build = "jwst.scripts.cube_build:main" +dark_current = "jwst.scripts.dark_current:main" +data_generate = "jwst.scripts.data_generate:main" +dqinit = "jwst.scripts.dqinit:main" +exp_to_source = "jwst.exp_to_source.main:Main" +flatfieldcorr = "jwst.scripts.flatfieldcorr:main" +fringecorr = "jwst.scripts.fringecorr:main" +ipc = "jwst.scripts.ipc:main" +jump = "jwst.scripts.jump:main" +linearitycorr = "jwst.scripts.linearitycorr:main" +make_header = "jwst.scripts.make_header:main" +okify_regtests = "jwst.scripts.okify_regtests:main" +outlier_detection = "jwst.scripts.outlier_detection:main" +persistencecorr = "jwst.scripts.persistencecorr:main" +photomcorr = "jwst.scripts.photomcorr:main" +pointing_summary = "jwst.scripts.pointing_summary:main" +rampfitcorr = "jwst.scripts.rampfitcorr:main" +refpix = "jwst.scripts.refpix:main" +resample = "jwst.scripts.resample:main" +saturationcorr = "jwst.scripts.saturationcorr:main" +schema_editor = "jwst.scripts.schema_editor:main" +schemadoc = "jwst.scripts.schemadoc:main" +set_telescope_pointing = "jwst.scripts.set_telescope_pointing:main" +"set_telescope_pointing.py" = "jwst.scripts.set_telescope_pointing:deprecated_name" +set_velocity_aberration = "jwst.scripts.set_velocity_aberration:main" +"set_velocity_aberration.py" = "jwst.scripts.set_velocity_aberration:deprecated_name" +straylight = "jwst.scripts.straylight:main" +superbias = "jwst.scripts.superbias:main" +v1_calculate = "jwst.scripts.v1_calculate:main" +verify_install_requires = "jwst.scripts.verify_install_requires:main" +world_coords = "jwst.scripts.world_coords:main" + +[project.entry-points."stpipe.steps"] +jwst = "jwst.stpipe.integration:get_steps" + +[project.entry-points.pytest11] +report_crds_context = "pytest_crds.plugin" + +[project.optional-dependencies] +docs = [ + "matplotlib", + "sphinx", + "sphinx-astropy", + "sphinx-automodapi", + "sphinx-rtd-theme", + "tomli; python_version <\"3.11\"", +] +sdp = [ + "jplephem>=2.9", + "pysiaf>=0.13.0", +] +test = [ + "ci-watson>=0.5.0", + "colorama>=0.4.1", + "readchar>=3.0", + "ruff", + "pytest>=6.0.0", + "pytest-cov>=2.9.0", + "pytest-doctestplus>=0.10.0", + "requests_mock>=1.0", +] + +[build-system] +requires = [ + "setuptools>=61.2", + "setuptools_scm[toml]>=3.4", + "wheel", + "oldest-supported-numpy", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +zip-safe = false +include-package-data = false + +[tool.setuptools.packages.find] +namespaces = false + +[tool.setuptools.package-data] +"*" = [ + "*.asdf", + "*.cfg", + "tests/data/*.csv", + "tests/data/*.ecsv", + "tests/data/*.fits", + "tests/data/**/*.fits", + "*.json", + "tests/data/*.json", + "tests/data/**/*.json", + "tests/data/*.txt", + "*.yaml", + "*.cat", + "*.hdr", +] +"jwst.fits_generator" = [ + "templates/*.inc", + "templates/*.txt", + "tests/okfile/*.prop", +] +"jwst.lib" = [ + "tests/data/*.asdf", + "tests/data/*.db", + "tests/data/*.ecsv", + "tests/data/*.fits", +] +"jwst.associations" = [ + "tests/data/*.py", +] +"jwst.lib.src" = [ + "*.c", +] +"jwst.cube_build.src" = [ + "*.c", +] +"jwst.straylight.src" = [ + "*.c", +] +"jwst.transforms" = [ + "resources/schemas/stsci.edu/jwst_pipeline/*.yaml", +] +"jwst.stpipe.resources" = [ + "schemas/*.yaml", +] + +[tool.build-sphinx] +source-dir = "docs" +build-dir = "docs" +all_files = "1" + +[tool.distutils.upload_docs] +upload-dir = "docs/_build/html" +show-response = 1 + +[tool.pytest.ini_options] +minversion = "6.0" +norecursedirs = [ + "docs/_build", + "docs/exts", + "jwst/timeconversion", + "jwst/associations/tests/data", + "scripts", + ".tox", + ".eggs", + "build", + "venv", +] +junit_family = "xunit2" +inputs_root = "jwst-pipeline" +results_root = "jwst-pipeline-results" +text_file_format = "rst" +doctest_plus = "enabled" +doctest_rst = "enabled" +addopts = ["-p no:legacypath", + "--show-capture=no", + "--report-crds-context", +] +filterwarnings = [ + "error::ResourceWarning", + "ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning", +] + +[tool.coverage.run] +omit = [ + "jwst/conftest.py", + "jwst/setup.py", + "jwst/tests/test*", + "jwst/regtest/test*", + "jwst/*/tests/*", + "docs/*", + "*/jwst/conftest.py", + "*/jwst/setup.py", + "*/jwst/tests/test*", + "*/jwst/regtest/test*", + "*/jwst/*/tests/*", + "*/docs/*", + "*.rmap", + "*.pmap", +] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if self.debug:", + "except ImportError", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == '__main__':", +] +omit = [ + "*.rmap", + "*.pmap", +] + +[tool.setuptools_scm] +write_to = "jwst/_version.py" + +[tool.ruff] +exclude = [ + "jwst/extern", + "docs", + "jwst/associations", + "jwst/fits_generator", + ".tox", + ".eggs", + "build", +] +lint.ignore = [ + "E741", +] +line-length = 130 + +[tool.ruff.lint.per-file-ignores] +"jwst/ramp_fitting/tests/compare_cr_navg_files.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/compare_crs.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/compare_cr_files.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/create_cube.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/mc_3d.py" = [ + "E402", +] From 817e3dff2a0af7d4e3da7d5cf248866c59180100 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Fri, 10 May 2024 19:21:35 -0400 Subject: [PATCH 2/8] fix assert statement; run the test with abs_refcat GAIADR3 --- jwst/regtest/test_niriss_image.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jwst/regtest/test_niriss_image.py b/jwst/regtest/test_niriss_image.py index 4cce41eda6..855d34e947 100644 --- a/jwst/regtest/test_niriss_image.py +++ b/jwst/regtest/test_niriss_image.py @@ -54,6 +54,7 @@ def test_niriss_tweakreg_no_sources(rtdata, fitsdiff_default_kwargs): rtdata.input = "niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json" rtdata.get_asn("niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json") +<<<<<<< HEAD args = [ "jwst.tweakreg.TweakRegStep", rtdata.input, @@ -63,6 +64,12 @@ def test_niriss_tweakreg_no_sources(rtdata, fitsdiff_default_kwargs): # run the test from the command line: result = Step.from_cmdline(args) +======= + args = ["jwst.tweakreg.TweakRegStep", rtdata.input, "--abs_refcat='GAIADR3'"] + result = Step.from_cmdline(args) + # Check that the step is skipped + assert result.skip +>>>>>>> edae07e81 (fix assert statement; run the test with abs_refcat GAIADR3) # Check the status of the step is set correctly in the files. mc = datamodels.ModelContainer(rtdata.input) From 0372afea4b655550210ca89e1f3638461dc1efe3 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Mon, 20 May 2024 09:04:08 -0400 Subject: [PATCH 3/8] gwcs inverse fixes --- jwst/skymatch/skyimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwst/skymatch/skyimage.py b/jwst/skymatch/skyimage.py index 65bc943bec..8a6ca6f3c8 100644 --- a/jwst/skymatch/skyimage.py +++ b/jwst/skymatch/skyimage.py @@ -619,7 +619,7 @@ def calc_sky(self, overlap=None, delta=True): continue # set pixels in 'fill_mask' that are inside a polygon to True: - x, y = self.wcs_inv(ra, dec) + x, y = self.wcs_inv(ra, dec, with_bounding_box=False) poly_vert = list(zip(*[x, y])) polygon = region.Polygon(True, poly_vert) From 0de7840bd58d49097ba6e54a3b633aa7974accb7 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Thu, 30 May 2024 17:17:12 -0400 Subject: [PATCH 4/8] make it backwards compatible --- jwst/assign_wcs/util.py | 2 +- jwst/resample/resample_utils.py | 34 +++++++++++++++++----- jwst/resample/tests/test_utils.py | 4 +-- jwst/tweakreg/tests/test_multichip_jwst.py | 8 +++-- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/jwst/assign_wcs/util.py b/jwst/assign_wcs/util.py index 2767182fe0..c8e5c77465 100644 --- a/jwst/assign_wcs/util.py +++ b/jwst/assign_wcs/util.py @@ -129,7 +129,7 @@ def compute_scale(wcs: WCS, fiducial: Union[tuple, np.ndarray], if spectral and disp_axis is None: raise ValueError('If input WCS is spectral, a disp_axis must be given') - crpix = np.array(wcs.invert(*fiducial)) + crpix = np.array(wcs.invert(*fiducial, with_bounding_box=False)) delta = np.zeros_like(crpix) spatial_idx = np.where(np.array(wcs.output_frame.axes_type) == 'SPATIAL')[0] diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index ed4447d8b5..3b7ce13f89 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -4,6 +4,7 @@ import numpy as np from astropy import units as u +from astropy import wcs as fitswcs import gwcs from stdatamodels.dqflags import interpret_bit_flags @@ -143,21 +144,40 @@ def reproject(wcs1, wcs2): positions in ``wcs1`` and returns x, y positions in ``wcs2``. """ - try: - forward_transform = wcs1.pixel_to_world_values - backward_transform = wcs2.world_to_pixel_values - except AttributeError as err: - raise TypeError("Input should be a WCS") from err + # try: + # # forward_transform = wcs1.pixel_to_world_values + # # backward_transform = wcs2.world_to_pixel_values + # forward_transform = wcs1.forward_transform + # backward_transform = wcs2.backward_transform + # except AttributeError as err: + # raise TypeError("Input should be a WCS") from err + def _get_forward(wcs): + if isinstance(wcs, gwcs.WCS): + return wcs.forward_transform + elif isinstance(wcs, fitswcs.WCS): + return wcs.pixel_to_world + elif isinstance(wcs, Model): + return wcs + + def _get_backward(wcs): + if isinstance(wcs, gwcs.WCS): + return wcs.backward_transform + elif isinstance(wcs, fitswcs.WCS): + return wcs.world_to_pixel + elif isinstance(wcs, Model): + return wcs def _reproject(x, y): - sky = forward_transform(x, y) + #sky = forward_transform(x, y) + sky = _get_forward(wcs1)(x, y) flat_sky = [] for axis in sky: flat_sky.append(axis.flatten()) # Filter out RuntimeWarnings due to computed NaNs in the WCS with warnings.catch_warnings(): warnings.simplefilter("ignore", RuntimeWarning) - det = backward_transform(*tuple(flat_sky)) + #det = backward_transform(*tuple(flat_sky)) + det = _get_backward(wcs2)(*tuple(flat_sky)) det_reshaped = [] for axis in det: det_reshaped.append(axis.reshape(x.shape)) diff --git a/jwst/resample/tests/test_utils.py b/jwst/resample/tests/test_utils.py index af41f9730b..f48dce95cf 100644 --- a/jwst/resample/tests/test_utils.py +++ b/jwst/resample/tests/test_utils.py @@ -37,7 +37,7 @@ def wcs_gwcs(): crpix = (500.0, 500.0) shape = (1000, 1000) pscale = 0.06 / 3600 - + prj = astmodels.Pix2Sky_TAN() fiducial = np.array(crval) @@ -192,7 +192,7 @@ def test_reproject(wcs1, wcs2, offset, request): wcs1 = request.getfixturevalue(wcs1) wcs2 = request.getfixturevalue(wcs2) x = np.arange(150, 200) - + f = reproject(wcs1, wcs2) res = f(x, x) assert_allclose(x, res[0] + offset) diff --git a/jwst/tweakreg/tests/test_multichip_jwst.py b/jwst/tweakreg/tests/test_multichip_jwst.py index 6daa383c33..9766aea85d 100644 --- a/jwst/tweakreg/tests/test_multichip_jwst.py +++ b/jwst/tweakreg/tests/test_multichip_jwst.py @@ -83,7 +83,7 @@ def _make_gwcs_wcs(fits_hdr): Mapping((1, 2), name='xtyt')) c2tan.name = 'Cartesian 3D to TAN' - tan2c = (Mapping((0, 0, 1), n_inputs=2, name='xtyt2xyz') | + tan2c = (Mapping((0, 0, 1), name='xtyt2xyz') | (Const1D(1, name='one') & Identity(2, name='I(2D)'))) tan2c.name = 'TAN to cartesian 3D' @@ -377,7 +377,8 @@ def test_multichip_alignment_step(monkeypatch): format='ascii.ecsv', delimiter=' ', names=['RA', 'DEC'] ) - x, y = wr.world_to_pixel(refcat['RA'], refcat['DEC']) + #x, y = wr.world_to_pixel(refcat['RA'].value, refcat['DEC'].value) + x, y = wr.invert(refcat['RA'].value, refcat['DEC'].value, with_bounding_box=False) refcat['x'] = x refcat['y'] = y mr.tweakreg_catalog = refcat @@ -450,7 +451,8 @@ def test_multichip_alignment_step_abs(monkeypatch): format='ascii.ecsv', delimiter=' ', names=['RA', 'DEC'] ) - x, y = wr.world_to_pixel(refcat['RA'], refcat['DEC']) + #x, y = wr.world_to_pixel(refcat['RA'], refcat['DEC']) + x, y = wr.invert(refcat['RA'].value, refcat['DEC'].value, with_bounding_box=False) refcat['x'] = x refcat['y'] = y mr.tweakreg_catalog = refcat From f2127e7c956c2d7af8fdbdea7f5af1228115a22d Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Sat, 8 Jun 2024 08:59:54 -0400 Subject: [PATCH 5/8] add missing import --- jwst/resample/resample_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index 3b7ce13f89..e4e4bc55cb 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -5,6 +5,7 @@ import numpy as np from astropy import units as u from astropy import wcs as fitswcs +from astropy.modeling import Model import gwcs from stdatamodels.dqflags import interpret_bit_flags From aea7ab9af9c6017e210e2ca1911a60bb5c9fce83 Mon Sep 17 00:00:00 2001 From: Nadia Date: Wed, 12 Jun 2024 09:24:57 -0400 Subject: [PATCH 6/8] fixes --- jwst/assign_wcs/util.py | 48 +++++++++++++++---------------- jwst/regtest/test_niriss_image.py | 7 ----- jwst/resample/resample_utils.py | 34 ++++++---------------- 3 files changed, 32 insertions(+), 57 deletions(-) diff --git a/jwst/assign_wcs/util.py b/jwst/assign_wcs/util.py index c8e5c77465..2df5abbb43 100644 --- a/jwst/assign_wcs/util.py +++ b/jwst/assign_wcs/util.py @@ -74,30 +74,30 @@ def _domain_to_bounding_box(domain): return bb -def reproject(wcs1, wcs2): - """ - Given two WCSs return a function which takes pixel coordinates in - the first WCS and computes their location in the second one. - - It performs the forward transformation of ``wcs1`` followed by the - inverse of ``wcs2``. - - Parameters - ---------- - wcs1, wcs2 : `~gwcs.wcs.WCS` - WCS objects. - - Returns - ------- - _reproject : func - Function to compute the transformations. It takes x, y - positions in ``wcs1`` and returns x, y positions in ``wcs2``. - """ - - def _reproject(x, y): - sky = wcs1.forward_transform(x, y) - return wcs2.backward_transform(*sky) - return _reproject +# def reproject(wcs1, wcs2): +# """ +# Given two WCSs return a function which takes pixel coordinates in +# the first WCS and computes their location in the second one. + +# It performs the forward transformation of ``wcs1`` followed by the +# inverse of ``wcs2``. + +# Parameters +# ---------- +# wcs1, wcs2 : `~gwcs.wcs.WCS` +# WCS objects. + +# Returns +# ------- +# _reproject : func +# Function to compute the transformations. It takes x, y +# positions in ``wcs1`` and returns x, y positions in ``wcs2``. +# """ + +# def _reproject(x, y): +# sky = wcs1.forward_transform(x, y) +# return wcs2.backward_transform(*sky) +# return _reproject def compute_scale(wcs: WCS, fiducial: Union[tuple, np.ndarray], diff --git a/jwst/regtest/test_niriss_image.py b/jwst/regtest/test_niriss_image.py index 855d34e947..4cce41eda6 100644 --- a/jwst/regtest/test_niriss_image.py +++ b/jwst/regtest/test_niriss_image.py @@ -54,7 +54,6 @@ def test_niriss_tweakreg_no_sources(rtdata, fitsdiff_default_kwargs): rtdata.input = "niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json" rtdata.get_asn("niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json") -<<<<<<< HEAD args = [ "jwst.tweakreg.TweakRegStep", rtdata.input, @@ -64,12 +63,6 @@ def test_niriss_tweakreg_no_sources(rtdata, fitsdiff_default_kwargs): # run the test from the command line: result = Step.from_cmdline(args) -======= - args = ["jwst.tweakreg.TweakRegStep", rtdata.input, "--abs_refcat='GAIADR3'"] - result = Step.from_cmdline(args) - # Check that the step is skipped - assert result.skip ->>>>>>> edae07e81 (fix assert statement; run the test with abs_refcat GAIADR3) # Check the status of the step is set correctly in the files. mc = datamodels.ModelContainer(rtdata.input) diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index e4e4bc55cb..5410525e14 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -5,6 +5,7 @@ import numpy as np from astropy import units as u from astropy import wcs as fitswcs +from astropy.wcs.wcsapi.wrappers import SlicedLowLevelWCS from astropy.modeling import Model import gwcs @@ -145,40 +146,21 @@ def reproject(wcs1, wcs2): positions in ``wcs1`` and returns x, y positions in ``wcs2``. """ - # try: - # # forward_transform = wcs1.pixel_to_world_values - # # backward_transform = wcs2.world_to_pixel_values - # forward_transform = wcs1.forward_transform - # backward_transform = wcs2.backward_transform - # except AttributeError as err: - # raise TypeError("Input should be a WCS") from err - def _get_forward(wcs): - if isinstance(wcs, gwcs.WCS): - return wcs.forward_transform - elif isinstance(wcs, fitswcs.WCS): - return wcs.pixel_to_world - elif isinstance(wcs, Model): - return wcs - - def _get_backward(wcs): - if isinstance(wcs, gwcs.WCS): - return wcs.backward_transform - elif isinstance(wcs, fitswcs.WCS): - return wcs.world_to_pixel - elif isinstance(wcs, Model): - return wcs + try: + forward_transform = wcs1.pixel_to_world_values + backward_transform = wcs2.world_to_pixel_values + except AttributeError as err: + raise TypeError("Input should be a WCS") from err def _reproject(x, y): - #sky = forward_transform(x, y) - sky = _get_forward(wcs1)(x, y) + sky = forward_transform(x, y) flat_sky = [] for axis in sky: flat_sky.append(axis.flatten()) # Filter out RuntimeWarnings due to computed NaNs in the WCS with warnings.catch_warnings(): warnings.simplefilter("ignore", RuntimeWarning) - #det = backward_transform(*tuple(flat_sky)) - det = _get_backward(wcs2)(*tuple(flat_sky)) + det = backward_transform(*tuple(flat_sky)) det_reshaped = [] for axis in det: det_reshaped.append(axis.reshape(x.shape)) From 46038b5bcf386ed54ea555dd96865736b064b731 Mon Sep 17 00:00:00 2001 From: Nadia Date: Wed, 12 Jun 2024 09:37:54 -0400 Subject: [PATCH 7/8] update pyproject --- pyproject.toml.local | 307 ------------------------------------------- 1 file changed, 307 deletions(-) delete mode 100644 pyproject.toml.local diff --git a/pyproject.toml.local b/pyproject.toml.local deleted file mode 100644 index 0f34a64185..0000000000 --- a/pyproject.toml.local +++ /dev/null @@ -1,307 +0,0 @@ -[project] -name = "jwst" -description = "Library for calibration of science observations from the James Webb Space Telescope" -requires-python = ">=3.10" -authors = [ - { name = "JWST calibration pipeline developers" }, -] -classifiers = [ - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Astronomy", - "License :: OSI Approved :: BSD License", - "Operating System :: MacOS :: MacOS X", - "Operating System :: POSIX", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", -] -dependencies = [ - "asdf>=3.1.0,<4", - "astropy>=5.3", - "BayesicFitting>=3.0.1", - "crds>=11.17.14", - "drizzle>=1.15.0", - "gwcs>=0.21.0,<0.22.0", - "numpy>=1.22", - #"opencv-python-headless>=4.6.0.66", - "opencv-python", - "photutils>=1.5.0", - "psutil>=5.7.2", - "poppy>=1.0.2", - "pyparsing>=2.2.1", - "requests>=2.22", - "scikit-image>=0.19", - "scipy>=1.9.3", - "spherical-geometry>=1.2.22", - "stcal>=1.7.0,<1.8.0", - "stdatamodels>=1.10.1,<1.11.0", - "stpipe>=0.5.2,<0.6.0", - "stsci.image>=2.3.5", - "stsci.imagestats>=1.6.3,<1.7.0", - "synphot>=1.2", - "tweakwcs>=0.8.6", - "asdf-astropy>=0.3.0", - "wiimatch>=0.2.1", - "packaging>20.0", - "importlib-metadata>=4.11.4", - "jsonschema>=4.8", -] -dynamic = [ - "version", -] - -[project.readme] -file = "README.md" -content-type = "text/markdown" - -[project.license] -file = "LICENSE" -content-type = "text/plain" - -[project.urls] -Homepage = "https://github.com/spacetelescope/jwst" -Tracker = "https://github.com/spacetelescope/jwst/issues" -Documentation = "https://jwst-pipeline.readthedocs.io/en/stable/" -"Source Code" = "https://github.com/spacetelescope/jwst" - -[project.scripts] -adjust_wcs = "jwst.scripts.adjust_wcs:main" -asn_edit = "jwst.scripts.asn_edit:main" -asn_from_list = "jwst.associations.asn_from_list:main" -asn_gather = "jwst.scripts.asn_gather:main" -asn_generate = "jwst.associations.main:main" -asn_make_pool = "jwst.scripts.asn_make_pool:main" -assign_wcs = "jwst.scripts.assign_wcs:main" -collect_pipeline_cfgs = "jwst.scripts.collect_pipeline_cfgs:main" -coron = "jwst.scripts.coron:main" -create_data = "jwst.scripts.create_data:main" -csvconvert = "jwst.csv_tools.csvconvert:CSVConvertScript" -cube_build = "jwst.scripts.cube_build:main" -dark_current = "jwst.scripts.dark_current:main" -data_generate = "jwst.scripts.data_generate:main" -dqinit = "jwst.scripts.dqinit:main" -exp_to_source = "jwst.exp_to_source.main:Main" -flatfieldcorr = "jwst.scripts.flatfieldcorr:main" -fringecorr = "jwst.scripts.fringecorr:main" -ipc = "jwst.scripts.ipc:main" -jump = "jwst.scripts.jump:main" -linearitycorr = "jwst.scripts.linearitycorr:main" -make_header = "jwst.scripts.make_header:main" -okify_regtests = "jwst.scripts.okify_regtests:main" -outlier_detection = "jwst.scripts.outlier_detection:main" -persistencecorr = "jwst.scripts.persistencecorr:main" -photomcorr = "jwst.scripts.photomcorr:main" -pointing_summary = "jwst.scripts.pointing_summary:main" -rampfitcorr = "jwst.scripts.rampfitcorr:main" -refpix = "jwst.scripts.refpix:main" -resample = "jwst.scripts.resample:main" -saturationcorr = "jwst.scripts.saturationcorr:main" -schema_editor = "jwst.scripts.schema_editor:main" -schemadoc = "jwst.scripts.schemadoc:main" -set_telescope_pointing = "jwst.scripts.set_telescope_pointing:main" -"set_telescope_pointing.py" = "jwst.scripts.set_telescope_pointing:deprecated_name" -set_velocity_aberration = "jwst.scripts.set_velocity_aberration:main" -"set_velocity_aberration.py" = "jwst.scripts.set_velocity_aberration:deprecated_name" -straylight = "jwst.scripts.straylight:main" -superbias = "jwst.scripts.superbias:main" -v1_calculate = "jwst.scripts.v1_calculate:main" -verify_install_requires = "jwst.scripts.verify_install_requires:main" -world_coords = "jwst.scripts.world_coords:main" - -[project.entry-points."stpipe.steps"] -jwst = "jwst.stpipe.integration:get_steps" - -[project.entry-points.pytest11] -report_crds_context = "pytest_crds.plugin" - -[project.optional-dependencies] -docs = [ - "matplotlib", - "sphinx", - "sphinx-astropy", - "sphinx-automodapi", - "sphinx-rtd-theme", - "tomli; python_version <\"3.11\"", -] -sdp = [ - "jplephem>=2.9", - "pysiaf>=0.13.0", -] -test = [ - "ci-watson>=0.5.0", - "colorama>=0.4.1", - "readchar>=3.0", - "ruff", - "pytest>=6.0.0", - "pytest-cov>=2.9.0", - "pytest-doctestplus>=0.10.0", - "requests_mock>=1.0", -] - -[build-system] -requires = [ - "setuptools>=61.2", - "setuptools_scm[toml]>=3.4", - "wheel", - "oldest-supported-numpy", -] -build-backend = "setuptools.build_meta" - -[tool.setuptools] -zip-safe = false -include-package-data = false - -[tool.setuptools.packages.find] -namespaces = false - -[tool.setuptools.package-data] -"*" = [ - "*.asdf", - "*.cfg", - "tests/data/*.csv", - "tests/data/*.ecsv", - "tests/data/*.fits", - "tests/data/**/*.fits", - "*.json", - "tests/data/*.json", - "tests/data/**/*.json", - "tests/data/*.txt", - "*.yaml", - "*.cat", - "*.hdr", -] -"jwst.fits_generator" = [ - "templates/*.inc", - "templates/*.txt", - "tests/okfile/*.prop", -] -"jwst.lib" = [ - "tests/data/*.asdf", - "tests/data/*.db", - "tests/data/*.ecsv", - "tests/data/*.fits", -] -"jwst.associations" = [ - "tests/data/*.py", -] -"jwst.lib.src" = [ - "*.c", -] -"jwst.cube_build.src" = [ - "*.c", -] -"jwst.straylight.src" = [ - "*.c", -] -"jwst.transforms" = [ - "resources/schemas/stsci.edu/jwst_pipeline/*.yaml", -] -"jwst.stpipe.resources" = [ - "schemas/*.yaml", -] - -[tool.build-sphinx] -source-dir = "docs" -build-dir = "docs" -all_files = "1" - -[tool.distutils.upload_docs] -upload-dir = "docs/_build/html" -show-response = 1 - -[tool.pytest.ini_options] -minversion = "6.0" -norecursedirs = [ - "docs/_build", - "docs/exts", - "jwst/timeconversion", - "jwst/associations/tests/data", - "scripts", - ".tox", - ".eggs", - "build", - "venv", -] -junit_family = "xunit2" -inputs_root = "jwst-pipeline" -results_root = "jwst-pipeline-results" -text_file_format = "rst" -doctest_plus = "enabled" -doctest_rst = "enabled" -addopts = ["-p no:legacypath", - "--show-capture=no", - "--report-crds-context", -] -filterwarnings = [ - "error::ResourceWarning", - "ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning", -] - -[tool.coverage.run] -omit = [ - "jwst/conftest.py", - "jwst/setup.py", - "jwst/tests/test*", - "jwst/regtest/test*", - "jwst/*/tests/*", - "docs/*", - "*/jwst/conftest.py", - "*/jwst/setup.py", - "*/jwst/tests/test*", - "*/jwst/regtest/test*", - "*/jwst/*/tests/*", - "*/docs/*", - "*.rmap", - "*.pmap", -] - -[tool.coverage.report] -exclude_lines = [ - "pragma: no cover", - "if self.debug:", - "except ImportError", - "raise AssertionError", - "raise NotImplementedError", - "if __name__ == '__main__':", -] -omit = [ - "*.rmap", - "*.pmap", -] - -[tool.setuptools_scm] -write_to = "jwst/_version.py" - -[tool.ruff] -exclude = [ - "jwst/extern", - "docs", - "jwst/associations", - "jwst/fits_generator", - ".tox", - ".eggs", - "build", -] -lint.ignore = [ - "E741", -] -line-length = 130 - -[tool.ruff.lint.per-file-ignores] -"jwst/ramp_fitting/tests/compare_cr_navg_files.py" = [ - "E402", -] -"jwst/ramp_fitting/tests/compare_crs.py" = [ - "E402", -] -"jwst/ramp_fitting/tests/compare_cr_files.py" = [ - "E402", -] -"jwst/ramp_fitting/tests/create_cube.py" = [ - "E402", -] -"jwst/ramp_fitting/tests/mc_3d.py" = [ - "E402", -] From 0f10fa31279feb89abd36d6ead44d8c178bb0ba7 Mon Sep 17 00:00:00 2001 From: Nadia Date: Wed, 12 Jun 2024 09:54:58 -0400 Subject: [PATCH 8/8] point to gwcs branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 32c2b05a60..fe46d35f36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "BayesicFitting>=3.0.1", "crds>=11.17.14", "drizzle>=1.15.0", - "gwcs>=0.21.0,<0.22.0", + "gwcs @ git+https://github.com/nden/gwcs.git@ff195fb, "numpy>=1.22", "opencv-python-headless>=4.6.0.66", "photutils>=1.5.0",