source: cherche_centre/00_traiter_tout_dat.py

Last change on this file was 29, checked in by meynadie, 16 years ago

ajout double quotes

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/env python
2# coding: utf-8
3
4import glob
5import os
6import subprocess as sp
7import sys
8import datetime
9
10pwd = sys.path[0]
11
12log = open("./05_resultat.txt",'w')
13
14threshold = 0.5
15width = 5
16
17outs = "# %s\n" % (datetime.datetime.now().isoformat())
18log.write(outs)
19outs = "# Nom Fichier / rayon x / centre x / rayon y / centre y / intensité centrale / '*' si problÚme\n"
20log.write(outs)
21outs = "# Seuil détection bord (par rapport au max) = %f\n" % (threshold) 
22log.write(outs)
23outs = "# largeur fenêtre pour intensité moyenne au centre = %f\n" % (2*width +1) 
24log.write(outs)
25
26log.flush()
27
28for filename in glob.glob("*.dat"):
29    print filename
30    # On obtient le "basename" (i.e. le nom de fichier moins '.dat')
31    bn = filename[:-4]
32    os.system('python "%s/01_pyraw2fits.py" -n %s' % (pwd,
33                                                    filename))
34    os.system('python "%s/02_prepare.py" %s %s' % (pwd,
35                                                 bn+'.fits',
36                                                 bn+'_02.fits'))
37    os.system('python "%s/03_suppr_fond.py" %s %s' % (pwd,
38                                                    bn+'_02.fits',
39                                                    bn+'_03.fits'))
40    buf = sp.Popen('python "%s/04_cherche_centre.py" -t %f -w %i %s' %\
41                   (pwd,
42                    threshold,
43                    width,
44                    bn+'_03.fits'),
45                   shell=True,
46                   stdout=log)
47    # Le lignes suivantes effacent les fichiers générés
48    # Commenter si besoin
49    # os.remove(bn+'.fits')
50    os.remove(bn+'_02.fits')
51    # os.remove(bn+'_03.fits')
52   
53log.close()
54
Note: See TracBrowser for help on using the repository browser.