Closed pllim closed 7 years ago
@pllim, could you try commit f472cb8b7ccedd080085d6ba3ff7b1ae001fa49a ?
This should at least fix the issue with the "set_enabled" error.
I think LineProfile
also is not currently playing well with MultiDim
. Loading a cube and exercising the NAXIS controls it is constantly clearing the selection of the axis, which forces a popup error of "Please select an axis".
Thanks for the quick fix; indeed the "set_enabled" error is gone.
The "self.tags[tag]" error appears when I choose NAXIS3 but "New Cut" is set.
Not exactly sure what caused the "QPushButton has been deleted" error. I was doing a bunch of stuff but I was paying attention to LineProfile
, not this plugin. If I see it again, I'll add more notes.
forces a popup error of "Please select an axis"
Yes, that is so annoying that I removed it in #455.
Yes, that is so annoying that I removed it in #455.
But I think the main issue is that the checkbox for the selected axis is getting cleared. LineProfile
needs to check whether the mddata
attribute of the new image is the same as for the old image, and only redo the selection checkboxes if this has actually changed. Instread, I think it is rebuilding it on every redo()
.
You are right. It is not very efficient. I am currently gutting it inside out to implement region selection anyway, I'll make a note to check the mddata
. Is a ==
sufficient or is there some special Ginga function to compare mddata
?
Actually, can you rebase on master I just pushed? It has the fix, and also fixes the annoying pop up message if the user has not selected an axis.
Thank you for polishing up this plugin, @pllim!
an you rebase on master I just pushed?
Hmm. I'll try. There might be conflict but I'll figure it out. Thanks!
I've done the following for the "Slit" feature in Cuts
:
Did you try using Slit on the nrc
image I passed along to you from NIRCam? It works for 4D cube but I don't know what I am looking at.
Back to the question at hand...
I see some similar controls between "slit" in Cuts and LineProfile. When do I use "slit" and when do I use LineProfile? Why aren't they in the same plugin?
That is a good question. @rupak0577 implemented both the "Slit" addition to Cuts
and also the LineProfile
plugin. I think @nabobalis was supervising this and I believe also @Cadair had some input. Maybe we could get a good explanation of the differences?
It works for 4D cube but I don't know what I am looking at.
I think we need one of these fine gentlemen to give us the 1000 meter view...
The orignal idea was that a slit would be a spatial cut that outputs a space/time image and the line profile would see how wavelength varies at a single pixel.
I think the orignal plan was to make slit able to cut arbitrary axes to produce any possible combination required by the user, but I can not remember if we got to that. So LineProfile was born to achieve the second aim.
make slit able to cut arbitrary axes to produce any possible combination required by the user
If I remember correctly, we did discuss on whether all the axes would be shown or not and the plugin does show all the axes of the image but I think only two of them can be selected?
@ejeschke @pllim Thank you both for fixing it!
@nabobalis @rupak0577
So when I have the following NAXIS in my 4D cube:
When I draw a line and select NAXIS3, what am I really seeing in "Slit" image? What about when I select NAXIS4? The axis label does not really tell me anything.
@ejeschke , the following case needs to be handled properly as well:
Error making callback 'activated': 'New Cut'
Traceback:
File ".../ginga/misc/Callback.py", line 123, in make_callback
res = method(*cb_args, **cb_kwdargs)
File ".../ginga/rv/plugins/Cuts.py", line 379, in <lambda>
lambda w, tf: self.axis_toggle_cb(w, tf, pos))
File ".../ginga/rv/plugins/Cuts.py", line 1052, in axis_toggle_cb
self._plot_slit()
File ".../ginga/rv/plugins/Cuts.py", line 654, in _plot_slit
obj = self.canvas.get_object_by_tag(self.cutstag)
File ".../ginga/canvas/CanvasMixin.py", line 93, in get_object_by_tag
obj = self.tags[tag]
One of the sessions also resulted in core dump when I quit Ginga but I can't reproduce it now.
@pllim, I believe this is fixed in commit 8b7a1d0696a6c7d8bcb6c8d28b8d1ef70a38b7c8.
Indeed it is fixed. Thanks for the quick response!
Can we close this issue then?
My question at https://github.com/ejeschke/ginga/issues/456#issuecomment-299247180 is still unanswered.
@pllim Sorry, I clearly missed that question.
With this setup: NAXIS1 = 2048 NAXIS2 = 2048 NAXIS3 = 10 NAXIS4 = 2
If we select NAXIS 3, we would end up with a NAXIS3-distance diagram. For the data I use it, NAXIS3 is wavelength, so I should end up with a 2D spectra (like an IRIS raster image) where one axis is distance along slit and the other wavelength. This would be at a fixed NAXIS4 position but I can not recall what one it uses. In my case, NAXIS4 is time, so we would end up with a time-distance diagram at a fixed NAXIS3 value.
Some people might want to vary the fixed third axis value, so you could see the spectra change through time for example. I am not sure if this answers your question though.
Some people might want to vary the fixed third axis value
Thanks! Do you do that through MultiDim
?
Yeah.
Okay, that's good to know. Thank you!
I see some similar controls between "slit" in
Cuts
andLineProfile
. When do I use "slit" and when do I useLineProfile
? Why aren't they in the same plugin?Also, starting
Cuts
with "slit" enabled, I see the following:Then, while using it, I see more: