Bug 404929

Summary: Astrometry doesn't work at all in version 3.1
Product: [Applications] kstars Reporter: Jean-Claude <jcjesior>
Component: generalAssignee: Jasem Mutlaq <mutlaqja>
Status: RESOLVED FIXED    
Severity: normal CC: jogi, m204310, rlancaste
Priority: NOR    
Version First Reported In: 3.1.0   
Target Milestone: ---   
Platform: Other   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Solver failure
screenshot
screenshot2
Terminal content
text file of solve
Log file from the solver

Description Jean-Claude 2019-02-28 22:17:32 UTC
SUMMARY
In the Solver control panel, both buttons "Capture & Solve" and "Load & Solve" lead to a failure

STEPS TO REPRODUCE
1. click on buttons "Capture & Solve" or "Load & Solve"
2. 
3. 

OBSERVED RESULT
no dialog appears

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
MacOS: 10.14
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Jean-Claude 2019-03-01 05:47:32 UTC
Sorry, I misplaced my comment in "OBSERVED RESULTS"
It should be : the solver of KStars 3.1 ALWAYS fails , while the solver of KStars 3.0 ALWAYS succeeds
Comment 2 Jochen 2019-03-03 21:26:08 UTC
I've had the same issues as described and got it to work doing two things.

1. I've changed the solver setting in the Astrometry.net panel by unchecking "solver" (which disabled *Internal solver*) and entered the path "/Applications/KStars.app/Contents/MacOS/astrometry/bin/solve-field". The setting *Internal solver* seems not to link to it internally.

2. I've installed netpbm manually using homebrew. It seems that netbpm supplied by Kstars itself isn't working or even not used at all.
Comment 3 Jean-Claude 2019-03-03 21:35:43 UTC
Thank you Jochen for your help.
But the manual installation seems to be far beyond my capability.
I'll wait for version 3.2 and keep using 3.0 meanwhile.
Comment 4 Rob 2019-03-05 00:41:35 UTC
So disabling the internal solver or installing another version of netpbm will probably get it working on your system, but if there is an issue with the one I packaged up in the app bundle, it would be good to know what it is.  The internal netpbm is definitely used, but maybe there is an issue on your system.  I tested on several different Macs but found no issues, but that doesn't mean that there aren't any.

Can you please test to verify what the issue actually is by running the solver from the command line using the internal python and the internal netpbm?

The steps to do that are as follows.

1.  Try to plate solve an image using KStars. (Simulators or otherwise)  It will print all the commands to the log below.  They should be similar to the ones I'm posting below. (If you don't see these commands, turn on Alignment in the logging options)

2.  Go to a Terminal window and type these commands to see if it solves. Please post your results.

The Terminal commands to use (yours might differ slightly):

export PATH=/Applications/kstars.app/Contents/MacOS/netpbm/bin:/Applications/kstars.app/Contents/MacOS/python/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

export PYTHONPATH=/Applications/kstars.app/Contents/MacOS/python/bin/site-packages

/Applications/kstars.app/Contents/MacOS/astrometry/bin/solve-field -O --no-plots --no-verify --resort --downsample 2 -3 351.405 -4 61.698 -5 30 --config /Applications/kstars.app/Contents/MacOS/astrometry/bin/astrometry.cfg -W /private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/solution.wcs /private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/fitstVCXWV.fits

Note that the "/private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/fitstVCXWV.fits" is a temporary file and you will need to replace that with yours.

Thanks,

Rob
Comment 5 Jean-Claude 2019-03-05 04:42:06 UTC
Created attachment 118561 [details]
Solver failure

Log
Comment 6 Jean-Claude 2019-03-05 04:42:39 UTC
Rob, it is too complicate for me.
We could manage a TeamViewer session if you want.
I tried again on my desktop iMac 27" and laptop MacBook Pro.
Plenty of RAM and disk.
For the test I used the same simulated photo of Menkalinan.
Scope focal length = 1960mm, FOV = 31' x 23'
CCD simulator = 4656 x 3520 pixel, 3.80 x 3.80 micron
I clicked on the Load & Slew button of the Solver panel.
I did the test with 3 KStars versions : 298, 300, 310
298, 300 : success on both machines
310 : failure on both machines.
The Astrometry app of CloudMakers solved the photo immediately.
Comment 7 Rob 2019-03-05 05:18:29 UTC
Yes I understand it failed.  But after it failed, copy and paste the commands it used to terminal to see if it solves in the terminal.  If it fails in the terminal too, it will print a lot more detail as to why.  The log we need is not the KStars log because there is no way it can get the information back from astrometry as to why it is failing.  We really need the terminal output showing what astrometry.net is doing.
Comment 8 Jean-Claude 2019-03-05 05:35:45 UTC
Rob, I pasted in the Terminal :
export
PATH=/Applications/kstars.app/Contents/MacOS/netpbm/bin:/Applications/kstars.app/Contents/MacOS/python/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

export
PYTHONPATH=/Applications/kstars.app/Contents/MacOS/python/bin/site-packages

/Applications/kstars.app/Contents/MacOS/astrometry/bin/solve-field -O
--no-plots --no-verify --resort --downsample 2 -3 351.405 -4 61.698 -5 30
--config /Applications/kstars.app/Contents/MacOS/astrometry/bin/astrometry.cfg
-W /private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/solution.wcs
/private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/fitstVCXWV.fits


and then what ?
I will not be able to help except with very simple commands.
Comment 9 Rob 2019-03-05 05:36:42 UTC
when you hit enter after those 3 commands did it do anything?
Comment 10 Rob 2019-03-05 05:38:51 UTC
oh one note, you didn't change the last command to the one your system is using.

