Skip to content

Commit

Permalink
Merge pull request #90 from fact-project/analysis_scripts
Browse files Browse the repository at this point in the history
Add docstring to theta script
  • Loading branch information
maxnoe authored Dec 1, 2017
2 parents 51b428a + 0ca92f6 commit c4febb8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fact/analysis/scripts/theta.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,22 @@ def calc_theta_coordinates(df):
@click.option('-c', '--chunksize', type=int, default=10000)
@click.option('-y', '--yes', is_flag=True, help='Do not ask to overwrite existing keys')
def main(inputfile, source, chunksize, yes):
'''
Calculate theta_deg and theta_deg_offs from source position in camera coordinates
e.g. for example for files analysed with the classifier-tools
The following keys have to be present in the h5py hdf5 file.
* az_tracking
* zd_tracking
* source_x_prediction
* source_y_prediction
* unix_time_utc (Only if a source name is given)
'''

with h5py.File(inputfile, 'r') as f:
if any(col in f['events'].keys() for col in cols) and not yes:
click.confirm('Output keys already exist, overwrite? ', abort=True)


if source is None:
df_it = read_h5py_chunked(
inputfile,
Expand All @@ -100,7 +110,6 @@ def main(inputfile, source, chunksize, yes):
'zd_tracking',
'source_x_prediction',
'source_y_prediction',
'gamma_prediction',
'az_source_calc',
'zd_source_calc',
],
Expand All @@ -123,7 +132,6 @@ def main(inputfile, source, chunksize, yes):
'zd_tracking',
'source_x_prediction',
'source_y_prediction',
'gamma_prediction',
'unix_time_utc',
],
chunksize=chunksize
Expand Down

0 comments on commit c4febb8

Please sign in to comment.