<commit_before>#!/usr/bin/env python

import os
import time
import sys
import numpy as np
from find_boxes import *

def check_image():
    os.system("./ave_frames 3 \!spiral.fits")
    os.system("cat spiral.fits | xpaset timDIMM fits")
    hdu = rfits("spiral.fits")
    image = hdu.data
    n, stars = daofind(image)
    
    if n == 2:
        print "Found the stars!"
        return True
    else:
        print "No dice."
        return False

def plus_x():
    os.system("./gto900_nudge.rb s")

def minus_x():
    os.system("./gto900_nudge.rb n")

def plus_y():
    os.system("./gto900_nudge.rb e")

def minus_y():
    os.system("./gto900_nudge.rb w")

n = 0
x = 0
y = 0

has_stars = check_image()

if has_stars:
    print "Got stars right away!"
else:
    while n < 10:
        n = n + 1

        for i in range(n):
            y = y + 1
            plus_y()
            print "At (x,y) = (%d,%d)" % (x,y)
            if check_image():
                has_stars = True
                break

        if has_stars:
            break

        for i in range(n):
            x = x - 1
            minus_x()
            print "At (x,y) = (%d,%d)" % (x,y)
            if check_image():
                has_stars = True
                break

        if has_stars:
            break
<commit_msg>up the averaging; up number of iterations<commit_after>#!/usr/bin/env python

import os
import time
import sys
import numpy as np
from find_boxes import *

def check_image():
    os.system("./ave_frames 10 \!spiral.fits")
    os.system("cat spiral.fits | xpaset timDIMM fits")
    hdu = rfits("spiral.fits")
    image = hdu.data
    n, stars = daofind(image)

    if n == 2:
        print "Found the stars!"
        return True
    else:
        print "No dice."
        return False

def plus_x():
    os.system("./gto900_nudge.rb s")

def minus_x():
    os.system("./gto900_nudge.rb n")

def plus_y():
    os.system("./gto900_nudge.rb e")

def minus_y():
    os.system("./gto900_nudge.rb w")

n = 0
x = 0
y = 0

has_stars = check_image()

if has_stars:
    print "Got stars right away!"
else:
    while n < 50:
        n = n + 1

        for i in range(n):
            y = y + 1
            plus_y()
            print "At (x,y) = (%d,%d)" % (x,y)
            if check_image():
                has_stars = True
                break

        if has_stars:
            break

        for i in range(n):
            x = x - 1
            minus_x()
            print "At (x,y) = (%d,%d)" % (x,y)
            if check_image():
                has_stars = True
                break

        if has_stars:
            break

{'fraction_non_alphanumeric': 0.12581261950286807, 'fraction_numerical': 0.017208413001912046, 'mean_word_length': 1.5773399014778324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1425015', 'n_tokens_mistral': 990, 'n_tokens_neox': 897, 'n_words': 260}