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-34994: Upgrade to fgcm 3.9.2 with fix for refstar color plot crash. #30

Merged
merged 8 commits into from
May 27, 2022
2 changes: 1 addition & 1 deletion fgcm/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '3.9.1'
__version__ = '3.9.3'

__version_info__ = __version__.split('.')
10 changes: 7 additions & 3 deletions fgcm/fgcmStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,8 @@ def plotRefStarColorTermResiduals(self, fgcmPars):

refUse, = np.where((refMag[objRefIDIndex[goodRefStars[okColor]], bandIndex] < 90.0) &
(objMagStdMean[goodRefStars[okColor], bandIndex] < 90.0))
if refUse.size == 0:
continue
refUse = okColor[refUse]

delta = (objMagStdMean[goodRefStars[refUse], bandIndex] -
Expand All @@ -2129,9 +2131,11 @@ def plotRefStarColorTermResiduals(self, fgcmPars):

ax.hexbin(gmiGRS[refUse], delta, bins='log', extent=[xlow, xhigh, ylow, yhigh])

binstruct = dataBinner(gmiGRS[refUse], delta, 0.1, [xlow, xhigh], nTrial=10)
ok, = np.where(binstruct['N'] > 0)
ax.plot(binstruct['X'][ok], binstruct['Y'][ok], 'r--')
# Only do the binning if we have data
if xhigh > xlow and refUse.size > 10:
binstruct = dataBinner(gmiGRS[refUse], delta, 0.1, [xlow, xhigh], nTrial=10)
ok, = np.where(binstruct['N'] > 0)
ax.plot(binstruct['X'][ok], binstruct['Y'][ok], 'r--')

Choose a reason for hiding this comment

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

Do you not need to do this check for the hexbin plot above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh dear, not there but above if there are nothing at all, you're right.


if mode == 'all':
title = '%s band: Ref stars, full color range' % (band)
Expand Down