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

Automatic Flagging of Negative Magnitudes #112

Open
jenniferyee opened this issue Nov 21, 2023 · 3 comments
Open

Automatic Flagging of Negative Magnitudes #112

jenniferyee opened this issue Nov 21, 2023 · 3 comments

Comments

@jenniferyee
Copy link
Collaborator

jenniferyee commented Nov 21, 2023

Currently, if we import a data file with negative magnitude values, it raises the following error:

ValueError: Scaling of magnitude uncertainties to flux space resulted in zero or negative values. Maybe the photometry format is in fact 'flux', not 'mag' (as you indicated). File name: [your file]

This necessitates flagging all the negative magnitudes beforehand. This is even a problem if I include a bad data array to flag those points.

What if instead, we raised a warning and automatically set those points to bad?

@rpoleski
Copy link
Owner

I'm somehow against such changes of code based on changes of opinion. Somebody could have written a code/script that depends on our error, so a change in that could result in lack of compatibility.
Instead, we could extend the arguments of MulensData. The best one would be to allow something like bad='negative_uncertainties' that will change to the behavior you want. Agreed?

@jenniferyee
Copy link
Collaborator Author

Well, I guess my expectation is that if we set a "bad" array when we import the data, it won't raise the exception. So, that's the simplest change, and my preference. That allows the user to flag the bad points without manually editing the data file.

A more complicated change would be to allow "bad" to take some kind of conditional. But that's probably TOO complicated.

@rpoleski
Copy link
Owner

rpoleski commented Dec 1, 2023

First, do you really mean 'if we import a data file with negative magnitude values'? Or maybe negative uncertainties (in either mag or flux space)?
Second, we cannot change the code in v2 to work differently, cause it could breaks somebody's code that uses MM. Either we do extension that doesn't change the previous behavior (and stay in v2) or we change what we want in v3.

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