Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings for apply_numpy_specials depend on order #17

Open
michaelaye opened this issue Nov 11, 2016 · 7 comments
Open

Warnings for apply_numpy_specials depend on order #17

michaelaye opened this issue Nov 11, 2016 · 7 comments

Comments

@michaelaye
Copy link
Contributor

Using pysis 0.5.2

I'm having an issue with Cubefile.apply_numpy_specials.

Apparently the order matters for receiving a warning or not.
Possibly, because your hardcoded Min/Max values don't fit to what I find in this Cassini ISS image?

See screenshot:
screenshot 2016-11-10 21 17 50

@michaelaye
Copy link
Contributor Author

My RingCube is just a wrapper around your CubeFile for Saturn Ring images, doesn't do anything with your CubeFile inner stuff.

@michaelaye
Copy link
Contributor Author

could you comment on this?

@wtolson
Copy link
Owner

wtolson commented Jan 10, 2017

I believe the warning is because it is running the comparisons on the special values. This shouldn't cause any problems however it does proabally mean there is a better way to do this.

@michaelaye
Copy link
Contributor Author

Where did you get those special values from? Are they defined in a standard document somewhere? Possibly either those values need to be updated, or the ISIS routine creating those numbers in the cube, I guess one of them is not consistent with current standards/expectations.

@wtolson
Copy link
Owner

wtolson commented Jan 10, 2017

They're the numpy special values that replace the cube file special values like np.NINF, np.inf and np.nan.

@michaelaye
Copy link
Contributor Author

michaelaye commented Feb 3, 2017

I think this is only happening because numpy.less does not like to see the np.nans from the 'Null' replacement, when doing the 'Max' and 'Min' replacement.
As I wrote above, if we do the 'Null' to np.nan replacement at the end, the warning goes away.

Do you see a problem with doing the replacement of Null->np.nan at the end? If not, I can just submit a simple PR to change the order of this.

@michaelaye
Copy link
Contributor Author

Ok, no, obviously I need to set NANs first, because the minimum is also a negative special pixel value.
But because we know that this operation is working, one should suppress the numpy warning in this case, using np.errstate(invalid='ignore') for those 2 operations. I'll send in a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants