Comments (4)
Probably related to astropy/astropy#14175
from dragons.
Also broken is the multiplication with a file without a mask.
ad_withmask.multiply(ad_nomask)
If I do ad_withmask.multiply(ad_withmask)
, no error. Starting to look more and more like a bug in astropy itself. The propagation of the mask does not take into account that one of the operand might not have a mask.
from dragons.
Completely removing astrodata
from the equation. Just using NDDataRef
now. Either I'm not using it the right way, or there is a bug in astropy
v5.3. I need someone with more knowledge than me to assess that.
>>> import numpy as np
>>> from astropy.nddata import NDDataRef
>>> array = np.array([[0, 1, 0], [1, 0, 1], [0, 1, 0]])
>>> mask = np.array([[0, 1, 64], [8, 0, 1], [2, 1, 0]])
>>> nref_nomask = NDDataRef(array)
>>> nref_mask = NDDataRef(array, mask=mask)
# multiply no mask by constant (no mask * no mask)
>>> nref_nomask.multiply(1., handle_mask=np.bitwise_or).mask # returns nothing, no mask
# multiply no mask by itself (no mask * no mask)
>>> nref_nomask.multiply(nref_nomask, handle_mask=np.bitwise_or).mask # return nothing, no mask
# multply mask by constant (mask * no mask)
>>> nref_mask.multiply(1., handle_mask=np.bitwise_or).mask
...
TypeError: unsupported operand type(s) for |: 'int' and 'NoneType'
# multiply mask by itself (mask * mask)
>>> nref_mask.multiply(nref_mask, handle_mask=np.bitwise_or).mask
array([[ 0, 1, 64],
[ 8, 0, 1],
[ 2, 1, 0]])
# multiply mask by no mask (mask * no mask)
>>> nref_mask.multiply(nref_nomask, handle_mask=np.bitwise_or).mask
...
TypeError: unsupported operand type(s) for |: 'int' and 'NoneType'
@chris-simpson @saimn, do you think that this needs reporting to astropy
or am I doing something I shouldn't be doing?
from dragons.
@KathleenLabrie - Yes please open a new issue, with the example to reproduce 👍
from dragons.
Related Issues (20)
- Fix duplicate warnings correctly
- Spaces not supported in caldb database paths HOT 1
- Multiprocessing issues with "differential evolution"?
- Improve robustness of reduction by checking compatibility of all inputs
- Logic for when to write output files needs improving
- Incomplete provenance in output of NIRI's makeProcessedBPM recipe
- caldb add does not warn when trying to add an unsupported file
- flatCorrect() [and other primitives?] do some checks on user-supplied calibrations
- Expose threshold for flagging resampled bad pixels HOT 2
- findApertures fooled by negative images from ABBA in longslit stacked data HOT 2
- QECorrect Primitive not working on Longslit E2V data v 3.1 HOT 1
- Strange crash in determineAstrometricSolution - negative dimension HOT 1
- Improve tracing algorithm
- Crash on skyCorrectFromSlit when using small regions HOT 1
- Convert wavelength units when opening a file (or check units in DRAGONS)
- stackFrames primitive sets incorrect filename if phu["ORIGNAME"] does not exists.
- DRAGONS Subprocess Unable to Cleanly Shutdown in Background Worker with GOATS
- Extend `logutils.config` to Support Custom Handler Integration
- Integer 32768 out of bounds for int16 when generating the master bias HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dragons.