Skip to content

Commit

Permalink
Merge branch 'main' of github.com:dstndstn/astrometry.net
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Aug 29, 2024
2 parents b521542 + 7b1666e commit e831931
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 18 deletions.
77 changes: 65 additions & 12 deletions net/nova.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
add_path /data/INDEXES/index-5200-LITE
#add_path /data/INDEXES/index-5200-LITE
add_path /data/INDEXES/index-5200-HEAVY
add_path /data/INDEXES/index-4100
indexset 5200
index index-4107.fits
Expand All @@ -14,15 +15,67 @@ index index-4116.fits
index index-4117.fits
index index-4118.fits
index index-4119.fits
add_path /data/INDEXES/index-54m1-LITE
# JWST Stephan's Quintet
index index-54m1-056.fits
# JWST SMACS 0723
index index-54m1-145.fits
# JWST Carina Nebula
index index-54m1-152.fits
# JWST Southern Ring Nebula
index index-54m1-153.fits
# JWST M92
index index-54m1-044.fits
# add_path /data/INDEXES/index-54m1-LITE
# # JWST Stephan's Quintet
# index index-54m1-056.fits
# # JWST SMACS 0723
# index index-54m1-145.fits
# # JWST Carina Nebula
# index index-54m1-152.fits
# # JWST Southern Ring Nebula
# index index-54m1-153.fits
# # JWST M92
# index index-54m1-044.fits
#
# The preset -1 ones aren't in the "indexset 5200"
#
# index index-52m1-00.fits
# index index-52m1-01.fits
# index index-52m1-02.fits
# index index-52m1-03.fits
# index index-52m1-04.fits
# index index-52m1-05.fits
# index index-52m1-06.fits
# index index-52m1-07.fits
# index index-52m1-08.fits
# index index-52m1-09.fits
# index index-52m1-10.fits
# index index-52m1-11.fits
# index index-52m1-12.fits
# index index-52m1-13.fits
# index index-52m1-14.fits
# index index-52m1-15.fits
# index index-52m1-16.fits
# index index-52m1-17.fits
# index index-52m1-18.fits
# index index-52m1-19.fits
# index index-52m1-20.fits
# index index-52m1-21.fits
# index index-52m1-22.fits
# index index-52m1-23.fits
# index index-52m1-24.fits
# index index-52m1-25.fits
# index index-52m1-26.fits
# index index-52m1-27.fits
# index index-52m1-28.fits
# index index-52m1-29.fits
# index index-52m1-30.fits
# index index-52m1-31.fits
# index index-52m1-32.fits
# index index-52m1-33.fits
# index index-52m1-34.fits
# index index-52m1-35.fits
# index index-52m1-36.fits
# index index-52m1-37.fits
# index index-52m1-38.fits
# index index-52m1-39.fits
# index index-52m1-40.fits
# index index-52m1-41.fits
# index index-52m1-42.fits
# index index-52m1-43.fits
# index index-52m1-44.fits
# index index-52m1-45.fits
# index index-52m1-46.fits
# index index-52m1-47.fits

inparallel
2 changes: 1 addition & 1 deletion net/process_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def dojob(job, userimage, log=None, solve_command=None, solve_locally=None,
# Note, this must match Job.get_wcs_file().
wcsfile = 'wcs.fits'
corrfile = 'corr.fits'
axyflags = []
axyflags = ['--tag-all']
axyargs = {
'--out': axypath,
'--scale-low': slo,
Expand Down
3 changes: 1 addition & 2 deletions net/templates/api_help.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ <h2>Getting Started</h2>
<p>
Many API calls to retrieve information about existing images can be made
without permission. For example, you can retrieve the list of annotated
objects in an image via
{% url 'api/jobs/JOBID/annotations' %}.
objects in an image via a URL like <a href="https://nova.astrometry.net/api/jobs/123456/annotations">https://nova.astrometry.net/api/jobs/JOBID/annotations/</a>.
</p>
<p>
If you want to modify data on the site, you need to grab an <u>API key</u> first.
Expand Down
4 changes: 4 additions & 0 deletions net/templates/user_image/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ <h3>Calibration</h3>
<td>Stars detected in your images (x,y table):</td>
<td><a href="{% url 'axy-file' jobid=job.id %}">axy.fits</a></td>
</tr>
<tr>
<td>Stars detected in your images, converted to RA,Dec (FITS table):</td>
<td><a href="{% url 'image-rd-file' jobid=job.id %}">image-radec.fits</a></td>
</tr>
<tr>
<td>Correspondences between image and reference stars (table):</td>
<td><a href="{% url 'corr-file' jobid=job.id %}">corr.fits</a></td>
Expand Down
5 changes: 3 additions & 2 deletions net/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def dos_error(req):
index, index_tag, annotated_image, grid_image, index_location, index_nearby, index_recent, index_all, index_by_user,
index_user, index_album, hide, unhide, user_image, edit, search, serve_image, serve_thumbnail_image, image_set,
onthesky_image, sdss_image, galex_image, unwise_image, legacysurvey_image, red_green_image, extraction_image, wcs_file, new_fits_file,
kml_file, rdls_file, axy_file, corr_file)
kml_file, rdls_file, axy_file, image_rd_file, corr_file)
urlpatterns.extend([
re_path(r'^annotated_(?P<size>full|display)/(?P<jobid>' + jobpattern + r')/?', annotated_image, name='annotated_image'),
re_path(r'^grid_(?P<size>full|display)/(?P<jobid>' + jobpattern + r')/?', grid_image, name='grid_image'),
Expand Down Expand Up @@ -127,6 +127,7 @@ def dos_error(req):
re_path(r'^kml_file/(?P<jobid>' + idpattern + r')/?$', kml_file, name='kml-file'),
re_path(r'^rdls_file/(?P<jobid>' + idpattern + r')/?$', rdls_file, name='rdls-file'),
re_path(r'^axy_file/(?P<jobid>' + idpattern + r')/?$', axy_file, name='axy-file'),
re_path(r'^image_rd_file/(?P<jobid>' + idpattern + r')/?$', image_rd_file, name='image-rd-file'),
re_path(r'^corr_file/(?P<jobid>' + idpattern + r')/?$', corr_file, name='corr-file'),
])
#
Expand Down Expand Up @@ -195,7 +196,7 @@ def dos_error(req):
re_path(r'^api/jobs/(?P<job_id>' + idpattern + r')/tags/?$', tags, name='api_tags'),
re_path(r'^api/jobs/(?P<job_id>' + idpattern + r')/machine_tags/?$', machine_tags, name='api_machine_tags'),
re_path(r'^api/jobs/(?P<job_id>' + idpattern + r')/objects_in_field/?$', objects_in_field, name='api_objects_in_field'),
re_path(r'^api/jobs/(?P<job_id>' + idpattern + r')/annotations/?$', annotations_in_field, name='api_annotations_in_field'),
re_path(r'^api/jobs/(?P<job_id>(' + idpattern + r'|JOBID))/annotations/?$', annotations_in_field, name='api_annotations_in_field'),
re_path(r'^api/jobs/(?P<job_id>' + idpattern + r')/info/?$', job_info, name='api_job_info'),
re_path(r'^api/jobs_by_tag/?$', jobs_by_tag, name='api_jobs_by_tag'),
#(r'^api/logout/?', 'logout'),
Expand Down
25 changes: 25 additions & 0 deletions net/views/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,31 @@ def axy_file(req, jobid=None):
res['Content-Disposition'] = 'attachment; filename=axy.fits'
return res

def image_rd_file(req, jobid=None):
job = get_object_or_404(Job, pk=jobid)
wcsfn = job.get_wcs_file()
axyfn = job.get_axy_file()
rdfn = get_temp_file(tempfiles=req.tempfiles)
cmd = 'wcs-xy2rd -w %s -i %s -o %s' % (wcsfn, axyfn, rdfn)
logmsg('Running: ' + cmd)
(rtn, out, err) = run_command(cmd)
if rtn:
logmsg('out: ' + out)
logmsg('err: ' + err)
return HttpResponse('wcs-xy2rd failed: out ' + out + ', err ' + err)
from astrometry.util.fits import fits_table
xy = fits_table(axyfn)
rd = fits_table(rdfn)
for c in xy.get_columns():
rd.set(c, xy.get(c))
rd.writeto(rdfn)

res = HttpResponse(open(rdfn, 'rb'))
res['Content-Type'] = 'application/fits'
res['Content-Length'] = file_size(rdfn)
res['Content-Disposition'] = 'attachment; filename=image-radec.fits'
return res

def corr_file(req, jobid=None):
job = get_object_or_404(Job, pk=jobid)
f = open(job.get_corr_file(), 'rb')
Expand Down
5 changes: 4 additions & 1 deletion solver/onefield.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ static anbool grab_tagalong_data(startree_t* starkd, MatchObj* mo, onefield_t* b
ERROR("Failed to read data for column \"%s\" in index", col);
continue;
}
tag.name = strdup(col);
if ((strcaseeq(col, "ra") || strcaseeq(col, "dec")))
asprintf_safe(&(tag.name), "%s_ref", col);
else
tag.name = strdup(col);
tag.units = strdup(tag.units);
tag.itemsize = fits_get_atom_size(tag.type) * tag.arraysize;
tag.Ndata = N;
Expand Down

0 comments on commit e831931

Please sign in to comment.