I pasted: 

/Applications/kstars.app/Contents/MacOS/astrometry/bin/solve-field -O
--no-plots --no-verify --resort --downsample 2 -3 351.405 -4 61.698 -5 30
--config /Applications/kstars.app/Contents/MacOS/astrometry/bin/astrometry.cfg
-W /private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/solution.wcs
/private/var/folders/l3/yznjwk917w9_f9qglkhkndpr0000gn/T/fitstVCXWV.fits

But your image you are using to plate solve and your coordinates are not the same.

You can literally copy and paste the correct command from the bottom of the Ekos alignment module in the log.  it tells you the exact command
Comment 11 Jean-Claude 2019-03-05 05:41:18 UTC
Sorry but I cannot help.
Do you want to do a TeamViewer session ?
Here is my private email : jcjesior@free.fr
Comment 12 Rob 2019-03-05 05:42:14 UTC
Created attachment 118563 [details]
screenshot

Here is a screenshot of the command to copy
Comment 13 Jean-Claude 2019-03-05 05:45:30 UTC
Sorry Rob we don't live on the same planet.
Comment 14 Rob 2019-03-05 05:45:50 UTC
Created attachment 118564 [details]
screenshot2

What it looks like in the terminal
Comment 15 Jean-Claude 2019-03-05 05:49:31 UTC
Terminal says over 55000 chars !
I copied in a file named Terminal.rtf
Comment 16 Jean-Claude 2019-03-05 05:50:06 UTC
Created attachment 118565 [details]
Terminal content
Comment 17 Rob 2019-03-05 05:59:44 UTC
Looks like there is a lot in the terminal before the commands I told you to run.  But I do see them at the bottom.  Would probably be better to start a new terminal session.  Also your last command accidentally got broken up into different commands with "enter" key strokes, but I still notice something interesting:

Is your KStars located in /Applications/KStars.app???

I'm concerned it says:  /Applications/kstars.app/Contents/MacOS/astrometry/bin/solve-field: No such file or directory
Comment 18 Rob 2019-03-05 06:03:38 UTC
Created attachment 118566 [details]
text file of solve

Here is what should happen with an example image.
Comment 19 Jean-Claude 2019-03-05 06:08:11 UTC
I'm sorry Rob if you are not ready to do a TeamViewer session I cannot help and wasting your time.
Comment 20 Rob 2019-03-05 06:10:54 UTC
I really cannot now because I have to go to bed.  it is 1:10 am here and I have to get up for work at 6:50 am or so.  Maybe some other time like a weekend.
Comment 21 Rob 2019-03-05 14:00:01 UTC
I think I have a possible solution for you.  Another user had a similar problem and followed my instructions.  The user got the same error you seemed to get where it couldn't find python.  Can you try this in a terminal and see if it fixes the problem?  This whole command is one line with no "enter" until the end.

mv /Applications/kstars.app/Contents/MacOS/python/bin/python /Applications/kstars.app/Contents/MacOS/python/bin/python2.7
Comment 22 Jochen 2019-03-05 14:26:09 UTC
(In reply to Rob from comment #21)

> mv /Applications/kstars.app/Contents/MacOS/python/bin/python
> /Applications/kstars.app/Contents/MacOS/python/bin/python2.7

I've tried it and it worked. Thanks a lot.

If I get it right, with renaming python this way it could be found anymore in this path, right? Can you explain what exactly the problem is here?
Comment 23 Jean-Claude 2019-03-05 14:45:48 UTC
Beautiful Rob ! KStars 3.1.0 solves now with both the "Capture & Solve" and "Load & Slew" buttons.
Thanks a lot to you for repairing the code and to Jasem for finding the bug.
Happy I am.
Comment 24 Rob 2019-03-05 14:46:09 UTC
I will make sure this file is named python2.7 in the next version of KStars.
Comment 25 Jean-Claude 2019-03-05 14:47:19 UTC
Jochen : I pasted the command line in the Terminal and everything is now working properly.
Comment 26 Yuriy 2019-03-10 17:04:40 UTC
Created attachment 118693 [details]
Log file from the solver

After I upgraded to kstars 3.1.0 both the offline and online solvers stopped working. The first upgrade consisted of just dragging the kstars.app into the Application folder. Then the solver was not able to solve neither real or simulated images. I removed the application and id a clean install. Same outcome. Today I installed 3.1.1 hoping that the astrometry solver will be fixed, but I got the same result. I read this bug report and tried changing the paths and various other settings. I attach the log file from the terminal window if that can give any indication of what is wrong.
Comment 27 Rob 2019-03-10 17:13:55 UTC
Yurly, 

According to your log file, the astrometry solver is working correctly as far as I can tell.  Astrometry does require that you get a lot of things configured correctly in order to actually solve your images.  Your issue could be one of several things that you should check. 

1.  Is the path in the astrometry config file correct for where you installed your index files?
2.  Do you have any index files installed at that location?
3.  Do you have the correct values for your aperture and focal length of your scope entered in the Mount module?
4.  Check all the settings for the astrometry solver in KStars.  There are many options.  You could try turning them on/off.  Scale and Location are the big two you should try turning off

Also please try with the simulators inside to optimize all these settings instead of trying to do it outside under the real sky.  Time under the stars is very limited.
Comment 28 Yuriy 2019-03-10 19:24:20 UTC
Bob,

Thank you very much for your help. I did not have a clue where to look at all and your list helped me make it work again. As I expected it was my error and not a bug at all. I assumed all the settings in the Simulators profile are pre-set, which is not the case. Once I set them properly the solver worked flawlessly. Thanks again!