Changeset 11
- Timestamp:
- 06/02/08 15:59:58 (16 years ago)
- Location:
- datared
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
datared/gen_degrade.py
r9 r11 12 12 (options, args) = parser.parse_args () 13 13 14 if (len(args) != 2) :14 if (len(args) !=1) : 15 15 print "Usage : gen_degrade.py output.fits" 16 16 17 17 # Génération de la matrice 18 a = numpy.zeros((2 160,2053))18 a = numpy.zeros((2053,2160)) 19 19 for i in range(2160): 20 a[ i,:]=i+120 a[:,i]=i+1 21 21 22 22 # Creation de l'objet fits 23 hdu = pyfits.PrimaryHDU( b)23 hdu = pyfits.PrimaryHDU(a) 24 24 hdulist = pyfits.HDUList([hdu]) 25 25 26 26 prihdr = hdulist[0].header 27 27 prihdr.add_history('Generation de la mire') 28 hdulist.writeto(args[ 1],clobber=True)28 hdulist.writeto(args[0],clobber=True) 29 29 30 30 -
datared/pre.py
r9 r11 2 2 # coding: utf-8 3 3 4 VERSION='1.1' 4 VERSION='1.2' 5 6 # Version 1.2 : partie droite débute à 1086 et non 1087 5 7 6 8 import pyfits … … 8 10 9 11 import numpy 10 12 from scipy import * 11 13 12 14 parser = OptionParser() 15 parser.add_option("-n","--nobias",action="store_true", 16 dest="nobias", default=False, 17 help="no suppression of the bias (based on overscans)") 13 18 14 19 (options, args) = parser.parse_args () 15 20 16 21 if (len(args) !=2) : 17 print "Usage : pre.py input.fits output.fits" 22 print "Usage : pre.py [-n --nobias] input.fits output.fits" 23 exit(1) 18 24 19 25 # Ouverture de l'image fits en argument … … 24 30 25 31 gauche = scidata[:2048,50:1074] 26 droite = scidata[:2048,108 7:2111]32 droite = scidata[:2048,1086:2110] 27 33 28 # Suppression du fond (version brutale) 29 print "Warning ! bias removed (1600 / 2090) " 34 # Suppression du fond selon moyenne des overscans 30 35 31 gauche -= 1600 32 droite -= 2090 36 if options.nobias : 37 print "No bias substraction" 38 else: 39 bias_gauche = mean(scidata[:2048,:50])-10 40 bias_droite = mean(scidata[:2048,2110:])-10 41 print "Warning ! bias removed (%f / %f) " % (bias_gauche, bias_droite) 42 gauche -= bias_gauche 43 droite -= bias_droite 33 44 34 45 scidata = numpy.hstack((gauche,droite)) … … 39 50 40 51 prihdr = hdulist[0].header 52 prihdr.add_history('pre.py V'+VERSION) 41 53 prihdr.add_history('Suppression os/ps') 42 54
Note: See TracChangeset
for help on using the changeset viewer.