Closed lspitler closed 4 years ago
Actually sleeping on this, I think a simple modification in astropy's discretize_oversample_1D/2D would solve this problem. They just need to force an int()
in the num
arg to linspace
... I might submit an Issue/PR to astropy
.
Submitted issue and hopefully a PR over at astropy
: https://github.com/astropy/astropy/issues/10695
The astropy
fix has now been released: https://github.com/astropy/astropy/releases/tag/v4.0.2
One set of error is that np.where
doesn't carry the units through anymore:
Fix is to convert:
signal = np.where(saturated, 0 * u.electron / u.pixel, signal)
to:
signal = np.where(saturated, 0 , signal) * u.electron / u.pixel
@AnthonyHorton @danjampro can you do a review on this PR? It is ready to merge.
Travis is failing on certain builds, but we'll reconfiguring the test environment when #38 is merged so we can address it over there.
Pausing this effort as it seems #38 works just fine without these changes. This might imply my incorrect usage of outdated astropy
versions during my tests.
Closing as #38 tests (without the changes in this PR) work just fine. @lspitler likely was using a dated testing environment.
Bringing a few commits from #38 to here as they are seperate to that PR. @AnthonyHorton I need some input on this one.
First few commits are minor updates I needed to run unit tests in
test_psf.py
:I think these are minor, though I needed them to run tests.
The main problem is that
astropy
'sdiscretize_oversample_1D/2D
was recently updated to usenp.linspace
, for good reason: https://github.com/astropy/astropy/pull/9293Trouble is that
np.linspace
now requires the argnum
to be an integer: https://numpy.org/doc/stable/reference/generated/numpy.linspace.htmlThis wasn't an issue before as
discretize_oversample_1D/2D
usednp.arange
which accepted different inputs just fine from thegunagala.psf
functions used: https://numpy.org/doc/stable/reference/generated/numpy.arange.html@AnthonyHorton can you suggest a way forward?
My last commit now forces integer
x_range
andy_range
, but I don't think this is the right way to do this.