Find reference stars : Python3 script

Design, construction, tuning of spectroscopes
Information and discussion about softwares (telescope remote, autoguiding, acquisition, spectral processing ...)
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Find reference stars : Python3 script

Post by Serge Golovanow »

Hey guys,

As I recently used computers without Microsoft Office while doing spectroscopy, I had some difficulties to use the ReferenceStarsFinder. I just got an ODS version to run it in LibreOffice, but i started to build a tool with Python3 and AstroPy library, from the stars database (including Miles database). It allowed me to make an easy-to-use script, able to find target's coordinates on SIMBAD and observer's place and timezone.
By example, I'm looking for stars near (10°) M27, from Vaulx-en-Velin's Planetarium (IAU/MPC Observatory L14), september 9th 23h local time :

Code: Select all

    Target   : m27 (19h59m36s +22d43m16s, Vulpecula), altitude=65.8°, azimuth=202° (S), airmass (secz)=1.097
    Observer : lat=45d46m38s, lon=4d55m22s, alt=172m, tz=Europe/Paris, 2019-09-10 21:00:00 UTC

    ##  Star:       Sep:    VMag:   RA:       Dec:          Height:         B-V:    Eb-v:   SpType:  secz:  Miles:
    01  HD 196724   9.1°    4.82    20h38m31s +21d12m04s    65°, Δh=-0.3°   -0.02   0       A0V      1.1
    02  HD338529    7.1°    9.37    19h32m58s +26d23m26s    67°, Δh=1.0°            0.01    B5       1.09   s0725
    03  HD 190993   1.9°    5.064   20h06m53s +23d36m52s    67°, Δh=1.3°    -0.16   0.04    B3V      1.09
    04  HD 189944   2.1°    5.872   20h01m45s +24d48m02s    68°, Δh=2.1°    -0.133  0.05    B4V      1.08
    05  HD 183914   8.4°    5.088   19h30m45s +27d57m55s    68°, Δh=2.1°    -0.061  0.05    B8Ve     1.08
    06  HD 192685   4.6°    4.759   20h15m16s +25d35m31s    69°, Δh=3.6°    -0.167  0.03    B3V      1.07
    07  HD 187362   4.4°    5       19h48m59s +19d08m31s    62°, Δh=-4.2°   0.1     0.02    A3V      1.14
    08  HD 192044   4.7°    5.903   20h12m01s +26d28m44s    70°, Δh=4.4°    -0.106  0.02    B7Ve     1.06
    09  HD189849    5.1°    4.663   20h01m59s +27d45m13s    71°, Δh=5.0°            0.03    A4III    1.06   s0748
    10  HD 196504   9.3°    5.589   20h37m05s +26d27m43s    71°, Δh=5.0°    -0.05   0.02    B9V      1.06
    11  HD 182919   8.2°    5.594   19h26m13s +20d05m52s    61°, Δh=-5.3°   0.002   0.01    A0V      1.15
    12  HD 192425   8.3°    4.947   20h14m17s +15d11m51s    59°, Δh=-6.7°   0.066   0.02    A2V      1.17
    13  HD 189395   8.3°    5.506   19h58m38s +30d59m01s    73°, Δh=7.7°    -0.059  0.01    B9Vn     1.04
    14  HD 185936   9.9°    5.988   19h41m06s +13d48m56s    56°, Δh=-9.8°   -0.081  0.08    B5V      1.21
Does it display enough information to choose the reference star ? Warning about huge Eb-v or Be stars is not (yet) the job of this script. Olivier Garde warned me about the incomplete Pickles database : alerts about missing spectral types would be an idea. Feel free to comment or let me know your wishes, in French or English !

I made the very first interface to this script, on a web page : interface is only to run the script, results are still displayed "as it".
Performances are really poor (mainly due to modules loading, on a small web server : main processing loop on stars database is parallelized) but... it works. You can give a try, I'll try not to break it during further coding.
I'll release the source code on GitHub soon.
Dubreuil Pierre
Posts: 202
Joined: Sat Oct 01, 2011 12:34 pm

Re: Find reference stars : Python3 script

Post by Dubreuil Pierre »

Bonsoir Serge

Je bricole un peu en Python, mais là je suis bluffé !

Super application web, et très utile en ce qui me concerne.

Cela serait bien qu'il y est un forum Python3 tout comme MatLab :-)

A suivre

Pierre
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Re: Find reference stars : Python3 script

Post by Serge Golovanow »

Hey !

