From ae06853169fce41cd40ed141a92b2c733287e322 Mon Sep 17 00:00:00 2001 From: Sebastian Achim Mueller Date: Mon, 26 Feb 2024 13:00:51 +0100 Subject: [PATCH] adopt changes in corsika-primary --- airshower_template_generator/production.py | 16 +++++++++------- airshower_template_generator/version.py | 2 +- setup.py | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/airshower_template_generator/production.py b/airshower_template_generator/production.py index 5e9ca6f..053544f 100644 --- a/airshower_template_generator/production.py +++ b/airshower_template_generator/production.py @@ -1,5 +1,6 @@ import numpy as np import corsika_primary as cpw +import spherical_coordinates import tempfile import os import io @@ -116,8 +117,8 @@ def make_corsika_steering_card( primary = { "particle_id": f8(particle["corsika_particle_id"]), "energy_GeV": f8(energy), - "zenith_rad": f8(0.0), - "azimuth_rad": f8(0.0), + "theta_rad": f8(0.0), + "phi_rad": f8(0.0), "depth_g_per_cm2": f8(0.0), } primaries.append(primary) @@ -306,15 +307,16 @@ def run_job(job): view = cherenkov_bunches[meets, :] - MOMENTUM_TO_POINTING = -1.0 ( cer_cpara, cer_cperp, ) = projection.project_light_field_onto_source_image( - cer_cx_rad=MOMENTUM_TO_POINTING - * view[:, cpw.I.BUNCH.UX_1], - cer_cy_rad=MOMENTUM_TO_POINTING - * view[:, cpw.I.BUNCH.VY_1], + cer_cx_rad=spherical_coordinates.corsika.ux_to_cx( + ux=view[:, cpw.I.BUNCH.UX_1] + ), + cer_cy_rad=spherical_coordinates.corsika.vy_to_cy( + vy=view[:, cpw.I.BUNCH.VY_1] + ), cer_x_m=xy_supports[azi][rad][probe][0], cer_y_m=xy_supports[azi][rad][probe][1], primary_cx_rad=0.0, diff --git a/airshower_template_generator/version.py b/airshower_template_generator/version.py index 8879c6c..4ad67eb 100644 --- a/airshower_template_generator/version.py +++ b/airshower_template_generator/version.py @@ -1 +1 @@ -__version__ = "0.3.7" +__version__ = "0.3.8" diff --git a/setup.py b/setup.py index 816950d..6af24fa 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,8 @@ install_requires=[ "json_utils_sebastian-achim-mueller", "binning_utils_sebastian-achim-mueller", - "corsika_primary>=2.3.0", + "spherical_coordinates>=0.1.1", + "corsika_primary>=2.4.4", "atmospheric_cherenkov_response_cherenkov-plenoscope-project", "sebastians_matplotlib_addons", "rename_after_writing",