8000 Update Ami analyze to input two new input parameters: JP-1742 by jemorrison · Pull Request #5548 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update Ami analyze to input two new input parameters: JP-1742 #5548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 18, 2020

Conversation

jemorrison
Copy link
Collaborator
@jemorrison jemorrison commented Dec 17, 2020

Updates for ami analyze for JP-1742
The two new input parameters are 'set_psf_offset_find_rotation' and 'set_rotsearch_d'

These seems a bit long. When I was testing I tripped up the exact name of the parameter. Maybe we could use something shorter- maybe 'set_psf_offset' 'set_rotsearch' - suggestions - or just leave it as it is.

Fixes #5388 / JP-1742

@codecov
Copy link
codecov bot commented Dec 17, 2020

Codecov Report

Merging #5548 (2a9993d) into master (af1f0b7) will increase coverage by 0.60%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5548      +/-   ##
==========================================
+ Coverage   71.12%   71.73%   +0.60%     
==========================================
  Files         410      410              
  Lines       36339    38015    +1676     
  Branches     5598     6026     +428     
==========================================
+ Hits        25847    27270    +1423     
- Misses       8851     9053     +202     
- Partials     1641     1692      +51     
Flag Coverage Δ *Carryforward flag
nightly 71.10% <88.88%> (ø) Carriedforward from 9526ae8
unit 51.83% <77.77%> (+0.36%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
jwst/ami/ami_analyze.py 58.82% <66.66%> (-14.35%) ⬇️
jwst/ami/ami_analyze_step.py 86.66% <88.88%> (-9.89%) ⬇️
jwst/pipeline/calwebb_detector1.py 71.28% <0.00%> (-20.38%) ⬇️
jwst/tso_photometry/tso_photometry_step.py 47.50% <0.00%> (-18.02%) ⬇️
jwst/pipeline/calwebb_spec2.py 80.68% <0.00%> (-13.26%) ⬇️
jwst/saturation/saturation.py 89.87% <0.00%> (-10.13%) ⬇️
jwst/resample/resample_spec.py 91.91% <0.00%> (-5.32%) ⬇️
jwst/lib/exposure_types.py 65.38% <0.00%> (-4.62%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af1f0b7...2a9993d. Read the comment docs.

@hbushouse hbushouse added this to the Build 7.7 milestone Dec 17, 2020
@@ -11,6 +11,8 @@ class AmiAnalyzeStep(Step):
spec = """
oversample = integer(default=3, min=1) # Oversampling factor
rotation = float(default=0.0) # Rotation initial guess [deg]
set_psf_offset_find_rotation = string(default='0.0 0.0') # Psf offset values to use to create the model array
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely agree that shorter names would be good for both of these. Perhaps just psf_offset and rotation_search?

Copy link
Collaborator
@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall code structure looks fine. Just use shorter names everywhere for the params themselves.

And don't forget a change log entry.

Comment on lines 40 to 41
psf_offset = self.set_psf_offset_find_rotation.split(' ')
psf_offset_find_rotation = (float(psf_offset[0]), float(psf_offset[1]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more readable would be:

psf_offset_find_rotation = [float(a) for a in self.set_psf_offset_find_rotation.split()]

Same below for rotsearch_parameters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the change but it is not more readable to me. In fact I had to stare at that a while to understand what it was going

Comment on lines 45 to 48
self.log.info(f'Oversampling factor = {oversample}')
self.log.info(f'Initial rotation guess = {rotate} deg')
self.log.info(f'Initial values to use for psf offset = {psf_offset_find_rotation}')
self.log.info(f'Initial values to use for rotation search {rotsearch_parameters}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logging already happens when the step is initialized. It's not as nicely formatted, but it is there. It then gets logged again, each on its own line:

2020-12-17 14:09:38,885 - stpipe.Ami3Pipeline.ami_analyze - INFO - Step ami_analyze parameters are: {'pre_hooks': [], 'post_hooks': [], 'output_file': None, 'output_dir': None, 'output_ext': '.fits', 'output_use_model': False, 'output_use_index': True, 'save_results': False, 'skip': False, 'suffix': None, 'search_output_file': True, 'input_dir': '/private/var/folders/jg/by5st33j7ps356dgb4kn8w900001n5/T/pytest-of-jdavies/pytest-30/test_niriss_ami3_run_pipeline0', 'oversample': 3, 'rotation': 1.49}
2020-12-17 14:09:38,885 - stpipe.Ami3Pipeline.ami_analyze - INFO - Oversampling factor = 3
2020-12-17 14:09:38,885 - stpipe.Ami3Pipeline.ami_analyze - INFO - Initial rotation guess = 1.49 deg

Would be nice if we could make stpipe print these to be more readable by using pprint.pformat or similar.

Fine to keep as is though I guess, as it was there originally.

Copy link
Collaborator
@jdavies-st jdavies-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that the regression tests on this branch pass. 🎉

@hbushouse hbushouse merged commit 4310896 into spacetelescope:master Dec 18, 2020
@jemorrison jemorrison deleted the JP-1742_Ami_analyze branch January 7, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add parameters for updated ami_analyze algorithm
3 participants
0