<commit_before>import numpy as np
from astropy.io import fits
import time
import os.path
import glob
import stomp
import cPickle as pickle

# TODO:  move output datadir to /tmp
# TODO:  figure out how to package simple_image.fits in with distribution and find it from this code

datadir = '/Users/hroe/Dropbox/py/ztv/ztv/test_data/'
files_to_delete = glob.glob(datadir + 'n*fits')
for curfile in files_to_delete:
    os.remove(curfile)

basis_filename = os.path.join(datadir, 'simple_image.fits')
basis_header = fits.getheader(basis_filename)
basis_data = fits.getdata(basis_filename, 0)

# star is at 155, 122
x0 = 155.
y0 = 122.

semimajor = [0., 0., 0.]
period = [0., 0., 0.]
semimajor[2] = 30.
period[2] = 50.
period[1] = period[2] / 2.
period[0] = period[2] / 3.
semimajor[1] = (((semimajor[2]**3)/(period[2]**2))*(period[1]**2))**(1./3.)
semimajor[0] = (((semimajor[2]**3)/(period[2]**2))*(period[0]**2))**(1./3.)

t = 0.
filenum = 1

import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
font = ImageFont.truetype("/Library/Fonts/Courier New Bold.ttf", 14)

# TODO: figure out how to abstract the following parameter to more generic

active_mq_info = None
# comment out next line to deactivate active_mq_info
active_mq_info = {'server':'oka.lowell.edu', 'port':61613, 'destination_prefix':'fake_fits_maker.ztv.'}
if active_mq_info is not None:<commit_msg>Just before big re-write to make this more of a standalone command line utility<commit_after>import numpy as np
from astropy.io import fits
import time
import os.path
import glob
import stomp
import cPickle as pickle

# TODO:  move output datadir to /tmp
# TODO:  figure out how to package simple_image.fits in with distribution and find it from this code

datadir = '/Users/hroe/Dropbox/py/ztv/ztv/test_data/'
files_to_delete = glob.glob(datadir + 'n*fits')
for curfile in files_to_delete:
    os.remove(curfile)

basis_filename = os.path.join(datadir, 'simple_image.fits')
basis_header = fits.getheader(basis_filename)
basis_data = fits.getdata(basis_filename, 0)

# star is at 155, 122 
x0 = 155.
y0 = 122.

semimajor = [0., 0., 0.]
period = [0., 0., 0.]
semimajor[2] = 30.
period[2] = 50.
period[1] = period[2] / 2.
period[0] = period[2] / 3.
semimajor[1] = (((semimajor[2]**3)/(period[2]**2))*(period[1]**2))**(1./3.)
semimajor[0] = (((semimajor[2]**3)/(period[2]**2))*(period[0]**2))**(1./3.)

t = 0.
filenum = 1

import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
font = ImageFont.truetype("/Library/Fonts/Courier New Bold.ttf", 14)

# TODO: figure out how to abstract the following parameter to more generic

active_mq_info = None
# comment out next line to deactivate active_mq_info
active_mq_info = {'server':'oka.lowell.edu', 'port':61613, 'destination_prefix':'fake_fits_maker.ztv.'}
if active_mq_info is not None:
{'fraction_non_alphanumeric': 0.1440588853838065, 'fraction_numerical': 0.04206098843322818, 'mean_word_length': 4.8244897959183675, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2722588', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1040, 'n_words': 300}