Last change
on this file since 10 was
10,
checked in by meynadie, 16 years ago
|
|
-
Property svn:executable set to
*
|
File size:
909 bytes
|
Line | |
---|
1 | #!/bin/env python |
---|
2 | # coding: utf-8 |
---|
3 | |
---|
4 | VERSION='0.0' |
---|
5 | |
---|
6 | import pyfits |
---|
7 | from optparse import OptionParser |
---|
8 | |
---|
9 | import numpy |
---|
10 | |
---|
11 | |
---|
12 | parser = OptionParser() |
---|
13 | parser.add_option("-i","--input",dest="InputFilename", |
---|
14 | help="Input filename (required)", metavar="RAWIMAGE") |
---|
15 | parser.add_option("-o","--output",dest="OutputFilename", |
---|
16 | help="Output Filename (required)", metavar="FITSIMAGE") |
---|
17 | |
---|
18 | |
---|
19 | (options, args) = parser.parse_args () |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | # Ouverture de l'image bcc32 |
---|
24 | |
---|
25 | hdulist = pyfits.open(options.InputFilename) |
---|
26 | scidata = hdulist[0].data |
---|
27 | |
---|
28 | |
---|
29 | hdulist[0].data = numpy.cast[numpy.int16](scidata) |
---|
30 | |
---|
31 | # Construction de l'image (flip de la partie droite) |
---|
32 | |
---|
33 | # Creation de l'objet fits |
---|
34 | |
---|
35 | prihdr = hdulist[0].header |
---|
36 | |
---|
37 | prihdr.update('Conv','pybcc2fits','Logiciel de conversion utilise') |
---|
38 | prihdr.update('ConvVer',VERSION,'Version de bcc2fits') |
---|
39 | |
---|
40 | |
---|
41 | of = options.OutputFilename |
---|
42 | |
---|
43 | hdulist.writeto(of,clobber=True) |
---|
44 | |
---|
45 | hdulist.close() |
---|
Note: See
TracBrowser
for help on using the repository browser.