dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
662 stars 186 forks source link

Update docs: Docker and client.py #191

Closed dstndstn closed 3 years ago

Sevelantis commented 3 years ago

Hello. This sem to be my first post. Sorry if I am in a wrong place, but I find it less chaotic than creating new issue. Since I could not find any solution in opened or closed issues. Is this possible to work with Astrometry.net using only Docker?

Whenever i build docker webservice from 'docker' directory - https://github.com/dstndstn/astrometry.net/tree/main/docker/webservice

docker build -t astrometry-webservice:first .

In Step 11/14: RUN git stash && git pull I get exit code not equal to zero which is bad. Output:

Step 11/14 : RUN git stash && git pull
 ---> Running in f61872990a3c
Saved working directory and index state WIP on master: a83f9e26 Merge branch 'master' of github.com:dstndstn/astrometry.net
warning: redirecting to https://github.com/dstndstn/astrometry.net.git/
From http://github.com/dstndstn/astrometry.net
 * [new branch]        main       -> origin/main
 * [new tag]           0.81       -> 0.81
 * [new tag]           0.82       -> 0.82
 * [new tag]           0.83       -> 0.83
 * [new tag]           0.84       -> 0.84
 * [new tag]           0.85       -> 0.85
 * [new tag]           0.86       -> 0.86
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
The command '/bin/sh -c git stash && git pull' returned a non-zero code: 1
mir@miron:/usr/local/astrometry/source/docker/webservice$ 

I feel like this can be github main/master naming issue. Are we able to do anything? Maybe there could be simple workaround?

Thank you, Miron

dstndstn commented 3 years ago

Ahh yes, thank you, that is the problem. I am rebuilding the 'astrometrynet/latest' image...

dstndstn commented 3 years ago

Okay, I pushed a new astrometrynet/latest Dockerhub image -- can you please try again?

Sevelantis commented 3 years ago

Works like a charm! Thank you. And one more 'general' question: Is this possible to work with .FITS files with Astrometry.net, just using Docker? I am really hard stuck with local Astrometry.net configuration and I am trying to migrate to Docker. What do you think about this idea? Maybe you could help me with my no kdtree header issue? I can tell.

dstndstn commented 3 years ago

Yes, fits files should work fine.

And sure, I can try to help with the local Astrometry.net config issue you're having.

Sevelantis commented 3 years ago

OK. Starting this up on my Linux-Mint-20. I have a local copy of all .fits file listed in this URL - broiler.astrometry.net/~dstn/4200/

mir@miron:/usr/local/astrometry/data

/usr/local/astrometry/

/usr/local/astrometry/etc/astrometry.cfg Its content:

add_path /home/mir/Desktop/data
add_path /usr/local/astrometry/data
autoindex
# when i add anything here it seems to meet no change
  1. mir@miron:/usr/local/astrometry/data$ solve-field --no-plots -v --overwrite --dir out index-4203-26.fits
    (not xyls because: Missing required columns: X, Y)
    qfits: error: NAXIS = 0 in file index-4203-26.fits ext 0
    an-fitstopnm.c:224:main: Failed to load pixels.
    Command failed: /usr/local/astrometry/bin/an-fitstopnm -i index-4203-26.fits > /tmp/tmpl__cbpfa.pnm
    augment-xylist.c:590:backtick Failed to run command: /usr/local/astrometry/bin/image2pnm --infile index-4203-26.fits --uncompressed-outfile /tmp/tmp.uncompressed.hTOSmj --outfile /tmp/tmp.ppm.2hAOTj --ppm --mydir /usr/local/astrometry/bin/solve-field
    ioutils.c:568:run_command_get_outputs Command failed: return value 255
  1. mir@miron:/usr/local/astrometry/data$ solve-field --no-plots -v --overwrite --dir out FILE.fits First fails (until now everything was clear):
    (not xyls because: FITS file does not have any extensions)
    Failed to find (5x5) centroid of peak 22, subpeak 0 at (1343,340)
    Failed to find (5x5) centroid of peak 65, subpeak 0 at (1117,1187)
    Failed to find (5x5) centroid of peak 96, subpeak 0 at (1692,1793)
    kdtree_fits_io.c:274:kdtree_fits_read_tree: Kdtree header was not found in file /usr/local/astrometry/data/FILE.fits
    starkd.c:259:my_open: Failed to read kdtree from file "/usr/local/astrometry/data/FILE.fits"
    ...
    Failed to add index "/usr/local/astrometry/data/FILE-.fits".

I tried a lot of FITS files, installed prerequisites like: netpbm, cfitsio ... Can we do ?

Thank you very much for your time, Miron

sorry for edits

dstndstn commented 3 years ago

Hi,

If you have all the index-*.fits files in /usr/local/astrometry/data, then remove the "add_path /home/mir/Desktop/data" line from the config file.

The config file only points to index files, NOT to images you are going to solve.

cheers, --dustin

dstndstn commented 3 years ago

Oh, and don't put any other FITS files in the /usr/local/astrometry/data directory. That is, don't mix index files with your FITS images you are trying to solve. That is confusing solve-field.

Sevelantis commented 3 years ago

Oh, and don't put any other FITS files in the /usr/local/astrometry/data directory. That is, don't mix index files with your FITS images you are trying to solve. That is confusing solve-field.

So what is the difference between index files and FITS images ? What is the purpose of index file? Does the program search for FITS image using indexes? Because indexes seems to be FITS images metadata.

astrometry.cfg

add_path /home/mir/Desktop/data
autoindex

So when i run solve-field , autoindex automatically makes indexes for all files in .../data directory? Does it happen everytime or indexes are created just once; one index for every single FITS image? Then where are they stored and the most mysterious question: Is the argument of solve-field an index or FITS image? Does the FITS image need to be indexed?

Studying more about indexing overall.

Miron

Sevelantis commented 3 years ago

I mean if you could give any example of proper usage, we would be good to go! Instructions in http://astrometry.net/doc/readme.html are unclear to me, especially the usage section - demo examples.

dstndstn commented 3 years ago

Hi,

The index-*.fits files are pre-computed maps of the sky. They are not images, they are data files.

They go in /usr/local/astrometry/data

Nothing else goes in /usr/local/astrometry/data

You tell the solve-field command about those files by listing that directory in the astrometry.cfg file.

When you have a new image to solve -- a JPEG or FITS image -- that is what you pass to the solve-field command.

cheers, --dustin

Sevelantis commented 3 years ago

OK. What I did not know was: a group of index file is kind of database that stores 'exemplary' or 'near exemplary', 'ideal' examples of stars and whenever you run solve-field those index files are being searched for astrological dependencies such as: triangles, magnitudes, brightness, centroids etc...

argument of solve-field is simply eg. .FITS. file that is filtered through different criterias comparing to every single index file and overall, we are given the name of an index file, which fits the best. Those on your site are just examples, but the bigger and more reliable the database, the better the solution.

By the way, if anybody works only via docker using astrometry.net, try to take some time and show your workgin examples, here.

Thank you very much for your help Dustin, also I was really surprised with your very fast replies. No more questions from me at the moment.

Miron