Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Calculating sky glow/fog/whatever from FITS

  • Please log in to reply
15 replies to this topic

#1 fewayne

fewayne

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,539
  • Joined: 10 Sep 2017
  • Loc: Madison, WI, USA

Posted 25 November 2019 - 10:29 AM

I know this question has been answered before but I'm blamed if I can find it.

 

So, pursuant to the thread about cooling and exposure kicked off by viewing Dr. Glover's talk again...I posted some values for target sensor temperature based on the e/pixel/second rates given in the talk, and on tools.sharpcap.com's online light-pollution calculator. One of the commenters pointed out, quite reasonably I thought, that one could just ruddy well look at the dark background of a sub-exposure and get the actual, observed rate instead of trying to guess it from averages.

 

Except...I don't remember how to do that. I can open one of my 60-second 7-nm Ha subs in, say, KStar's FITS viewer, and wave the cursor around in the dark bits. OK, so it's around 600 or so. Now what? I'm running an ASI183MM-Pro, gain 110, bias 8, it has a 12-bit ADC.

 

I will be unsurprised if PixInsight can just do this calculation, but I'm an Astro Pixel Processor guy. Well, Siril too, if need be.

 

I solemnly promise to bookmark the answer this time.


Edited by fewayne, 25 November 2019 - 10:32 AM.


#2 jdupton

jdupton

    Soyuz

  • *****
  • Posts: 3,820
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 25 November 2019 - 11:13 AM

fewayne,

 

   If you are only looking for background rates in e-/pixel/sec for a particular sensor, filter, and telescope, it is pretty straightforward.

  1. Open a typical image for the session / night of interest.
  2. Open a raw (uncalibrated) Dark frame from the same session.
  3. Measure the median value of a section of the target image and record the value. pick an area of the image near-ish the center that contains only background -- not target or bright stars.
  4. Measure the median value of the same general section of the dark frame and record the value.
  5. Subtract the median of the dark from the median of the light. This gives you the calibrated sky background median ADU for the night in question.
  6. Multiply that difference in medians by the gain of the camera in e-/ADU. That gives you the number of electrons captured.
  7. Divide the electrons captured result by the length of the exposure in seconds. The result is the e-/px/sec rate of background accumulation.

   You can also simply calibrate one of your images and measure an area of background near the center, then use the gain and exposure for find the sky rate in e-/px/sec. The danger here is that if you calibrate with a flat frame also, your results may be skewed depending on the exact operation the software performs to correct for vignetting. Either calibrate with dark only or do it manually for closest results.

 

   If you looking for for a value that you can convert to an actual sky brightness at your location, it gets more complicated. You need to account for the exact amount of light lost in the telescope due to absorption in glass elements (including camera windows and such), reflectivity of each mirror in the telescope, the size of any central obstruction in the telescope, the transmission of any filters being used, the Mean QE (not Peak QE) of the sensor in your camera over the bandwidth of any filters, and a couple of other factors. It is easiest to just to stick with the electron accumulation rate and compare that directly the your dark current rate for the system under consideration.

 

 

John


  • Xilman likes this

#3 fewayne

fewayne

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,539
  • Joined: 10 Sep 2017
  • Loc: Madison, WI, USA

Posted 25 November 2019 - 11:46 AM

Thanks! My aim is fairly modest -- I'm merely seeking to generally characterize my light pollution levels for the various sites from which I image. I can look at the maps, of course, but the most quantitative values I can obtain are for upwelling radiance. Certainly that's related to the LP my telescope sees, but the relation is pretty complicated. Better to use the maps for "dark over here", but use measurements when it's time to pick cooling temps, sub lengths, gain, etc.



#4 fewayne

fewayne

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,539
  • Joined: 10 Sep 2017
  • Loc: Madison, WI, USA

Posted 25 November 2019 - 12:25 PM

More questions: I need to account for gain, right? 110 is 11 dB of gain according to ZWO's chart, but I seem to recall that that's right about unity gain for a 183. So color me confused again. And what about bias -- should that be subtracted from uncalibrated images? (It was set at 8.)

 

And this is a 12-bit ADC. Do I then multiply by 4096?

