#!/bin/env python # coding: utf-8 import glob import os import subprocess as sp import sys import datetime pwd = sys.path[0] log = open("./05_resultat.txt",'w') threshold = 0.5 width = 5 outs = "# %s\n" % (datetime.datetime.now().isoformat()) log.write(outs) outs = "# Nom Fichier / rayon x / centre x / rayon y / centre y / intensité centrale / '*' si problème\n" log.write(outs) outs = "# Seuil détection bord (par rapport au max) = %f\n" % (threshold) log.write(outs) outs = "# largeur fenêtre pour intensité moyenne au centre = %f\n" % (2*width +1) log.write(outs) log.flush() for filename in glob.glob("*.dat"): print filename # On obtient le "basename" (i.e. le nom de fichier moins '.dat') bn = filename[:-4] os.system('python "%s/01_pyraw2fits.py" -n %s' % (pwd, filename)) os.system('python "%s/02_prepare.py" %s %s' % (pwd, bn+'.fits', bn+'_02.fits')) os.system('python "%s/03_suppr_fond.py" %s %s' % (pwd, bn+'_02.fits', bn+'_03.fits')) buf = sp.Popen('python "%s/04_cherche_centre.py" -t %f -w %i %s' %\ (pwd, threshold, width, bn+'_03.fits'), shell=True, stdout=log) # Le lignes suivantes effacent les fichiers générés # Commenter si besoin # os.remove(bn+'.fits') os.remove(bn+'_02.fits') # os.remove(bn+'_03.fits') log.close()