File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ from astropy .table import Table
2
+ from fact .instrument import get_pixel_coords
3
+ import astropy .units as u
4
+ import numpy as np
5
+
6
+ x , y = get_pixel_coords ()
7
+ x = (x * u .mm ).to (u .m )
8
+ y = (y * u .mm ).to (u .m )
9
+ pix_id = np .arange (1440 )
10
+
11
+ radius = np .sqrt (np .diff (x )** 2 + np .diff (y )** 2 ).min () / 2
12
+ pix_area = 1.5 * np .sqrt (3 ) * radius ** 2
13
+
14
+
15
+ t = Table ()
16
+
17
+ t ['pix_id' ] = pix_id
18
+
19
+ # convert from fact coords into hess/cta camera coordinate system
20
+ t ['pix_x' ] = - y
21
+ t ['pix_y' ] = - x
22
+
23
+ t ['pix_area' ] = pix_area
24
+ t .meta ['TAB_TYPE' ] = 'ctapipe.instrument.CameraGeometry'
25
+ t .meta ['PIX_TYPE' ] = 'hexagonal'
26
+ t .meta ['CAM_ID' ] = 'FACT'
27
+ t .meta ['PIX_ROT' ] = 0.0
28
+ t .meta ['CAM_ROT' ] = 0.0
29
+ t .meta ['SOURCE' ] = 'pyfact'
30
+ t .meta ['TAB_VER' ] = '1'
31
+
32
+
33
+ t .write ('FACT.camgeom.fits.gz' , overwrite = True )
You can’t perform that action at this time.
0 commit comments