Essential Spectroscopy data acquisition features

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
Post Reply
MattTexas23
Posts: 12
Joined: Sun Sep 03, 2023 6:11 am

Essential Spectroscopy data acquisition features

#1

Post by MattTexas23 »

Dear Robin, Community,

For slitless (grating style) spectroscopy, we often make a picture of the star and its diffraction pattern (rainbow) right next to it (in the same fov).Sharpcap is fantastic for making sure we get the right subs, it would be even more fantastic if there was just one little bit of help with the following;

The overall goal is have the smoothest, best experiment that evening with the requirements of spectroscopy. Once the perfect data is collected, the analysis (elements, reference stars, physics) can be done with any other dedicated spectro package (RSpec, IRIS, BASS Pro, Vspec etc).

Essential: Exposure
A key problem with making pictures of diffraction patterns is setting the right exposure (saturation vs signal to noise) on the diffraction pattern of interest. Especially if you use OSC camera; the combined channels may not reveal saturation in just the blue/green channel. You may be interested in one diffraction pattern only (you will allow others to over expose). Right now I use the Pixel Value read out tool on parts of the rainbow, I look that the channels (if RGB, luminance if mono) does not exceed 65535. Its easy to miss the area where the exposure is saturated, I will only find out in analysis the day after...
Request: for the selected diffraction pattern, plot the pixel value v.s. pixel number of each channel. Could for example take the max from the column sum of pixels along the diffraction pattern (if pattern is in row direction).

Essential: Focus:
We need to focus on the diffraction pattern rather than the star itself. The best focus is when we get the highest signal and the deepest features. Adjusting focus takes place in the data acquisition stage (while we use Sharpcap). Right now each sub should be loaded into an analysis program like BASS Spectro or Rspec. Rspec has a bridge folder for this, most other analysis software have not.
Request:
So it would be great to be able to plot the uncalibrated spectrum (luminance vs pixels) and compare against previous subs as we adjust focus.

Essential: Select region of interest under angle
In order to do the above, it would help greatly to have a way to select the star with diffraction pattern as a region of interest. The grating will have a fixed orientation vs the CMOS, so the direction of the diffraction pattern vs the star remains the same - if its a guided EQ mount. Typically the diffraction pattern is not exactly horizonal (aligned with rows of the CMOS). Using the existing ROI selector could easily catch diffraction patterns from nearby stars, very likely if the the diffraction pattern is under an angle.
Request
Able to define the region of interest under an angle. E.g. user is asked to draw a line over the diffraction pattern (may or may not include the zero order star), define a height/width of the box (now under an angle). OR user is asked to draw a line over the diffraction pattern: this determines the rotation. The image rotates so that the diffraction pattern looks horizontal. Then the user can use the existing ROI box to define ROI.

