fix to "okmap becomes complex164 if left unattended"
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 1
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
mnms/utils.py, add
.astype(okmap.dtype, copy=False)tophase
def fourier_resample(imap, omap=None, shape=None, wcs=None, dtype=None):
...
phase = np.exp(-2j*np.pi*(ky*shift[0] + kx*shift[1]))
okmap = concurrent_op(np.multiply, okmap, phase)
okmap = enmap.ndmap(okmap, omap.wcs)
return irfft(okmap, omap=omap, n=omap.shape[-1], normalize='forward')
to
phase = np.exp(-2j*np.pi*(ky*shift[0] + kx*shift[1])).astype(okmap.dtype, copy=False)
okmap = concurrent_op(np.multiply, okmap, phase)
okmap = enmap.ndmap(okmap, omap.wcs)
return irfft(okmap, omap=omap, n=omap.shape[-1], normalize='forward')
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open mnms/utils.py and locate fourier_resample. Read the phase calculation and the following multiplication with okmap, then apply the requested dtype-preserving change. Done means phase uses okmap.dtype without copying unnecessarily and okmap no longer becomes complex164 when left unattended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100