Yep, still pretty befuddled. If I just do the calculation above and use 3.1 as the gain factor (10 dB), I get something like 3 e-/sec/pixel for Bortle 7-ish skies, which seems kinda low, unless I'm misunderestimating the light pollution in my darker site. Then again it's less than an order of magnitude off, which is pretty good for astronomy!



#5 Der_Pit

Der_Pit

    Vanguard

  • *****
  • Posts: 2,345
  • Joined: 07 Jul 2018
  • Loc: La Palma

Posted 25 November 2019 - 12:25 PM

You have to compare that number you have for the BG counts with some 'known' intensity.  I.e., you next have to measure a star with known brightness. 

 

Best done with a (dark corrected) green channel image, but the main important thing is to use the proper star brightness which differs with wavelength/color/band.

You normalize the BG to 1 arcsec (i.e., if your pixels are 1.6" you divide by 1.6 squared) -> I_b.  For the star you sum up all pixels of the star (it's a point source after all) -> I_s.  The difference in magnitudes then is 2.5*alog10(I_s/I_b).  Add this difference to the star brightness and you have your sky background intensity.

 

Did so with one of my images, using star HD339451, m_v=13.63.  Average intensity of a BG patch next to the star was 52.3, my pixels are 1.648 arc sec -> 52.3/2.722 = 19.214 counts per square arcsec.

The total of the counts of all pixes of the star was 37104.4, so delta = 8.215 and the sky background is 21.84 mag per square arcsec.



#6 fewayne

fewayne

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,539
  • Joined: 10 Sep 2017
  • Loc: Madison, WI, USA

Posted 25 November 2019 - 01:35 PM

While a calibrated value would be nice to know, I don't think I need to go that far for my application -- I'm merely interested in the rate at which electrons are observed to be generated by the sensor. I know by ZWO's spec sheets the rate at which they are generated by dark current (and can in fact observe that too) at various temperatures.

 

My goal is to set the cooling on the camera so that the dark current is somewhere between 5-15% of the electrons generated by light pollution (including natural phenomena like airglow, of course, in "pollution").

 

In the end I'll have to experiment, of course. But if I can establish some starting points quantitatively, that might save me from spending valuable dark time on messing about.

OK, to be fair: MORE messing about. Anyone who's ever seen (or, more to the point, heard) me in the field knows that, in the words of the great Gilda Radner, "It's always somethin'". (And in those of Malcolm Reynolds: "How come it never goes smooth?")


Edited by fewayne, 25 November 2019 - 01:37 PM.


#7 bobzeq25

bobzeq25

    ISS

  • *****
  • Posts: 26,191
  • Joined: 27 Oct 2014

Posted 25 November 2019 - 08:02 PM

Here's what I do.

 

I use the ImageStatistics tool in Pixinsight, and go with the average value (either one).  Take the value for a light, subtract the value for a bias.  That's in ADU (you need to be sure the bit depth on the tool matches your camera).  You then use your gain to convert ADU to electrons.


You can do something similar using the histogram feature in the free program, IRIS.  Then you use the obvious skyfog peak.  You still need to bias correct it.

 

Now you have a number you can compare to your read noise squared.  You're aiming at an exposure that gives you a value between 5 and 10 times the read noise squared.

 

More details upon request, but it would be useful for you to try the specific program yourself first.

 

All this is better explained in this superb book.

 

https://www.amazon.c.../dp/1138055360/


Edited by bobzeq25, 25 November 2019 - 08:07 PM.


#8 jdupton

jdupton

    Soyuz

  • *****
  • Posts: 3,820
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 25 November 2019 - 08:45 PM

fewayne,

 

More questions: I need to account for gain, right? 110 is 11 dB of gain according to ZWO's chart, but I seem to recall that that's right about unity gain for a 183. So color me confused again. And what about bias -- should that be subtracted from uncalibrated images? (It was set at 8.)

 

And this is a 12-bit ADC. Do I then multiply by 4096?

Yep, still pretty befuddled. If I just do the calculation above and use 3.1 as the gain factor (10 dB), I get something like 3 e-/sec/pixel for Bortle 7-ish skies, which seems kinda low, unless I'm misunderestimating the light pollution in my darker site. Then again it's less than an order of magnitude off, which is pretty good for astronomy!

 

   I've been away from the computer all day. Sorry for not following up earlier.

 

   Yes, you need to account for the gain. But you must have the sensor gain in units of e-/ADU rather than the abstract "gain number" setting from ASI. Use e-/ADU rather than db or other measure for this, otherwise the calculation will give you a misleading or wrong answer. You say you are using an ASI gain number of 111. if you look at the charts on the ZWO page for the ASI183MM-Pro, you will see that the sensor gain at a Gain number of 111 is equal to 1.06 e-/ADU. This gain is in native sensor ADU units -- 12 bits in this case. You will need to multiply this by 16 to get to a 16 bit gain number. (This assumes you are examining saved 16 bit FITs files.)

 

Image1.png

https://astronomy-imaging-camera.com/product/asi183mm-pro-mono

 

   Now refer back to my procedure shown in Post #2.  Use this number (16 x 1.06 = 16.96) (1.06 / 16 = 0.06625) [corrected value] for the gain in step #6. The result of step 6 is the number of electrons in the background of your light frame exposure. Divide by the exposure time seconds as indicated in step 7 and you are done. This is the e-/sec rate of sky flux that you will want to be 10x to 20x times your dark current (which you could also manually measure rather than taking some printed value). 

 

   Regarding calibration, this method requires you to use uncalibrated frames. Do not subtract Bias from either. The light frame has a Bias signal in it and the raw dark frame also has Bias in it. Once you subtract these the Bias goes away automatically. It is best to just use raw frames directly as saved by the camera. One dark frame (of the same duration as the light) and one light frame will give you a reasonable answer for sky flux in e-/sec. That will be directly comparable to the dark current you are asking about swamping.

 

   Since you are using the Monochrome version of the camera, don't do any deBayering (?) or other operations. It is best to use an L frame rather than some filtered frame. Just measure the result of subtracting a dark (background) from a Light (background) and then multiplying my the electric gain (e-/ADU) to get the accumulated electrons. You can then compare that to the number of dark current electrons gathered in a dark frame of the same exposure.

 

   I hope this is clearer than my first answer this morning.

 

 

@Bob,

 

   The OP was looking to swamp Dark Current not swamp read noise. Since your method of subtracting only Bias from the light leaves the dark current in the result, he is no closer to determining the amount of background he needs to swamp dark current that he wants. The purpose of swamping Dark Current is to determine just how much cooling is really required under light polluted skies.

 

 

John


Edited by jdupton, 26 November 2019 - 04:44 PM.


#9 fewayne

fewayne

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,539
  • Joined: 10 Sep 2017
  • Loc: Madison, WI, USA

Posted 25 November 2019 - 10:55 PM

Thanks guys. This is exactly what I need. I must have skipped over the GAIN (e-/ADU) graph because the X-axis didn't have units -- but of course they're the same all the way down. So actually 120, not 110, is 1 e- per ADU.

 

Bob, I guess I gotta get that book. What the heck, my birthday is tomorrow and it's been a couple years since I bought Bracken :-).

 

Onward! (And I've already bookmarked this thread, so hopefully this will be the last time I ask.)



#10 mohitk

mohitk

    Vostok 1

  • -----
  • Posts: 111
  • Joined: 25 Jun 2017
  • Loc: A valley in Southern California

Posted 25 November 2019 - 11:27 PM

if you look at the charts on the ZWO page for the ASI183MM-Pro, you will see that the sensor gain at a Gain number of 111 is equal to 1.06 e-/ADU.

 

John - can I ask a really stupid question ? I would love to know how to get that level of accuracy from that graph - can you please explain how you got 1.06 e-/ADU for a gain of 111 ? Thank you so much!!

 

--Mohit.


  • jdupton likes this

#11 jdupton

jdupton

    Soyuz

  • *****
  • Posts: 3,820
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 26 November 2019 - 09:07 AM

Mohit,

 

John - can I ask a really stupid question ? I would love to know how to get that level of accuracy from that graph - can you please explain how you got 1.06 e-/ADU for a gain of 111 ? Thank you so much!!

 

   That is not a stupid question at all. One answer is that I personally cannot read the graph to that level of precision.

 

   The real underlying answer is trust, and lots of it.  grin.gif   In the real world, the plot is almost certainly not that accurate in the first place unless you measure the property yourself for your particular sensor chip under controlled conditions. In this and similar cases all we can do is trust any plots the manufacturer or vendor give us. That is as good as a guess as we can get.

 

   To read these types of graphs without imparting my own "guessing" error into the values, I digitize them with a Web App called WebPlotDigitizer. It can give us excellent interpolation of any values from a plot. After digitization, we are still left trusting the vendor but at least we haven't added a lot of error on our part in reading the graph.

 

   I usually blindly trust the plots to a couple of significant digits and only at the end of any calculations drop the answer back to to a more reasonable precision. (I don't like multiplying multiple rounded numbers along the way. Even when I know there may be little precision in the starting number, I use what I can get from digitization and then round off the final results when multiple calculation are being done.)

 

 

John


  • mohitk likes this

#12 freestar8n

freestar8n

    Vendor - MetaGuide

  • *****
  • Vendors
  • Posts: 10,979
  • Joined: 12 Oct 2007
  • Loc: Melbourne, Australia

Posted 26 November 2019 - 04:25 PM

Now refer back to my procedure shown in Post #2.  Use this number (16 x 1.06 = 16.96) for the gain in step #6. The result of step 6 is the number of electrons in the background of your light frame exposure. Divide by the exposure time seconds as indicated in step 7 and you are done. This is the e-/sec rate of sky flux that you will want to be 10x to 20x times your dark current (which you could also manually measure rather than taking some printed value).


If the 12-bit gain is 1.06 e/adu and you measure the ADU of the sky background in the raw, 16-bit image - then the gain factor you should use is 1.06/16 = 0.06625.  The gain represents e/adu, so if you are using "smaller adu steps" by going from 12-bit to 16-bit, the gain value will go down.  This will make a big difference in the sky background result you get - by a factor of 256!

 

I never bother with a 12-bit gain value.  I measure the gain and read noise myself and just do it all with 16-bit adu values - so I know typical gain values will be much less than 1.0 for these cameras.

 

Frank



#13 jdupton

jdupton

    Soyuz

  • *****
  • Posts: 3,820
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 26 November 2019 - 04:45 PM

Frank,

 

   ACK!!!! Yes, you are correct. I really flubbed that one. Thanks for catching my error!

 

 

@ fewayne,

 

   In step #6 of the process shown above, use 1.06 / 16 = 0.06625 as the multiplier as Frank indicates. I edited the post above to show the correction. That way, the correct value in the procedure will be there when you reference it in the future.

 

 

John


  • freestar8n likes this

#14 George47

George47

    Lift Off

  • -----
  • Posts: 7
  • Joined: 22 Aug 2014

Posted 26 November 2019 - 05:54 PM

You could always use SharpCap and measure for your specific sky conditions and telescope. If you buy Sharpcap Pro then it has a lovely routine that takes you through the process one step at a time. Once done you get a calculated optimised exposure time with a graph that also gives optimised times for different gains. Easy and takes account if the moon is around.



#15 bobzeq25

bobzeq25

    ISS

  • *****
  • Posts: 26,191
  • Joined: 27 Oct 2014

Posted 26 November 2019 - 06:19 PM

John - can I ask a really stupid question ? I would love to know how to get that level of accuracy from that graph - can you please explain how you got 1.06 e-/ADU for a gain of 111 ? Thank you so much!!

 

--Mohit.

Here's by far the most important thing.  You don't need the value to that degree of accuracy.  1 will work fine for all practical purposes.


  • mohitk likes this

#16 damianvines

damianvines

    Sputnik

  • -----
  • Posts: 32
  • Joined: 20 Dec 2019
  • Loc: Sedro Woolley, WA

Posted 06 January 2021 - 02:26 PM

Here's by far the most important thing.  You don't need the value to that degree of accuracy.  1 will work fine for all practical purposes.

Thank you Bob for your advice on this matter. Does it matter if the image I'm using for my "light" image for purposes of subtracting out the dark ADU is narrowband? Or should this be done with broadband?




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics