Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Exposure time calculator app


dan_adi

Recommended Posts

35 minutes ago, Victor Boesen said:

Looks like a very interesting project!! Do you have a GitHub repository where I could have a look around?

Victor

Hello, I don't have a git hub repository. 

I wrote it in python, and used streamlit to make it an web app. Afterwards I used docker to contain the applications and it's dependencies into one place and deployed it.

Streamlit is nice and fast for making WebApps, but the code is re run after a user action, so it took me a couple of days to figure out how to retain the user input values into variables, otherwise every variable is reset and nothing is stored.

I had to use their session_state method to retain values. A little bit weird, but it works.

If you want I can see if I can push the app docker image to their repository, and then you can download the docker image on your PC, and run it locally.

Or I can send you the individual .py files so you can compile it on your own.

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

1 hour ago, dan_adi said:

Hello, I don't have a git hub repository. 

I wrote it in python, and used streamlit to make it an web app. Afterwards I used docker to contain the applications and it's dependencies into one place and deployed it.

Streamlit is nice and fast for making WebApps, but the code is re run after a user action, so it took me a couple of days to figure out how to retain the user input values into variables, otherwise every variable is reset and nothing is stored.

I had to use their session_state method to retain values. A little bit weird, but it works.

If you want I can see if I can push the app docker image to their repository, and then you can download the docker image on your PC, and run it locally.

Or I can send you the individual .py files so you can compile it on your own.

Alright, no worries ;) I was just curious about the program and wanted to have a look at the code and etc. I don't do imaging so I don't need to code so no need to send it :) The user interface looks very good and straight forward, what library did you use to make it?

Victor

Link to comment
Share on other sites

1 minute ago, Victor Boesen said:

Alright, no worries ;) I was just curious about the program and wanted to have a look at the code and etc. I don't do imaging so I don't need to code so no need to send it :) The user interface looks very good and straight forward, what library did you use to make it?

Victor

I've searched for some time for something easy, and I came across the Streamlit library for python. 

It was way easier than using tkinter.

For filter simulation I used the synphot library published by Space Telescope Institute. These are the guys that look after Hubble and JWST. 

Also the astropy library came in handy for automatic conversion of units. This reduces the chance of an error creeping in when working with flux density units, correcting for airmass-extinction etc.

The main equation is fairly simple, you can find different variations of it in the references tab. By far the hardest part was simulating the filters and fluxes, but we are grateful that the pros make their tools freely available.

Astropy is also very cool to work with. For example I made a small bit of code that reads my fits files header, extracts the focuser position and focuser temperature. Then I make a liniar fit between those 2 and get the temperature coefficient. This way I can average the results from a few nights, enter the coefficient in my focuser software and then I only need to focus 1 time during the night with temperature compensation enabled. Cool stuff 

  • Like 1
Link to comment
Share on other sites

3 hours ago, dan_adi said:

I've searched for some time for something easy, and I came across the Streamlit library for python. 

It was way easier than using tkinter.

For filter simulation I used the synphot library published by Space Telescope Institute. These are the guys that look after Hubble and JWST. 

Also the astropy library came in handy for automatic conversion of units. This reduces the chance of an error creeping in when working with flux density units, correcting for airmass-extinction etc.

The main equation is fairly simple, you can find different variations of it in the references tab. By far the hardest part was simulating the filters and fluxes, but we are grateful that the pros make their tools freely available.

Astropy is also very cool to work with. For example I made a small bit of code that reads my fits files header, extracts the focuser position and focuser temperature. Then I make a liniar fit between those 2 and get the temperature coefficient. This way I can average the results from a few nights, enter the coefficient in my focuser software and then I only need to focus 1 time during the night with temperature compensation enabled. Cool stuff 

Sounds excellent! I've made a few UI applications with dearpygui, which I've become quite fond of. Quite straight forward to work with. I have also used Astropy for a couple projects of mine and definitely think I'll be using it in the near future again once a relevant project comes to mind! I look forward to see more about the application on here ;)

Victor

Link to comment
Share on other sites

  • 3 weeks later...

In a few days I will update the app. Hopefully by the end of the week

What I've added:

1. Changed the user interface a bit.

2. Corrected calculation of Image quality FWHM.

3. Added a simulation of Image FWHM so a user can see how this parameter changes with different airmass, guiding during the night etc. Also the user can see each term contribution to final FWHM so one can get an ideea on how to improve the setup

4. Cosmology module. Based on user redshift input, different calculations are performed like proper distance, comoving distance, recession velocity etc.

The cosmology module also has a catalog search engine to Sinbad and NED in order to easily find redshift and other parameters.

The user can search multiple targets and get a table result.

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • 3 months later...

Hi,

I managed to update the web app. The address is the same: http://clearskies.go.ro:8501/

I added stuff I use in my regular 'astronomy' activity, besides the exposure time calculator, like:

  • the ability to search the Simbad database for stars, retrieve basic information and compute additional stuff. For example, making 3D interactive star maps, chosing a star of interest and computing its orbit in our galaxy, or simply computing distances between stars
  • the ability to search Simbad database for galaxies, based on coords or name. I mainly wrote this to retrieve information about major and minor galaxy axes, so I can compute the surface brightness really quick
  • the ability to compute cosmological parameters given a redshift and most fun, create a space-time diagram of the object of interest. This was a great way for me to wrap my head around cosmology. 

Overall I am pretty happy on how it all turned out. Doing the math and the programming gave me a better understanding of astronomy. A wonderful part of science!

PS: The default theme for the webapp is Dark Theme. I noticed that using the light theme might make some plots not display properly. To use the dark theme, go to the upper right corner, click on the 3 horizontal bars menu, go to settings->theme-> choose dark theme 

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

  • 1 month later...
On 26/01/2023 at 19:29, DSviewer said:

Looks great I don’t know python is there a user friendly in the plan

Thank you. I don't quite get what you mean? You don't have to know python, it's just a webpage. You enter the data for your scope camera target etc. and it spits out an exposure time for your target given a desired SNR (signal to noise ratio)

Link to comment
Share on other sites

  • 4 months later...

Finally had the time to make this a proper windows application.

Install the app. Run it as Administrator. The app prints the results to a  pdf file and opens it with your default pdf viewer.

Written in python and free to use.

Attached is the setup.exe and some pics.

eTC.png

etc1.png

etc2.png

ETCSetup.exe

Link to comment
Share on other sites

  • 4 weeks later...

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.