public
Created

  • Download Gist
gistfile1.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
In [1]: from astropy import wcs
 
In [2]: from astropy.io import fits
 
In [3]: hdulist = fits.open('../../../CFHTLS_T06/DEEP/CFHTLS_D-85_u_022559-042940_T0006.fits')
 
In [4]: w = wcs.WCS(hdulist[0].header)
 
In [5]: w.printwcs()
WCS Keywords
 
CD_11 CD_12: -5.1666667890000002e-05 0.0
CD_21 CD_22: 0.0 5.1666667890000002e-05
CRVAL : 36.495833330000004 -4.494444444
CRPIX : 9677.5 9677.5
NAXIS : 19354 19354
 
In [7]: w.wcs
Out[7]:
flag: 137
naxis: 2
crpix: 0x2730810
9677.5 9677.5
pc: 0x21ea6a0
pc[0][]: -5.1667e-05 0
pc[1][]: 0 5.1667e-05
cdelt: 0x272a960
1 1
crval: 0x2793e00
36.496 -4.4944
cunit: 0x231ddf0
"deg"
"deg"
ctype: 0x231dd30
"RA---TAN"
"DEC--TAN"
lonpole: 180.000000
latpole: -4.494444
restfrq: 0.000000
restwav: 0.000000
npv: 0
npvmax: 0
pv: 0x0
nps: 0
npsmax: 0
ps: 0x0
cd: 0x2144590
cd[0][]: -5.1667e-05 0
cd[1][]: 0 5.1667e-05
crota: 0x218e9f0
0 0
altlin: 2
velref: 0
alt: ' '
colnum: 0
colax: 0x21eabc0
0 0
wcsname: UNDEFINED
cname: 0x23265f0
UNDEFINED
UNDEFINED
crder: 0x27a2950
UNDEFINED UNDEFINED
csyer: 0x21cffb0
UNDEFINED UNDEFINED
radesys: UNDEFINED
equinox: 2000.000000
specsys: UNDEFINED
ssysobs: UNDEFINED
velosys: UNDEFINED
ssyssrc: UNDEFINED
zsource: UNDEFINED
obsgeo: UNDEFINED UNDEFINED UNDEFINED
dateobs: UNDEFINED
dateavg: UNDEFINED
mjdobs: UNDEFINED
mjdavg: UNDEFINED
ntab: 0
tab: 0x0
nwtb: 0
wtb: 0x0
types: 0x27470e0
2200 2201
lngtyp: "RA"
lattyp: "DEC"
lng: 0
lat: 1
spec: -1
cubeface: -1
err: 0x0
lin: (see below)
cel: (see below)
spc: (see below)
m_flag: 137
m_naxis: 2
m_crpix: 0x2730810 (= crpix)
m_pc: 0x21ea6a0 (= pc)
m_cdelt: 0x272a960 (= cdelt)
m_crval: 0x2793e00 (= crval)
m_cunit: 0x231ddf0 (= cunit)
m_ctype: 0x231dd30 (= ctype)
m_pv: 0x0 (= pv)
m_ps: 0x0 (= ps)
m_cd: 0x2144590 (= cd)
m_crota: 0x218e9f0 (= crota)
 
m_colax: 0x21eabc0 (= colax)
m_cname: 0x23265f0 (= cname)
m_crder: 0x27a2950 (= crder)
m_csyer: 0x21cffb0 (= csyer)
m_tab: 0x0 (= tab)
m_wtb: 0x0 (= wtb)
 
lin.*
flag: 137
naxis: 2
crpix: 0x2730810
9677.5 9677.5
pc: 0x21ea6a0
pc[0][]: -5.1667e-05 0
pc[1][]: 0 5.1667e-05
cdelt: 0x272a960
1 1
unity: 0
err: 0x0
piximg[0][]: -5.1667e-05 0
piximg[1][]: 0 5.1667e-05
imgpix[0][]: -19355 -0
imgpix[1][]: 0 19355
m_flag: 0
m_naxis: 0
m_crpix: 0x0
m_pc: 0x0
m_cdelt: 0x0
 
cel.*
flag: 137
offset: 0
phi0: 0.000000
theta0: 90.000000
ref: 36.496 -4.4944 180 -4.4944
prj: (see below)
euler: 36.496 94.494 180 -0.078362 0.99692
latpreq: 0 (not required)
isolat: 0
err: 0x0
 
prj.*
flag: 103
code: "TAN"
r0: 57.295780
pv: (not used)
phi0: 0.000000
theta0: 90.000000
bounds: 1
 
name: "gnomonic"
category: 1 (zenithal)
pvrange: 0
simplezen: 1
equiareal: 0
conformal: 0
global: 0
divergent: 1
x0: 0.000000
y0: 0.000000
err: 0x0
w[]: 0 0 0 0 0
0 0 0 0 0
m: 0
n: 0
prjx2s: 0x7f9d88297240
prjs2x: 0x7f9d88296d90
 
spc.*
flag: 0
type: " "
code: " "
crval: UNDEFINED
restfrq: 0.000000
restwav: 0.000000
pv: (not used)
w: 0 0 0 (remainder unused)
isGrism: 0
err: 0x0
spxX2P: 0x0
spxP2S: 0x0
spxS2P: 0x0
spxP2X: 0x0
 
 
In [8]: import locale
 
In [9]: locale.setlocale(locale.LC_ALL, ('fr_FR', 'UTF-8'))
Out[9]: 'fr_FR.UTF-8'
 
In [10]: w.wcs
Out[10]:
flag: 137
naxis: 2
crpix: 0x2730810
9677,5 9677,5
pc: 0x21ea6a0
pc[0][]: -5,1667e-05 0
pc[1][]: 0 5,1667e-05
cdelt: 0x272a960
1 1
crval: 0x2793e00
36,496 -4,4944
cunit: 0x231ddf0
"deg"
"deg"
ctype: 0x231dd30
"RA---TAN"
"DEC--TAN"
lonpole: 180,000000
latpole: -4,494444
restfrq: 0,000000
restwav: 0,000000
npv: 0
npvmax: 0
pv: 0x0
nps: 0
npsmax: 0
ps: 0x0
cd: 0x2144590
cd[0][]: -5,1667e-05 0
cd[1][]: 0 5,1667e-05
crota: 0x218e9f0
0 0
altlin: 2
velref: 0
alt: ' '
colnum: 0
colax: 0x21eabc0
0 0
wcsname: UNDEFINED
cname: 0x23265f0
UNDEFINED
UNDEFINED
crder: 0x27a2950
UNDEFINED UNDEFINED
csyer: 0x21cffb0
UNDEFINED UNDEFINED
radesys: UNDEFINED
equinox: 2000,000000
specsys: UNDEFINED
ssysobs: UNDEFINED
velosys: UNDEFINED
ssyssrc: UNDEFINED
zsource: UNDEFINED
obsgeo: UNDEFINED UNDEFINED UNDEFINED
dateobs: UNDEFINED
dateavg: UNDEFINED
mjdobs: UNDEFINED
mjdavg: UNDEFINED
ntab: 0
tab: 0x0
nwtb: 0
wtb: 0x0
types: 0x27470e0
2200 2201
lngtyp: "RA"
lattyp: "DEC"
lng: 0
lat: 1
spec: -1
cubeface: -1
err: 0x0
lin: (see below)
cel: (see below)
spc: (see below)
m_flag: 137
m_naxis: 2
m_crpix: 0x2730810 (= crpix)
m_pc: 0x21ea6a0 (= pc)
m_cdelt: 0x272a960 (= cdelt)
m_crval: 0x2793e00 (= crval)
m_cunit: 0x231ddf0 (= cunit)
m_ctype: 0x231dd30 (= ctype)
m_pv: 0x0 (= pv)
m_ps: 0x0 (= ps)
m_cd: 0x2144590 (= cd)
m_crota: 0x218e9f0 (= crota)
 
m_colax: 0x21eabc0 (= colax)
m_cname: 0x23265f0 (= cname)
m_crder: 0x27a2950 (= crder)
m_csyer: 0x21cffb0 (= csyer)
m_tab: 0x0 (= tab)
m_wtb: 0x0 (= wtb)
 
lin.*
flag: 137
naxis: 2
crpix: 0x2730810
9677,5 9677,5
pc: 0x21ea6a0
pc[0][]: -5,1667e-05 0
pc[1][]: 0 5,1667e-05
cdelt: 0x272a960
1 1
unity: 0
err: 0x0
piximg[0][]: -5,1667e-05 0
piximg[1][]: 0 5,1667e-05
imgpix[0][]: -19355 -0
imgpix[1][]: 0 19355
m_flag: 0
m_naxis: 0
m_crpix: 0x0
m_pc: 0x0
m_cdelt: 0x0
 
cel.*
flag: 137
offset: 0
phi0: 0,000000
theta0: 90,000000
ref: 36,496 -4,4944 180 -4,4944
prj: (see below)
euler: 36,496 94,494 180 -0,078362 0,99692
latpreq: 0 (not required)
isolat: 0
err: 0x0
 
prj.*
flag: 103
code: "TAN"
r0: 57,295780
pv: (not used)
phi0: 0,000000
theta0: 90,000000
bounds: 1
 
name: "gnomonic"
category: 1 (zenithal)
pvrange: 0
simplezen: 1
equiareal: 0
conformal: 0
global: 0
divergent: 1
x0: 0,000000
y0: 0,000000
err: 0x0
w[]: 0 0 0 0 0
0 0 0 0 0
m: 0
n: 0
prjx2s: 0x7f9d88297240
prjs2x: 0x7f9d88296d90
 
spc.*
flag: 0
type: " "
code: " "
crval: UNDEFINED
restfrq: 0,000000
restwav: 0,000000
pv: (not used)
w: 0 0 0 (remainder unused)
isGrism: 0
err: 0x0
spxX2P: 0x0
spxP2S: 0x0
spxS2P: 0x0
spxP2X: 0x0
 
 
In [11]: w = wcs.WCS(hdulist[0].header)
 
In [12]: w.printwcs()
WCS Keywords
 
CD_11 CD_12: -5.0 0.0
CD_21 CD_22: 0.0 5.0
CRVAL : 3.0 -4.0
CRPIX : 9.0 9.0
NAXIS : 19354 19354
 
In [13]:

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.