astropy / astropy/ccdproc

ImageFileColection.hdus() should warn if kwarg not found

Open
#744 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
93
Forks
92
Avg merge
14h 44m
Merged PRs (30d)
30

Description

In the following code snippet I misremembered the keyword argument to return the filename, it was then likely interpreted as a header keyword filter, and hdus returned an empty list. It would be better if the there was a warning for each file that didn't contain the filter keyword.

Interestingly, the following example also caused the `images.summary` not to show in a Jupyter notebook, despite it being called before `images.hdus`. I.e., if you comment out the for loop, the summary shows, but does not if it's left in.

`
datadir='/where/your/data/is/'
path = Path(datadir)
images = ccdp.ImageFileCollection(path)

images.summary['file', 'imagetyp', 'filter', 'exptime', 'naxis1', 'naxis2']

for im,fname in images.hdus(imagetyp='Bias Frame',with_fname=True):
print(im.header['EXPTIME'])
`

In the above, of course, with_fname should have been return_fname

Contributor guide

Open the contributing guide

Research direction

Start at ImageFileCollection.hdus() and reproduce the provided example with the misspelled with_fname argument. The change should warn for each file that lacks the requested filter keyword; also investigate why the preceding images.summary output is not shown in a Jupyter notebook when the loop runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.