Last change
on this file since 14 was
2,
checked in by meynadie, 16 years ago
|
|
-
Property svn:executable set to
*
|
File size:
972 bytes
|
Line | |
---|
1 | #!/bin/env python |
---|
2 | # coding: utf-8 |
---|
3 | |
---|
4 | VERSION='1.0' |
---|
5 | |
---|
6 | import pyfits |
---|
7 | from optparse import OptionParser |
---|
8 | |
---|
9 | import numpy |
---|
10 | |
---|
11 | |
---|
12 | parser = OptionParser() |
---|
13 | |
---|
14 | (options, args) = parser.parse_args () |
---|
15 | |
---|
16 | if (len(args) !=2) : |
---|
17 | print "Usage : pre.py input.fits output.fits" |
---|
18 | |
---|
19 | # Ouverture de l'image fits en argument |
---|
20 | hdulist = pyfits.open(args[0]) |
---|
21 | scidata = hdulist[0].data |
---|
22 | |
---|
23 | |
---|
24 | scidata = numpy.zeros([2048,2048]) |
---|
25 | |
---|
26 | R2 = 910**2 # pixels |
---|
27 | |
---|
28 | # Tracé du disque |
---|
29 | for i in range(2048): |
---|
30 | for j in range(2048): |
---|
31 | if ( ((1024-i)**2 + (1024-j)**2) < R2): |
---|
32 | scidata[i,j] = 7000 |
---|
33 | |
---|
34 | scidata_flou = numpy.zeros([2048,2048]) |
---|
35 | |
---|
36 | # Floutage du bord sur ~ 5 pixels |
---|
37 | #fen=2 |
---|
38 | #for i in range(fen,2048-fen): |
---|
39 | # print i |
---|
40 | # for j in range(fen,2048-fen): |
---|
41 | # scidata_flou = sum(sum(scidata[i-fen:i+fen,j-fen:j+fen]))/\ |
---|
42 | # 100 |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | prihdr = hdulist[0].header |
---|
47 | prihdr.add_history('Generation de la mire') |
---|
48 | hdulist[0].data = scidata |
---|
49 | hdulist.writeto(args[1],clobber=True) |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | hdulist.close() |
---|
Note: See
TracBrowser
for help on using the repository browser.