Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Astrometry.net running in a Linux subsystem of Win10


han59

Recommended Posts

The new Creators edition of Win10 has a Linux sub system where you can run Linux command line programs.

I have tried and can confirm that it is possible to run the Astronomy.net plate-solve package in this Linux subsystem.  Below a guideline.

The advantage is the pretty new Astrometry.net version v0.67. Programs as Astrotortilla and ANSVR install an old  v0.38 version of 2010 compiled for Cygwin. Disadvantage is that the interface is not yet supported by several software packages. So  you can only access it with the Windows command-line or my viewer/stack program ASTAP.

Furthermore the Win10 Creators edition has problems with AMD graphic cards. I had trouble in getting my old working driver back. So be warned.

 

Han

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Installation guideline (2017-12-16) local version of Astrometry.net v0.67 in a Linux sub system of Win10.

# With the Win10-Creators edition, it possible to install a Linux sub-system in Win10:
#
https://docs.microsoft.com/en-us/windows/wsl/install-win10
# Install the Ubuntu installer (OpenSuse and Sles are also available) as indicated in above webpage.

# open the Ubuntu window or open a Windows cmd window and enter bash.
# execute the following Linux commands (the update is required to allow astrometry.net to be installled):
sudo apt udate
sudo apt install astrometry.net

# Download the index files up to 10% of your image scale, so up to 22 arcmin (-08-19, -07) or 16 arc min (-08-19, -07, -06)
sudo apt install astrometry.net astrometry-data-2mass-08-19
sudo apt install astrometry.net astrometry-data-2mass-07
sudo apt install astrometry.net astrometry-data-2mass-06
# Check if the index files (index....fits) are available by entering the Linux command:
dir /usr/share/astrometry

# test the solver using a fits file on the Windows system .e.g. image at c:\astap.fpc\_M95_test_image.fit
# Open a Windows cmd window and enter:
C:\Windows\System32\bash.exe -c "solve-field /mnt/c/astap.fpc/_M95_test_image.fit --overwrite --downsample 4"

or

bash -c "solve-field /mnt/c/astap.fpc/_M95_test_image.fit --overwrite --downsample 4"

Additional information:
# Note that your Linux home folder is at something like: C:\Users\H\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home
# where "H" is the Windows user name.
# Case is important in the Linux command. Drive C: is lowercase /mnt/c

# Alternatively you can also download the index files in windows and place them in the Windows system (c:\temp\ast\astrometry)
# Copy the index files to Ubuntu subsystem (/usr/share/astrometry) by entering the Linux command:
sudo cp /mnt/c/temp/ast/astrometry/*.* /usr/share/astrometry
# The directory /usr/share/astrometry, is specified in /etc/astrometry.cfg but can be altered

# To download the data files for markup of the produced png files do in the Linux subsystem:
cd /usr/share/astrometry
sudo wget
https://github.com/dstndstn/astrometry.net/raw/master/catalogs/ngc2000names.dat/ngc2000names.dat
sudo wget https://github.com/dstndstn/astrometry.net/raw/master/catalogs/ngc2000names.dat/ngc2000_pos.txt
sudo wget https://github.com/dstndstn/astrometry.net/raw/master/catalogs/ngc2000names.dat/ngc2000.dat
sudo wget https://github.com/dstndstn/astrometry.net/raw/master/catalogs/ngc2000names.dat/ngc2000-readme.txt
sudo wget https://github.com/dstndstn/astrometry.net/raw/master/catalogs/ngc2000names.dat/ic2000_pos.txt

Link to comment
Share on other sites

Note that is not yet supported by almost all Software packages since the command line required is a little different. A program designed for the Cygwin version can't use it until it is updated. You could only use it with the command line.

Han

 

Link to comment
Share on other sites

I had a 'bash'  at this earlier in the year and came to the same point of a working astrometry but no way to get the software to talk to it. I did try to put together a newer version of Astrotortilla but could not get it to build properly as the used version was built on older version of software.

See here if interested

Hope you get further than I did.

Link to comment
Share on other sites

SGP calls the server of ANSVR and ANSVR is executing the Cygwin Bash. Since the Win10 Bash requires a slighly different command it will not work. The file name starts with /mnt/c

The others execute the Cygwin Bash directly with an command-line. Same problem, a slighly different command.

The Astrometry.net version running under Cygwin is what I understand a special compiled version for Cygwin, while the in Win10 installed is an Ubuntu compiled version.

You post gave me an new idea. I tiny program simulating the Cygwin Bash program could work as an interface and make it work. I wil try that....

Link to comment
Share on other sites


I made a little interface program bash.exe. It will accept a command line from any program executing the Cygwin bash.exe and execute the c:\windows\system32\bash.exe with the converted command line.

Simplest solution is to replace the existing Cygwin bash.exe (keep a copy of the old bash.exe).
Alternatively you could install it in an other directory if your are capable of setting the path to the Cygwin Bash.exe . If you place it in \astrometry\bin, you most likely have to enter \astrometry in your program.
It will write a log file bash_replacement_log.txt with the command input and output for debugging at the place of execution.

So the Win10 Linux subsystem installed solver can work as a replacement for the Cygwin solver.

I have tested it with CCDciel only. This will not work for ANSVR & SGP

Use it at your own risk. It contains a compiled executable and FPC source.

Han

Download:
win10_bash_interface.zip
webpage

 

Link to comment
Share on other sites

  • 2 weeks later...

I downloaded your bash.exe and compiled the code.

However, it does not quite work for me.

1. I get an error as the bash_replacement_log was trying to write to the C:\Windows\System32 directory where the windows bash.exe is. Changed this in the code to point to where I compiled the bash.exe interface was located.

2. The output in the log shows the local files with a prefix of \`cygpath -a \  and a suffix of \`\ around the filenames. When removed and the new command is run from cmd it works.

input: --login -c solve-field -b /etc/backend.cfg --sigma 70 --no-plots -N none -H 1.95 -L 1.56 -r --objs 100 --overwrite -L 30 -H 42 -u degwidth -D \`cygpath -a \c:/users/steve/appdata/local/temp/solverr0vgye/2\`\ \`cygpath -a \D:/platesolve/examples/apod4.jpg\`\
output: C:\Windows\System32\bash.exe   -c "solve-field -b /etc/backend.cfg --sigma 70 --no-plots -N none -H 1.95 -L 1.56 -r --objs 100 --overwrite -L 30 -H 42 -u degwidth -D \`cygpath -a \'/mnt/c/users/steve/appdata/local/temp/solverr0vgye/2\`\ \`cygpath' -a \'/mnt/d/platesolve/examples/apod4.jpg\`\'"

Try as I might, and not having used pascal before, I failed to remove those strings and wondered if you had seen the same and changed something to stop them occurring? I don't have cygwin installed anymore and just have your new bash.exe in it's own location with the appropriate change in the astrotortilla command line.

Link to comment
Share on other sites

  • 1 month later...

Sorry or the late response. I missed you reply.

1) I added three cleanup lines. I don't know why the strings are in but these three lines should remove them:

  {clean up for some users}

  command1:=StringReplace(command1,'\','',[rfReplaceAll]);
  command1:=StringReplace(command1,'`','',[rfReplaceAll]);
  command1:=StringReplace(command1,'cygpath -a','',[rfReplaceAll]);
  {end of clean up for some users}

2) The log file is now written in the execution directory.

Can you try the new version?

Han

win10_bash_interface.zip

 

Link to comment
Share on other sites

The new version did not work for me as is. However, it did make me investigate a bit further and I found that changing the StringReplace examples above to work on command2 did provide a working command (copied from the bash.exe log file) when pasted in a cmd window that solved the apod4.jpg example image.

Though I found it ws still not working with Astrotortilla (well at least my version) as there was a permissions problem with the temp file being used.  If I used StringReplace to use another directory I don't get the solved image rsults picked up by AT - I guess that's due to the changed temp directory.

I'll persevere and try to resolve the permissions problem, I can't be far off a working solution now thanks.

 

 

Link to comment
Share on other sites

I will have a look to Astrotortilla . Here I normally use CCDCiel for the pointing and aquisition.

I also did some more testing trying to get ANSVR running . ANSVR is used by SGP users to access Astrometry.net running under the Cygwin via TCP/IP. For the Win10 Linux subsystem you have to copy the ANSVR files to the WIN10 Linux sub-system environment but solving is stopped  due to errors. I contacted the ANSVR programmer Andy and he maybe will release an update of the Cygwin Astrometry.net compiled version, now at 2010 v0.38.

 

Link to comment
Share on other sites

I had a little more success. The permissions seems to be due to case sensitivity,  Astrotortilla is using C:/Users/username/AppData/Local/Temp as a working directory which can be seen in the log file your bash.exe provides but all in lowercase. I did some String replaces to get the case correct and can see the image gets solved (the files generated by the solve are in the temp directory).

In my setup I can solve images in the Win10 bash sub-system fine, and your bash.exe is working so it must be Astrotortilla as the culprit.  I guess it is also checking for the results using the lowercase directory (which would obviously fail) and fails to obtain the info/files it needs to return the success.

Had a play with ANSVR and SGP early last year and could not get them working together, although the Astrometry.net running in a docker container did work on it's own.  Though this was all cloudy night activities, when not at work,  so I had more time than I had wanted!

 

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • 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.