Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Exposure time calculator app


dan_adi

Recommended Posts

Hello guys,

Given the multitude of clouds in my area the last couple of months, I've had plenty of time to work on an exposure time calculator GUI. Usually I have no idea how much total exposure time I should use for a target, so it became quite useful to have a guiding tool.

The app calculates the total exposure time for a point source (star) or extended object (nebula, galaxy) given a desired SNR (Signal to Noise Ratio).

The magnitude is corrected for airmass given the angle from Zenith. You can calculate the exposure time using different filters, commonly used in amateur astro-imaging. This was a challenge because I couldn't find the Flux densities for Oxygen, Hydrogen, Luminance filters etc. After quite a long time of research I found the synthetic photometry library for Python language from the Space Telescope Science Institute (the guys that run HST and Webb). As a bonus they have included the standard UBVRI filters as default, so I didn't need to simulate those. For the rest of the filters, things were easy once I followed their user manual. 

For those of you who know Python here is the link: https://synphot.readthedocs.io/en/latest/

In the following days I will compile the app for IOS, Windows and Linux, and share it with the community as a free tool. Besides the team at the STSI that made such a wonderful synthetic photometry library,  and the team at ESO that publish the SNR equations and more, I would like to thank user Vlaiv for his advice.

Bellow are some screen shots of the app running on a macbook air, with my scope and camera parameters ( CCD KAF16200, CFF 8 inch refractor)

Clear skies!

 

Screen Shot 2022-02-04 at 1.24.50 PM.png

Screen Shot 2022-02-04 at 1.26.01 PM.png

Screen Shot 2022-02-04 at 1.26.47 PM.png

Screen Shot 2022-02-04 at 1.27.22 PM.png

Screen Shot 2022-02-04 at 1.28.05 PM.png

Screen Shot 2022-02-04 at 1.29.57 PM.png

  • Like 8
  • Thanks 1
Link to comment
Share on other sites

On 04/02/2022 at 15:45, Annehouw said:

What a cool project!!

😀

 

 

Thanks, it was a great way to learn more about astronomy/astrophysics. I was expecting a little bit more feedback but it seems folks don't need to compute exposure times 😁 

Link to comment
Share on other sites

24 minutes ago, dan_adi said:

Thanks, it was a great way to learn more about astronomy/astrophysics. I was expecting a little bit more feedback but it seems folks don't need to compute exposure times 😁 

Well ... I am interested ... especially if you get the time to do a version for my Win10 PC and my Moravian G2 camera 🙂

Mike

Link to comment
Share on other sites

That looks a great little too.  Is there any way for the user to add their own sensor data to it?  It's quite often I've stood out the back with one of my cameras (all SLR, so may be tricky to find the sensor data) and pondered how long something is going to take.

Link to comment
Share on other sites

7 hours ago, dan_adi said:

Thanks, it was a great way to learn more about astronomy/astrophysics. I was expecting a little bit more feedback but it seems folks don't need to compute exposure times 😁 

Definitely interested too. With all the cloud of late, about the only thing to do is daydream about how much time to spend on the next project!

Link to comment
Share on other sites

13 hours ago, SlimPaling said:

Well ... I am interested ... especially if you get the time to do a version for my Win10 PC and my Moravian G2 camera 🙂

Mike

Ok, I will add the Moravian G2 8300. Yesterday I've compiled a standalone version for Mac OS. The only issue I found was with Dark Theme enabled on IOS, the text on the buttons and the buttons are white, so the user can't read the text. With the Light theme, the problem doesn't show up, so it must be a bug with the standard python TKinter library and Dark Theme in IOS. It won't be such a big problem since the user can switch to the Light Theme momentarily.

The only windows machine I have is the small PC that runs the observatory, and I have to install all the tools to compile it on Win, it will take some time, but it's doable. 

Edited by dan_adi
Link to comment
Share on other sites

10 hours ago, BCN_Sean said:

That looks a great little too.  Is there any way for the user to add their own sensor data to it?  It's quite often I've stood out the back with one of my cameras (all SLR, so may be tricky to find the sensor data) and pondered how long something is going to take.

Sure, you can click on the numbers and change them as you like. I will browse telescope-express or FLO and see what other cameras I can add.

PS: I see you mentioned dSLR cameras ... I included CCD and CMOS mono cameras, I'll have to find some DSLR sensor specs and see if it works, or if the results make sense. Given that they already capture color data, the color filters won't make sense, but for luminance and narrow band maybe ... 

Edited by dan_adi
  • Like 1
Link to comment
Share on other sites

7 hours ago, dan_adi said:

I included CCD and CMOS mono cameras, I'll have to find some DSLR sensor specs and see if it works, or if the results make sense. Given that they already capture color data, the color filters won't make sense, but for luminance and narrow band maybe

Don't go too hard at it, if it's just me showing interest on SLR/OSC type sensors. I think from looking at the cameras I've on the desk at the moment it may be a bit frustrating to work out anything but luminance, as a couple of my cameras share the same sensor the manufacturer differences with the integrated filter show different results with things like wavelength response and colour response.

Link to comment
Share on other sites

I've added a couple more cameras, and I've compiled it for MacOS. If you are a mac user, please select Light theme from system preferences. Don't know why, but with a Dark theme, there is a weird banding ... Browsing the forums for this error, I think there is a bug with the Tkinter library in python, so not much I can do to remedy it.

Anyway, if someone uses a Mac, please test the app. Unzip, then run it.

Screen Shot 2022-02-06 at 6.01.06 PM.png

ETC.zip

Link to comment
Share on other sites

1 hour ago, dan_adi said:

Anyway, if someone uses a Mac, please test the app. Unzip, then run it.

Not working on 10.15.7 with Python 3.9 installed; it's throwing up an error that it can't find the runtime locations.

1739483426_Screenshot2022-02-06at19_09_27.png.8e60d1be66937920f322860531472616.png

Link to comment
Share on other sites

1 hour ago, BCN_Sean said:

Not working on 10.15.7 with Python 3.9 installed; it's throwing up an error that it can't find the runtime locations.

1739483426_Screenshot2022-02-06at19_09_27.png.8e60d1be66937920f322860531472616.png

Thanks for trying, I will search for a fix. If you have python installed, and I presume you know how to use it , I will link the source code.

The main program is ETC.py

The files device.py and utility.py are modules imported in ETC.py.

CCD.csv contains QE data for the sensors.

All the files need to be placed in the same folder. In utility.py at line 98 and line 247, you will need to modify the file path to the CCD.csv file, in order to point to your desired file location. Example: '/Users/yourusername/Documents/ETC_folder/CCD.csv'

For compiling you will need the synphot library and astropy library:

https://synphot.readthedocs.io/en/latest/

https://www.astropy.org/

CCD.csv device.py ETC.py utility.py

Link to comment
Share on other sites

1 hour ago, dan_adi said:

Thanks for trying, I will search for a fix. If you have python installed, and I presume you know how to use it

I wouldn't say I'm proficient at it, just have it about for working with the occasional script and whatever that pops up; and after looking up a couple of other dependencies I didn't have here's the result.  What did interest me, though, was tkinter not accepting the fg setting, 

Not got time to look in to it further tonight, but have had a couple of runs with it, and nothing noticeable error wise popped out (aside from a memory page error generated by Python, but that isn't an error at the moment as the rig is rendering a heavy video at the same time).

So far it looks good, and when I'm caffeinated tomorrow, and got a couple of hours to dedicate to it, I'll have a deeper look in to it and I'll have a look on the other machine (running MacOS12) as well.

10658673_Screenshot2022-02-06at22_34_05.thumb.png.595a8bf9243c3665181973ee25796352.png

Link to comment
Share on other sites

8 hours ago, BCN_Sean said:

I wouldn't say I'm proficient at it, just have it about for working with the occasional script and whatever that pops up; and after looking up a couple of other dependencies I didn't have here's the result.  What did interest me, though, was tkinter not accepting the fg setting, 

Not got time to look in to it further tonight, but have had a couple of runs with it, and nothing noticeable error wise popped out (aside from a memory page error generated by Python, but that isn't an error at the moment as the rig is rendering a heavy video at the same time).

So far it looks good, and when I'm caffeinated tomorrow, and got a couple of hours to dedicate to it, I'll have a deeper look in to it and I'll have a look on the other machine (running MacOS12) as well.

10658673_Screenshot2022-02-06at22_34_05.thumb.png.595a8bf9243c3665181973ee25796352.png

Nice to see that it is working. Good job! 

For your simulation, with such a bright star, you ca go to a SNR of 100 or above,  otherwise an exposure time of 0.013 seconds will be too low for practical reasons.  The dark banding around the lower buttons only appears with macOS Dark theme enabled, must be a bug in Tkinter... 

Edited by dan_adi
Link to comment
Share on other sites

These were just numbers I was popping in, when I've found the sensor data for the D810 I'm going have a deeper look in to it to work backwards from the data I've already collected; this just clicking around to see if things were working or not.

4 hours ago, dan_adi said:

must be a bug in Tkinter

I think so too, was trying last night to add different (documented) flags in to the configuration and it was throwing errors about certain flags weren't found (fg/foreground being two).

Later on I'll put it on the other machine and have a look as that's currently not got Python outside the OS installed version, and pull it all together outside of homebrew as I've a bit of a suspicion that homebrew is installing some different versions of libraries.

Link to comment
Share on other sites

@dan_adi, I've had a look under Monterey as well, and it's working the same as on the other one.

Also (don't kill me for this!) I've had a bit of a noodle around in the code by adding a function to detect whether MacOS is running dark or light, and set the colours accordingly.

Here's on Monterey (Dark)

78686380_Screenshot2022-02-07at15_11_23.thumb.png.8805c4b24cc9550e226ca5220445c0e6.png

Again but on Light

2144605934_Screenshot2022-02-07at15_11_50.thumb.png.de86a42318c5a1fc2e088401231def04.png

Here's the ETC.py with the changes in

 

And here is a quick and dirty text file generated with diff to show the line numbers where I've made the changes.  

ETC_Changes.txt

ETC.py

Edited by BCN_Sean
Being a numpty and uploading the wrong thing!
  • Like 1
Link to comment
Share on other sites

6 hours ago, BCN_Sean said:

@dan_adi, I've had a look under Monterey as well, and it's working the same as on the other one.

Also (don't kill me for this!) I've had a bit of a noodle around in the code by adding a function to detect whether MacOS is running dark or light, and set the colours accordingly.

 

On the contrary, thanks a lot ! . I am not a professional programmer so any help is greatly appreciated. Like you I use python at work from time to time. This evening I took a look at the app on windows and ubuntu. I have to change the look a little bit in every OS, so it will take some time to finish everything. Also I was thinking of adding the 'reverse' option, meaning the user can input the exposure time per sub, the number of subs to stack, and the app will compute the resulting SNR stack.  

PS: on a Mac button instead of bg=colorBackground I should have used highlightbackground=colorBackground. Now the universe makes sense again! 😀

Edited by dan_adi
  • Like 1
Link to comment
Share on other sites

@BCN_Sean, found two bugs. 

1st in device.py, line 12, Central obstruction should be converted from mm to meters.

2nd in ETC.py, functions ExposureTimePoint and ExposureTimeExtended, pixel surface should equal imageScale **2, because I've already included binning in image scale computation, so delete * binning **2

I didn't catch the bugs early because I've tested with CO=0 and binning=1  😁

Edited by dan_adi
Link to comment
Share on other sites

On 08/02/2022 at 19:26, dan_adi said:

@BCN_Sean, found two bugs. 

1st in device.py, line 12, Central obstruction should be converted from mm to meters.

2nd in ETC.py, functions ExposureTimePoint and ExposureTimeExtended, pixel surface should equal imageScale **2, because I've already included binning in image scale computation, so delete * binning **2

I didn't catch the bugs early because I've tested with CO=0 and binning=1  😁

Not got that far in to it at the moment; though not had much chance this week what with trying to integrate a new camera to the portable rig and the central heating boiler packing up.

There was something that I was looking at the other day regarding the end times, from using the data I'd collected and working backwards it seemed that (though this just could be me) the exposure times were sitting two decimal places to the right compared to where I was expecting them.  It's not a problem yet, as it could have easily been me, as I've not had time to sit down and dedicate a few hours to go back in to it without interruption.

Link to comment
Share on other sites

  • 5 months later...

Hello guys,

It was pretty hard for me to make an individual app for Windows/MAC/Linux, so I rewrote the whole thing as a web application, that I will put on a little Intel Nuc webserver I have at home.

This way anyone will be able to access it regardless of operating system. The best part is that it was easier to make the web app than the standalone application.

Once I have everything in order I will publish the web site address.

Below are some print screens.

Screen Shot 2022-07-16 at 4.20.33 PM.png

Screen Shot 2022-07-16 at 4.22.03 PM.png

Screen Shot 2022-07-16 at 4.22.50 PM.png

Screen Shot 2022-07-16 at 4.23.29 PM.png

 

Screen Shot 2022-07-16 at 4.24.57 PM.png

Screen Shot 2022-07-16 at 5.02.17 PM.png

Edited by dan_adi
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Hei, this looks interesting. 

Stupid question here, but when you say desired SNR? I think I understand this but I better ask for clarification. 

What is my desired SNR under 21.78Mag sky ? (Pick a random target) I see that 20 has been put there as a preset but isn't that dependant on the target and sky brightness ? And how does on get to that number? 

 

Kind regards

Roger 

Link to comment
Share on other sites

11 minutes ago, Taraobservatory said:

Hei, this looks interesting. 

Stupid question here, but when you say desired SNR? I think I understand this but I better ask for clarification. 

What is my desired SNR under 21.78Mag sky ? (Pick a random target) I see that 20 has been put there as a preset but isn't that dependant on the target and sky brightness ? And how does on get to that number? 

 

Kind regards

Roger 

Hello, in order to reasonably detect some object you will need a SNR of at least 10. The higher the SNR you want, the higher the exposure time you will need.

The target mag and sky mag will also influence the exposure time. If you have 21.78 mag skies that is really nice. I have 20.4 measured with a sky quality meter.

You choose whatever SNR you want. The higher the SNR the better the detection will be but this also translates into more imaging time.

The project came to be, because I want to detect the gravitational arcs in Abell 2218 with an 8 inch scope and I didn't know how much time I will need on this target. The faintest arc, arc 362 located at 10 billion light years has a mag of 24.5. For a SNR of 20 I will need around 80 hours for Luminance filter with my setup. If I aim for a higher SNR it becomes unpractical... because I have a small aperture scope.

The good news is that I am at 40 ish hours down the road, and if I do an agresive stretch on the image I am beginning to see the faint arc. 

I will probably finish next summer, but at least I know it's doable.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.