Skip to content

Commit

Permalink
use scikit-image for ellipse functions
Browse files Browse the repository at this point in the history
rename toxenvs

formatting

don't skip `scikit-image`

broader except base

add change log entry

use `scikit-image` and `shapely` functions to construct ellipses, and a modified Welzl's algorithm to find smallest enclosing circles

add rules

fix requirement

use Shapely polygon construction and minimum rotated rectangle function to get ellipse parameters

fix for Python<=3.8

send points as array instead of as tuple

remove flip from `opencv` code

match `skimage` angle results to `opencv`

test oblong shape for ellipse

add more attribution

rename tests

vectorized and documentation

remove usage of `opencv-python` entirely

update change log entry

fixes

remove usage of shapely

pin scikit-image

replace other usages of cv.ellipse

convert to tuples to fix equality comparison

resolve negative angle issue

remove extranneous function definition

avoid partial index tuple expansion to satisfy Python 3.10 test syntax errors

adjust expected test results to match skimage ellipses
  • Loading branch information
zacharyburnett committed Aug 27, 2024
1 parent 4e6df94 commit 9a7727b
Show file tree
Hide file tree
Showing 11 changed files with 109,999 additions and 109 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ jobs:
- toxenv: test-numpy120
os: ubuntu-latest
python-version: '3.8'
- toxenv: test-opencv-xdist
os: ubuntu-latest
python-version: '3.x'
- toxenv: test-jwst-xdist-cov
os: ubuntu-latest
python-version: '3.x'
Expand Down
161 changes: 161 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,167 @@
1.3.5 (unreleased)
==================

Changes to API
--------------

- replace usage of ``opencv-python`` with analagous functionality from ``scikit-image`` [#138]

Bug Fixes
---------

ramp_fitting
~~~~~~~~~~~~

- Fix a bug in Poisson variance calculation visible when providing an average
dark current value in which the specified dark current was not converted to the
appropriate units for pixels with negative slopes. This resulted in
incorrect SCI, ERR, and VAR_POISSON values. Also required revising the approach
for catching all-zero variance cases when average dark current was not
specified. [#255]

1.7.0 (2024-03-25)
==================

Changes to API
--------------

jump
~~~~

- Switch multiprocessing method to ``fork_server``. [#249]

ramp_fitting
~~~~~~~~~~~~

- Switch multiprocessing method to ``fork_server``. [#249]

Bug Fixes
---------

jump
~~~~

- Updated the shower flagging code to mask reference pixels, require a minimum
number of groups to trigger the detection, and use all integrations to determine
the median value. [#248]

ramp_fitting
~~~~~~~~~~~~

- Changed the data type of three variables that are used in measuring
the jump free segments of integrations. The variables were uint8 and
they would yield wrong results for integrations with more than 256
groups. [#251]

- Use ``sqrtf`` instead of ``sqrt`` in ols_cas22 ramp fitting with
jump detection to avoid small numerical errors on different systems
due to a cast to/from double. [#252]


Other
-----

jump
~~~~

- Enable the use of multiple integrations to find outliers. Also,
when the number of groups is above a threshold, use single pass
outlier flagging rather than the iterative flagging. [#242]

- Use ``sqrtf`` instead of ``sqrt`` in ols_cas22 ramp fitting with
jump detection to avoid small numerical errors on different systems
due to a cast to/from double. [#252]

1.6.1 (2024-02-29)
==================

Changes to API
--------------

ramp_fitting
~~~~~~~~~~~~

- Add ``average_dark_current`` to calculations of poisson variance. [#243]

1.6.0 (2024-02-15)
==================

Changes to API
--------------

jump
~~~~

- Add in the flagging of groups in the integration after a snowball
occurs. The saturated core of the snowball gets flagged as jump
for a number of groups passed in as a parameter [#238]

Bug Fixes
---------

jump
~~~~

- Fixed the computation of the number of rows per slice for multiprocessing, which
was causing different results when running the step with multiprocess [#239]

- Fix the code to at least always flag the group with the shower and the requested
groups after the primary shower. [#237]

Other
-----

jump
~~~~

- Reorganize jump docs between the jwst and stcal repos. [#240]

ramp_fitting
~~~~~~~~~~~~

- Reorganize ramp_fitting docs between the jwst and stcal repos. [#240]


1.5.2 (2023-12-13)
==================

- non-code updates to testing and development infrastructure

1.5.1 (2023-11-16)
==================

- re-release to publish source distribution

1.5.0 (2023-11-15)
==================

Other
-----

- Added ``alignment`` sub-package. [#179]

- Enable automatic linting and code style checks [#187]

ramp_fitting
~~~~~~~~~~~~

- Refactor Casertano, et.al, 2022 uneven ramp fitting and incorporate the matching
jump detection algorithm into it. [#215]

- Fix memory issue with Cas22 uneven ramp fitting [#226]

- Fix some bugs in the jump detection algorithm within the Cas22 ramp fitting [#227]

- Moving some CI tests from JWST to STCAL. [#228, spacetelescope/jwst#6080]

- Significantly improve the performance of the Cas22 uneven ramp fitting algorithm. [#229]

Changes to API
--------------

-

>>>>>>> 7499170 (update change log entry)
Bug Fixes
---------

Expand Down
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ classifiers = [
'Programming Language :: Python :: 3',
]
dependencies = [
'astropy >=5.0.4',
'scipy >=1.6.0',
'numpy >=1.17',
"asdf >=2.15.0",
"astropy >=5.0.4",
"gwcs >= 0.18.1",
"scikit-image>=0.18.0",
"scipy >=1.7.2",
"numpy >=1.21.2",
]
dynamic = ['version']

Expand All @@ -35,9 +38,6 @@ test = [
'pytest-doctestplus',
'pytest-openfiles >=0.5.0',
]
opencv = [
'opencv-python >=4.6.0.66',
]

[project.urls]
'repository' = 'https://github.com/spacetelescope/stcal'
Expand Down Expand Up @@ -78,10 +78,11 @@ norecursedirs = [
[tool.ruff]
line-length = 110
select = ['F', 'W', 'E', 'C']
ignore = [
'C901', # variable is too complex
extend-ignore = [
'C901', # variable is too complex,
'E501', # Line too long
]
exclude = [
extend-exclude = [
'docs',
'build',
'dist',
Expand Down
Loading

0 comments on commit 9a7727b

Please sign in to comment.