Optional: Live stacking for spectra
Especially for fainter objects, this could be game changer. Allow us to do a live stack to improve (and see!) the improved signal to noise. Since you only have 1 star and the diffraction pattern is likely limited to x/y (shift or Euclidean) registration only (https://siril.readthedocs.io/en/latest/ ... ation.html). The star may not be perfectly round or in focus because the focus is set to the diffraction pattern. Today I crank up my sensitivity and do a live stack - in some sky regions I cannot get enough stars to pass registration in sharpcap.
Request: offer one-star shift stacking for spectro. Stretch : show progression of background noise v.s. signal (spectrum) over time (per sub) so you see the signal improving. This can also be done by just plotting the spectrum, subtract the background: same plot as the focus tool.

Linear Wavelength calibration
For a given setup, it is known after the first experiment how the x-axis (pixels) should be scaled to nanometer or Angstrom. For all next subs you should then determine the zero order (star) as origin, and use a constant factor to scale the X-axis (e.g. I know mine is 2.2 Angstrom/pixel). If you allow these two parameters to be set, all the previews of the spectra can be scaled appropriately - its good to validate that you get the spectral patterns you expect (e.g. H beta Balmer lines). Scaling the Y-axis is a lot more involved and is imo best suited in the analysis phase next day.
Request: Allow a scaling of the x-axis based on 2 points (either zero and rate or two known points on x-axis: e.g. a H-beta frequency)

very much welcome your thoughts & suggestions of others. Also, if there are work arounds to above already in Sharpcap - please let me know!

much appreciated,

Matt
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Essential Spectroscopy data acquisition features

#2

Post by admin »

Hi Matt,

thanks for taking the time to explain so well what the needs of spectroscopy are. Right now I have a long backlog of general astronomy features that I would like to add to SharpCap, so the ability to make changes of this sort is extremely limited - I can probably squeeze in small changes to existing features that would help but not add large new features.

Looking through the list, for exposure and focus, I am puzzled as to how these would be fundamentally different from using existing tools (histogram, contrast based focus tool) with a selection area applied that covers the spectrum on screen - at least if you could select only the spectrum area nicely.

Live stacking on a single bright star wouldn't be too hard a feature to add - it's not too different from the current option of comet stacking. If the star is stable in position then you could just run live stacking with alignment off.

Measurement sounds like a good extension for the current 'multi reticule' tool, which allows line and circle reticules to be positioned and saved. If I were to make the line reticule display its length then that would be a starting point as you could position the line as required and read off the length. You still have to do the factor of 2.2 manually, but I expect you would get to know the 'pixel' distances fairly soon.

Arbitrary rotation is a tricky one - 90 degree rotations move pixels around, but preserve pixel values (preserved in a different place in the image, but the same brightness). Arbitrary rotations blend pixel values with each other (area weighted averaging) or end up throwing away data (nearest neighbour). It would have to be done after debayer for colour cameras (but presumably you are mono anyway). It feels like a bad thing to do in the copy of the image that gets saved, but doing it only to the version that appears on-screen would mean that all of SharpCap's tools like histogram would be working on the un-rotated version anyway (this is because of the way the image data flows through SharpCap). I'm not sure that there is a good solution to that problem without needing to make the sort of large scale changes to how SharpCap works that just aren't going to happen.

cheers,

Robin
MattTexas23
Posts: 12
Joined: Sun Sep 03, 2023 6:11 am

Re: Essential Spectroscopy data acquisition features

#3

Post by MattTexas23 »

Thank you Robin, those are great thoughts.

Yes - it looks like we can hit most items with a very minor change/option added in Sharpcap. Basically;
1) the ability to select a region of interest (ROI); along a line... with a width x depth : "a rectangle on an angle". You could even define this as two points picked by user and one thickness parameter (like you define a slot).
2) apply existing tools; histogram, contrast focus only to the ROI

If the ROI needs to be stored as a square image internally, it would be absolutely fine to store the areas beyond the ROI a zero value pixels (black). That would essentially mask spectra from other stars nearby. For stacking - if that could be on just the ROI, I think you already have the machinery for that in Sharpcap.

welcome your, and others, thoughts

Matt

In attached a picture as an example - and below are some links to the bigger subs I typically make.
example of one sub:
https://drive.google.com/file/d/1Tvq5dG ... sp=sharing
Example stacked:
https://drive.google.com/file/d/1aQUNib ... sp=sharing
Attachments
examplesml.png
examplesml.png (337.4 KiB) Viewed 628 times
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Essential Spectroscopy data acquisition features

#4

Post by admin »

Hi Matt,

thanks for sharing the image and FITS file - very useful.

You should certainly be able to use the focusing tools as-is, since you can draw a selection box around the spectrum and then use the 'black threshold' adjustment to exclude the dark areas inside the selection box from the calculation - as shown below...
Screenshot 2024-01-26 145909.jpg
Screenshot 2024-01-26 145909.jpg (66.59 KiB) Viewed 556 times
The histogram is trickier - I had a look and even with a fairly tight cropping of the selection box, the histogram is dominated by the black areas and the overexposed red/green pixels
Screenshot 2024-01-26 150437.jpg
Screenshot 2024-01-26 150437.jpg (104.35 KiB) Viewed 556 times
Even if we imagine those gone, the rest of the histogram seems to be mostly noise - I don't think there are many pixels at any individual brightness level through most of the range, so you don't see much structure. Not sure how that data would help out...

I will make the line reticule (part of the multi reticule tool) draw the length of the line, which is a start towards measuring things and make a note to look into one star stacking when I have a chance.

cheers,

Robin
Post Reply