Repository navigation
Ndmask - #224
Ndmask#224wkerzendorf wants to merge 2 commits into
Conversation
|
In any function that takes an |
|
@kbarbary what do you mean by access? Can you give an example? |
|
@wkerzendorf Imagine a photometry function that takes What I'm really saying is: don't we want a |
|
Initially that was done because it inherited from ndarray. But sure, do you mind if we put this onto the 'to be done`-pile and see what fundamental problems there exist first? |
|
@wkerzendorf A second question: again, imagine a photometry function that takes Would it be simpler to promise that the |
|
@kbarbary raises a good point that I hadn't considered before - whether we want to separate flags from masks. This would make the mask implementation simpler, because it's easy to know how to combine bool masks, and flags just don't get combined at all. One reason for doing this is that one might want to have different flags for good data - the way we are going right now, we can only have different kinds of bad data, but one kind of good data. I've seen many instances in astronomy of flags on good data. What do other people think? |
|
@astrofrog @kbarbary I asked that point slightly differently earlier do we want to call it flags or masks. But actually splitting it is a good idea. What would we do in the use case that we have different flags of 2=saturated and 4=too close to the edge and want to mask all the pixels that are too close to the edge. Should flags and mask talk? In addition, just talking about a boolean mask. How does addition work. When we add two pixels and one of them is bad what should the output be? mask=not masked and pixel just from the good frame; mask=mask and pixel=na? What are the thoughts on this? |
|
If we go down the road of having bool-only masks, and flags as separate information, we should look into what Numpy does for masked arrays with respect to operations: It looks like the default is to basically do a NAND operation on the masks. It might be worth being consistent with them? In your scenario, I might want to do: i.e. just explicitly set the masks, so that they don't have to talk to each other internally. What do you think? |
|
I agree with @astrofrog about explicitly setting masks, e.g., This makes explicit exactly what is being masked. In a different operation, one might want to mask saturated stars (d.flags == 2) rather than things too close to the edge. Letting various operations create their own masks based on the Also agree about the default behavior of mask arithmetic (to coincide with |
|
okay we'll have masks and flags. What problems could we run into with this? Is this to many attributes for nddata? Regarding the MA behaviour I think that is not trivial. Numpy is currently struggling with that and I think this might be worth a read: https://github.com/numpy/numpy.scipy.org/blob/master/NA-overview.rst |
|
Interesting discussion on NumPy masked arrays, but I don't think we have to worry too much about it. With In summary I think it's fine to choose a convention for basic arithmetic operations on Personally, I don't think 'too many attributes' is a problem. A lot of If we decide to separate |
|
closing this pull request as implemented in #303 |
Fixed one of the warnings raised by sphinx 1.4
This is a split from the previous pull request (#202) only implementing masks