The source code is available on GitHub : https://github.com/serge-golovanow/SpectroStars
You just need spectrostars.py and base.csv. Required packages are timezonefinder pytz numpy astropy astroquery joblib (numba will cause some trouble, I just removed it...). It was made on a Debian Buster (presently in testing), apt packages are up-to-date ; on other systems you should use pip (or conda) to get the last version of AstroPy (3.1 is required, I'll set an option to be able to use older versions). The script was successfully tested on Debian Buster, Ubuntu18.04 on Windows10, MiniConda on Windows10.

There isn't any command-line arguments, because I mainly use it with WSGI ; for command-line use, you have to edit the script and change configuration.
Dubreuil Pierre wrote:Je bricole un peu en Python, mais là je suis bluffé !
La plupart des mérites vont à AstroPy, mon script n'est en fait qu'une interface pour une fraction de ses possiblités ! Le prix en est le temps de chargement des modules :shock:
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Re: Find reference stars : Python3 script

Post by Serge Golovanow »

Hi
This week-end I made an improvement to speed up my web tool, it now takes only 2~3 seconds to show reference stars : https://www.sendell.com/spectrostars/
James Foster
Posts: 439
Joined: Sun Jan 24, 2016 7:14 am

Re: Find reference stars : Python3 script

Post by James Foster »

To: Serge,

Nice App! When I tried adding my MPC code G72, it came up with "Could not find observing place G72"
But when I look at the MPC, my location is clearly there; G72 241.82408 0.829301 +0.556970 University Hills.

James
James Foster
eShel2-Zwo ASI6200MM Pro
Lhires III (2400/1800/600 ln/mm Grat) Spectroscope
LISA IR/Visual Spectroscope (IR Configured)
Alpy 200/600 with Guide/Calibration modules and Photometric slit
Star Analyzer 200
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Re: Find reference stars : Python3 script

Post by Serge Golovanow »

Hi
I started to make an interface for the output, in a table (with sortable columns), and good/bad/very bad points for each star :

Good points : separation<2°, in Miles database (-0.5badpoint)
Bad points : separation>10°, VMag<3, height<30°, ΔH>5°, E(B-V)>0.1, SpType=Be (+0.5badpoint)
Very bad points : separation>15°, VMag<1, height<15°, ΔH>10°, E(B-V)>0.5 (+1 badpoint)
Stars with height <-10° are not showed at all ; stars with height<horizon have +3 badpoints.

If star has <0 badpoints it will be showed as a good one ; >1badpoint it will be marked as poor, >2 points as bad.

If you're experiencing strange behavior (no results, no error message) please refresh your browser's cache, by hitting Ctrl + F5.

I saw some eclisping binaries in the database, aren't they an issue ? Algol, BetaLyrae, ... And some variable stars, like EpsPersei.

James Foster wrote: Nice App! When I tried adding my MPC code G72, it came up with "Could not find observing place G72"
But when I look at the MPC, my location is clearly there; G72 241.82408 0.829301 +0.556970 University Hills.
Thanks for your feedback ; I corrected a bug with Astroquery (i was using longitude 0°->360° instead of -180°->180°), G72 will now set you near the California State University
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Re: Find reference stars : Python3 script

Post by Serge Golovanow »

Hi

MainName and ObjectType were added from SIMBAD in the database.
Gerard Arlic
Posts: 148
Joined: Mon Jul 10, 2017 10:25 pm

Re: Find reference stars : Python3 script

Post by Gerard Arlic »

Thanks :)
Star Analyser 100; Atik 383L; T200/1000
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Spectro-StarFinder

Post by Serge Golovanow »

Hey there,

I just updated my tool, it now has its own domain name : https://spectro-starfinder.net

I added charts of alt/az of target and reference star over time (1h before, 2h after observing time), some other information (if sptype is in PicklesDB, etc...). Charts are made with Matplotlib.
Alt/az over time
Alt/az over time
example1.jpg (137.47 KiB) Viewed 7072 times
Let me know if you find any bug or would like another functionality.
Safari on desktop is the only modern web browser without HTML5 date/timer picker... Date must specified with YYYY-MM-DD format ; time hh:mm
Serge Golovanow
Posts: 15
Joined: Mon Nov 25, 2013 9:50 pm
Location: Lyon, France
Contact:

Re: Find reference stars : Python3 script

Post by Serge Golovanow »

Hi,

Instead of a referenced target name, you can now search by coordinates : PNV J06095740+1212255 or 08 10 14 22 12 16 will work !
Post Reply