Closed kadrlica closed 6 years ago
I was able to get this notebook to run all cells successfully after setting up the desc kernels as documented here: https://confluence.slac.stanford.edu/display/LSSTDESC/Using+Jupyter-dev+at+NERSC
In cell 3 when cutout_coadd_spherepoint
is defined, is the skymap=None
generalizable for datasetType
other than 'deepCoadd'. Specifically, I'm suspicious of the lines below, but not familiar enough with the skymap object returned by the butler.
if skymap is None:
skymap = butler.get("deepCoadd_skyMap")
I agree that it should be
skymap = butler.get("%s_skyMap" % datasetType)
This doesn't really matter given that we dohn't have any other types of coadds in Run 1.1p or planned for DC2, but I agree with the coding question that given that the surrounding function accepts a datasetType
why don't we use it here?
Ok, I'll commit that change in #205.
@wmwv here are a few more thoughts about the notebook from going through the first half. I'll try to add some of these to my PR.
imshow
and afwDisplay
:
I think that when backend='matplotlib'
, you can just use the mpl interface to save the png. So something like plt.gcf(); plt.savefig('afwDisplay.png')
seems to have worked for me. Can you confirm this @wmwv.
That being said, I've found the afwDisplay
interface to matplotlib to be clunky and it is hard to tweak things in the way I've become familiar with raw mpl.
What about using origin='lower'
in the call to imshow
so that the orientation is the same as afwDisplay
(I'll add to #205)? It's still worth mentioning what the pixel orientation is for afwDisplay.
The colorbar can be plotted with a call to plt.colorbar(plt.gca().images[0])
(I'll add to the #205). However, this is exactly the kind of jumping through hoops that afwDisplay makes you do...A few other very minor comments on the notebook.
computeImage(...)
. On my browser, this overflows the cell without wrapping (it also causes the text line above to overflow without wrapping).cutout_coadd_spherepoint
, but do we want to be explicit with an inline comment?Cell 16: agreed, but it's also cutting off your explanation that the doc is hard to understand :)
Ah, I didn't pick up on that. The line wraps correctly in my version.
Hmmm... it wraps correctly in Jupyter[Hub] but not in JupyterLab. I'll keep this as a small point to fix someday.
Its too bad that the notebook backend isn't yet available in JupyterLab because there is a real value in the interactivity offered.
Anyhow, when running directly in Jupyter, I wanted to re-run the
# Plot just one i = 5 first = id_ra_dec[i] ra, dec = first['RA'], first['DEC'] cutout = make_cutout_image(butler, ra, dec, filter=filter, label="Object ID: %d" % id_ra_dec[i]['ID'])
cell to see a different postage stamp, but the plot does not seem to be regenerated. Note that this only happens when using the notebook backend directly with Jupyter. It seems that the postage stamp is being plotting in another figure cell that was run previously. I think behavior could be fixed by adding a line to create a figure in the make_cutout_image
function. Maybe I should make a pull request.
Sorry to repeat myself, but at NCSA we support %matplotlib ipympl
which works with JupyterLab.
Thanks @RobertLuptonTheGood , I'll try that backend when lspdev is back up. I was running the DC2 tutorial notebooks at NERSC.
This is an issue to track feedback on DC2_Postage_Stamps.ipynb by @wmwv. Some feedback that was specifically requested: