I'm trying to get astrometry to work with a custom index, which is comparably small with respect to the usual universe indices: only 500 points.
Granted, this is probably a setting astrometry has not been designed for, but it would be interesting to see if the algorithm translates to this setting, too.
To reproduce, I'm generating a custom fits file of a random map like the following:
import numpy as np
import fitsio
import os
import pathlib
import astrometry
# generate a random map spanning the entire sky
num_stars = 500
full_map = np.random.rand(num_stars, 2) * np.array([180, 360]) - np.array([90, 180])
# convert map into data to be read by fitsio
data = np.zeros(len(full_map), dtype=[
('id', 'i8'), ('ra', 'f8'), ('dec', 'f8'), ('mag', 'f4')
])
for i in range(num_stars):
data[i] = (i, full_map[i, 0], full_map[i, 1], 1.0)
fitsio.write('test.fits', data)
# generate quads for .fits file
os.system(f"build-astrometry-index -i test.fits -P 14 -o test.fits")
solver = astrometry.Solver([pathlib.Path('test.fits')])
I'm seeking to lookup maps in the realm of 64 arcmins, so I'm using -P 14.
Also, I want all stars to be used for matching, so I'm giving equal mag/weights.
Now I want to find a local submap (stars within circle of radius 32 around origin) of the bigger map, which has no rotation, scale, translation or noise applied:
# generate and lookup local map
local_map = full_map[np.linalg.norm(full_map, axis=1) < 32]
print(len(local_map))
solution = solver.solve(
local_map,
size_hint=None,
position_hint=None,
solution_parameters=astrometry.SolutionParameters()
)
print(solution.has_match())
Yet, I can't make astrometry find a solution, the print statement always evaluates False.
Is there something wrong with my configuration? Or is astrometry just not designed to work with maps this sparse? In this case, do you have an idea, how I could make it work, maybe adjust some parameters, or let the full map span only a small area of the sky? (Didn't work thus far)
Any help is highly appreciated!