Skip to content

DM-55750: wholeSkyPlot updates - #487

Open
sr525 wants to merge 8 commits into
mainfrom
tickets/DM-55750
Open

sr525 wants to merge 8 commits into
mainfrom
tickets/DM-55750

Conversation

@sr525

@sr525 sr525 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@sr525
sr525 force-pushed the tickets/DM-55750 branch 2 times, most recently from 36353a2 to 76e7a21 Compare August 7, 2026 14:59
ax.invert_xaxis()
# This doesn't work but I would like it to.
# sp.ax.set_xlim(xlim)
# sp.ax.set_ylim(ylim)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You need to do sp.set_extent([xlim[0], xlim[1], ylim[0], ylim[1]])

@sr525
sr525 force-pushed the tickets/DM-55750 branch 2 times, most recently from 78299ab to 60e7561 Compare August 24, 2026 17:56
Comment thread python/lsst/analysis/tools/actions/plot/wholeSkyPlot.py
width = maxRa - minRa
height = maxDec - minDec
if width > 10:
width = minRa + 360 - maxRa

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm trying to think of a better way of doing this. The problem is that if you could specify the corners or the rectangle (rather than pos and width/height) it would work fine in skyproj which understands spheres. But with the Rectangle interface you might be stuck with this.

else:
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax, extent=[-180, 180, -90, 30])
proj = sp.ax.projection

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I have learned the hard way debugging skyproj (now merged to main, not released yet and not suitable for this PR right now), you have to do proj = copy.copy(sp.ax.projection). (And import copy on top). Otherwise there is a race condition and you may not get rectangles.

linewidths=0.5,
zorder=100,
for i, tract in enumerate(data["tract"][outlierInds]):
corners = getTractCorners(skymap, tract)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here's that bad getTractCorners again.

nanPatch = Patch(
facecolor="white",
for i, tract in enumerate(data["tract"][nanInds]):
corners = getTractCorners(skymap, tract)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It keeps on coming!

edgecolors=outlierColor,
linewidths=0.5,
zorder=100,
for i, tract in enumerate(data["tract"][outlierInds]):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is all this duplicated code necessary? Can't you loop over all tracts and check as you add each one if it's an inlier, an outlier, or a nan-liar?

@erykoff erykoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A couple of minor comments. This looks great, and the plots look great!

sp = skyproj.McBrydeSkyproj(ax=ax)
else:
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax, extent=[-180, 180, -90, 30])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this is specifically and always the LSST region?

sp = skyproj.McBrydeSkyproj(ax=ax, extent=[-180, 180, -90, 30])

# Eli says this step is necessary and he knows more
# than me about most things but especially skyproj.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You do not need this comment here. But you can say that this copy is necessary to avoid a possible race condition when drawing figures in skyproj, and has been fixed in an upcoming version of skyproj.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The other thing is that the newest version of skyproj allows you to draw the patch directly ... but this isn't in our env yet.

# Get bounding box is needed if the skymap isn't rings
# The discrete skymaps don't return a box from
# getInnerSkyRegion
tractBox = skymap[tractId].getInnerSkyRegion().getBoundingBox()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the inner sky region is a Box then is this final thing a no-op?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is, but this catches the cases when it isn't.

@sr525
sr525 force-pushed the tickets/DM-55750 branch from 76fc365 to ee42550 Compare October 1, 2026 03:12
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.

2 participants