Skip to content

Commit

Permalink
Merge pull request #32 from fact-project/add_photon_stream
Browse files Browse the repository at this point in the history
introduce some more numbers needed by `photon_stream` repo
  • Loading branch information
maxnoe authored Jan 25, 2017
2 parents dd6a132 + a17af25 commit 504be3e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
18 changes: 18 additions & 0 deletions fact/geometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np


position = {
'latitude': {
'dir': 'N',
'deg': 28,
'min': 45,
'sec': 41.9
},
'longitude': {
'dir': 'W',
'deg': 17,
'min': 53,
'sec': 28.0
},
'altitude_above_sea_level': 2200
}
18 changes: 15 additions & 3 deletions fact/pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
]
)

FOCAL_LENGTH_IN_MM = 4889.
DISTORTION_SLOPE = 0.031/1.5 # only Sebastian can explain this number.
PIXEL_SPACING_IN_MM = 9.5

GEOM_2_SOFTID = {
(i, j): soft for i, j, soft in zip(
Expand All @@ -48,13 +51,22 @@ def get_pixel_dataframe():
bias_patch_sizes = pm.bias_patch_id.value_counts().sort_index()
pm['bias_patch_size'] = bias_patch_sizes[pm.bias_patch_id].values

pm['x'] = -pm.pos_Y.values * PIXEL_SPACING_IN_MM
pm['y'] = pm.pos_X.values * PIXEL_SPACING_IN_MM

pm['x'] = -pm.pos_Y.values*9.5
pm['y'] = pm.pos_X.values*9.5
pm['azimuth'] = np.rad2deg(
np.arctan(pm.x / FOCAL_LENGTH_IN_MM) * (1 + DISTORTION_SLOPE)
)
pm['zenith'] = np.rad2deg(
np.arctan(pm.y / FOCAL_LENGTH_IN_MM) * (1 + DISTORTION_SLOPE)
)

return pm

FOV_RADIUS = np.hypot(
get_pixel_dataframe().azimuth, get_pixel_dataframe().zenith
).max()

return pm

patch_indices = get_pixel_dataframe()[[
'trigger_patch_id',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='pyfact',
version='0.8.3',
version='0.8.4',
description='A module containing useful methods for working with fact',
url='http://github.com/fact-project/pyfact',
author='Maximilian Noethe, Dominik Neise',
Expand Down

0 comments on commit 504be3e

Please sign in to comment.