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

DM-39131: Avoid setting infinite limits in scatterPlot #103

Merged
merged 7 commits into from May 16, 2023
Merged

Conversation

taranu
Copy link
Contributor

@taranu taranu commented May 10, 2023

No description provided.

# statistics
for name in self._stats:
base.append((f"{{band}}_highSN{defaults.suffix_stat}_{name}", Scalar))
base.append((f"{{band}}_lowSN{defaults.suffix_stat}_{name}", Scalar))
base.append(("lowSnThreshold", Scalar))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it? So much so that I added similar loop roll-ups for the marginal histograms. Also, it now loops over self.plotTypes rather than looping over all possible plot types and checking if they're in self.plotTypes, so you can set the order of plotting however you like.

colormaps_datatype = {
"stars": newBlues,
"galaxies": newReds,
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be colour maps for the other types, even if they are just set to None for now and fixed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the colormap as an attribute but couldn't find colormaps for unknown or all/any. There is a divergent one with three colors in skyPlot.py.

if "any" in self.plotTypes: # type: ignore
totalX.append(cast(Vector, data["x"]))

# This filters out nans, but that probably should have happened earlier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have happened earlier, I don't like taking NaNs out of x and not their corresponding y.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine because it's just for histograms. In fact all of the plotting calls will filter out non-finite points, so the [x for x in totalX if x == x] lines were unnecessary. The only issues come with trying to set limits without filtering non-finite points (not just nan ones).

I do agree that filtering should happen earlier. Probably most plots should select S/N > 3 or 5, like the scatterplot unit test does.

@@ -1,33 +1,38 @@
2.165581377360398818e+01 2.537420191914861789e+00
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are really annoying but I think I will make a future ticket to sort out testing in atools in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it's great.

print(f"{xLims=}")
xLims[0] = min(xLims[0], xMin)
xLims[1] = max(xLims[1], xMax)
print(f"{xLims=}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want these print statements here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops... no, definitely not.

@taranu taranu merged commit f6d3d70 into main May 16, 2023
7 checks passed
@taranu taranu deleted the tickets/DM-39131 branch May 16, 2023 17:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants