<commit_before>#!/usr/local/python/bin/python
# script to check the previously unsolved files
import os
import glob as g

# read in astrometry.net log files
def getAstromFromFile(astromfile):
	f = open(astromfile, "r").readlines()
	ra=None
	dec=None
	for i in f:
		if i.startswith("Field center: (RA H:M:S"):
			tmp = i.split('=')
			ra,dec = tmp[1].split(',')
			ra = ra.strip()
			ra = ra.replace('(','')
			dec = dec.strip()
			dec = dec.replace(').','')
			break
	return ra, dec

def astrometry(image,scale_l,scale_h,ra=None,dec=None,radius=5.0,cpulimit=90):
	astromfile="astrometry_%s.log" % (image)
	command = "%s/solve-field %s --scale-low %s --scale-high %s --cpulimit %s --no-plots --overwrite" % (astrom_loc,image, scale_l, scale_h, cpulimit)
	command = "%s > %s" % (command,astromfile)
	os.system(command)
	ra,dec=getAstromFromFile(astromfile)							
	return ra,dec

RA,DEC=[],[]

t=sorted(g.glob('*.fits'))
for i in t:
	ra,dec=astrometry(i,2.83,2.93,cpulimit=2)
	if ra:<commit_msg>adding location of astrometry.net<commit_after>#!/usr/local/python/bin/python
# script to check the previously unsolved files
import os
import glob as g

w_dir="/ngts/staging/archive/minisurvey"
astrom_loc="/usr/local/astrometry.net/bin/"

# read in astrometry.net log files
def getAstromFromFile(astromfile):
	f = open(astromfile, "r").readlines()
	ra=None
	dec=None
	for i in f:
		if i.startswith("Field center: (RA H:M:S"):
			tmp = i.split('=')
			ra,dec = tmp[1].split(',')
			ra = ra.strip()
			ra = ra.replace('(','')
			dec = dec.strip()
			dec = dec.replace(').','')
			break
	return ra, dec

def astrometry(image,scale_l,scale_h,ra=None,dec=None,radius=5.0,cpulimit=90):
	astromfile="astrometry_%s.log" % (image)
	command = "%s/solve-field %s --scale-low %s --scale-high %s --cpulimit %s --no-plots --overwrite" % (astrom_loc,image, scale_l, scale_h, cpulimit)
	command = "%s > %s" % (command,astromfile)
	os.system(command)
	ra,dec=getAstromFromFile(astromfile)							
	return ra,dec

RA,DEC=[],[]

t=sorted(g.glob('*.fits'))
for i in t:
	ra,dec=astrometry(i,2.83,2.93,cpulimit=2)
	if ra:
{'fraction_non_alphanumeric': 0.18403441682600383, 'fraction_numerical': 0.011472275334608031, 'mean_word_length': 4.394329896907217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5245625', 'n_tokens_mistral': 916, 'n_tokens_neox': 866, 'n_words': 178}