Skip to content

Commit

Permalink
diagnose & fix problem with super-wide images
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Feb 22, 2019
1 parent 02fdb76 commit ce590c1
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion net/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .api_util import *
from .log import *
from .tmpfile import *
import settings
import astrometry.net.settings

# Content-type to return for JSON outputs.
json_type = 'text/plain' # 'application/json'
Expand Down
5 changes: 5 additions & 0 deletions net/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ def bounce_try_dojob(jobid):
if opt.uimage:
ui = UserImage.objects.all().get(id=opt.uimage)
print('UserImage', ui)
im = ui.image
print('Image', im)
sub = ui.submission
print('Submission', sub)
print(sub.disk_file.get_path())

if opt.chown:
user = User.objects.all().get(id=opt.chown)
Expand Down
2 changes: 1 addition & 1 deletion net/process_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def dojob(job, userimage, log=None, solve_command=None, solve_locally=None):
ra, dec, radius = tan.get_center_radecradius()
nside = anutil.healpix_nside_for_side_length_arcmin(radius*60)
nside = int(2**round(math.log(nside, 2)))
nside = max(1, nside)
healpix = anutil.radecdegtohealpix(ra, dec, nside)
sky_location, created = SkyLocation.objects.get_or_create(nside=nside, healpix=healpix)
log.msg('SkyLocation:', sky_location)
Expand Down Expand Up @@ -685,7 +686,6 @@ def main(dojob_nthreads, dosub_nthreads, refresh_rate, max_sub_retries,
dojob_pool = multiprocessing.Pool(processes=dojob_nthreads)
if dosub_nthreads > 1:
print('Processing submissions with %d threads' % dosub_nthreads)
#dojob_pool = multiprocessing.Pool(processes=dojob_nthreads)
dosub_pool = multiprocessing.Pool(processes=dosub_nthreads)

print('Refresh rate: %.1f seconds' % refresh_rate)
Expand Down
3 changes: 2 additions & 1 deletion net/settings_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'nova4.astrometry.net',
'nova5.astrometry.net',
'nova6.astrometry.net',
'testserver',
]

MULTI_HOSTS = []
Expand Down Expand Up @@ -216,7 +217,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'urls'
ROOT_URLCONF = 'astrometry.net.urls'

ALLOWED_INCLUDE_ROOTS = (
os.path.join(WEB_DIR, 'templates'),
Expand Down
11 changes: 6 additions & 5 deletions net/settings_nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
sitename = 'nova'

# settings_nova.py
from settings_common import *
from astrometry.net.settings_common import *

MULTI_HOSTS = ['nova3.astrometry.net',
'nova4.astrometry.net',
'nova5.astrometry.net',
'nova6.astrometry.net',]
# MULTI_HOSTS = ['nova3.astrometry.net',
# 'nova4.astrometry.net',
# 'nova5.astrometry.net',
# 'nova6.astrometry.net',]
MULTI_HOSTS = []

# from settings_social import *
# ENABLE_SOCIAL = True
Expand Down
16 changes: 12 additions & 4 deletions net/views/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,16 @@ def search(req):


if __name__ == '__main__':
class Duck(object):
pass
req = Duck()
onthesky_image(req, zoom=0, calid=1)
# class Duck(object):
# pass
# req = Duck()
# onthesky_image(req, zoom=0, calid=1)

from django.test import Client
c = Client()
r = c.get('/user_images/2676353')
#print(r)
f = open('out.html', 'wb')
for x in r:
f.write(x)
f.close()
2 changes: 1 addition & 1 deletion net/views/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from astrometry.net.models import *
from astrometry.net import settings
from astrometry.net.util import NoBulletsRadioSelect, HorizontalRadioSelect
from log import *
from astrometry.net.log import *
from django import forms
from django.forms.models import inlineformset_factory
from django.http import HttpResponseRedirect
Expand Down
2 changes: 1 addition & 1 deletion net/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from astrometry.net.models import *
from astrometry.net import settings
from log import *
from astrometry.net.log import *
from django import forms
from django.http import HttpResponseRedirect

Expand Down
2 changes: 1 addition & 1 deletion net/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
os.environ['PATH'] += ':/usr/local/netpbm/bin:%s/blind:%s/util' % (path,path)

import logging
logfn = os.path.join(path, 'nova.log')
logfn = os.path.join(path, 'net', 'nova.log')
print('Logging to', logfn, file=sys.stderr)
logging.basicConfig(filename=logfn, level=logging.DEBUG)

Expand Down

0 comments on commit ce590c1

Please sign in to comment.