Skip to content

Commit

Permalink
Merge branch 'develop' into add_cwFilterNotch_module
Browse files Browse the repository at this point in the history
  • Loading branch information
CamphynR authored Nov 26, 2024
2 parents ded7d6d + 198c714 commit d8a9850
Show file tree
Hide file tree
Showing 256 changed files with 6,617 additions and 2,966 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,18 @@ jobs:
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SignalGen/test_build.sh
- name: "Signal propagation tests"
- name: "Validate separate trigger channels"
if: always()
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
export GSLDIR=$(gsl-config --prefix)
NuRadioMC/test/SignalProp/run_signal_test.sh
- name: "Test ray tracing modules"
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SingleEvents/validate_separate_trigger_channels.sh
- name: "Signal propagation tests"
if: always()
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
export GSLDIR=$(gsl-config --prefix)
python NuRadioMC/SignalProp/examples/ray_tracing_modules.py
NuRadioMC/test/SignalProp/run_signal_test.sh
- name: "Test Birefringence"
if: always()
run: |
Expand Down
5 changes: 3 additions & 2 deletions NuRadioMC/EvtGen/NuRadioProposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class ProposalFunctions(object):
not be used from the outside to avoid mismatching units.
"""

def __init__(self, config_file='SouthPole', log_level=logging.INFO, tables_path=None, seed=12, upper_energy_limit=1e14*units.MeV):
def __init__(self, config_file='SouthPole', log_level=logging.NOTSET, tables_path=None, seed=12, upper_energy_limit=1e14*units.MeV):
"""
Parameters
----------
Expand All @@ -232,6 +232,7 @@ def __init__(self, config_file='SouthPole', log_level=logging.INFO, tables_path=
-'Greenland', a config file for Summit Station, Greenland (spherical Earth),
same as SouthPole but with a 3 km deep ice layer.
log_level: logging level
Override the global logging level
tables_path: path
Path to PROPOSAL tables. Should be set to a path where PROPOSAL tables exist, or
where PROPOSAL tables can be saved. This avoids that PROPOSAL has to regenerate
Expand All @@ -249,7 +250,7 @@ def __init__(self, config_file='SouthPole', log_level=logging.INFO, tables_path=
For more details, check the documentation for the
:class:`Singleton metaclass <NuRadioReco.utilities.metaclasses.Singleton>`.
"""
self.__logger = logging.getLogger("proposal")
self.__logger = logging.getLogger("NuRadioMC.proposal")
self.__logger.setLevel(log_level)
self.__logger.info("initializing proposal interface class")

Expand Down
3 changes: 1 addition & 2 deletions NuRadioMC/EvtGen/generate_cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from NuRadioReco.utilities import units
import argparse
import logging
logger = logging.getLogger("EventGen")
logging.basicConfig()
logger = logging.getLogger("NuRadioMC.EventGen")
logger.setLevel(logging.INFO)

if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions NuRadioMC/EvtGen/generate_unforced.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from scipy.integrate import quad
from scipy.optimize import brentq
from scipy.interpolate import interp1d
from NuRadioMC.simulation.simulation import pretty_time_delta
from NuRadioMC.simulation.time_logger import pretty_time_delta
from NuRadioMC.EvtGen.generator import write_events_to_hdf5
from NuRadioMC.utilities import inelasticities
import pickle
Expand All @@ -18,7 +18,6 @@
from NuRadioReco.utilities import version
# np.random.seed(10) # just for testing

logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

Expand Down
6 changes: 3 additions & 3 deletions NuRadioMC/EvtGen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import time

import NuRadioMC
from NuRadioReco.utilities import units, version, particle_names
from NuRadioMC.utilities import inelasticities
from NuRadioMC.simulation.simulation import pretty_time_delta
from NuRadioMC.simulation.time_logger import pretty_time_delta
from NuRadioReco.utilities import units, version, particle_names


logger = logging.getLogger("NuRadioMC.EvtGen")
logger.setLevel(logging.INFO)
logger.setLevel(logging.NOTSET)


VERSION_MAJOR = 3
Expand Down
3 changes: 1 addition & 2 deletions NuRadioMC/EvtGen/generator_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from NuRadioReco.utilities import units
from NuRadioMC.EvtGen.generator import write_events_to_hdf5
import logging
logger = logging.getLogger("EventGen")
logging.basicConfig()
logger = logging.getLogger("NuRadioMC.EventGen")

VERSION_MAJOR = 1
VERSION_MINOR = 1
Expand Down
3 changes: 2 additions & 1 deletion NuRadioMC/EvtGen/proposal_table_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import logging
import sys

logger = logging.getLogger('ProposalTablesManager')
logger = logging.getLogger('NuRadioMC.EvtGen.ProposalTablesManager')


def produce_proposal_tables(config_file, tables_path=None):
"""
Expand Down
2 changes: 1 addition & 1 deletion NuRadioMC/EvtGen/readARAEventList.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from NuRadioReco.utilities import units
from io import BytesIO
import logging
logger = logging.getLogger("readARAEventList")
logger = logging.getLogger("NuRadioMC.EvtGen.readARAEventList")

VERSION = 0.1

Expand Down
2 changes: 1 addition & 1 deletion NuRadioMC/EvtGen/readEventList_ASCII.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from NuRadioReco.utilities import units
from io import BytesIO
import logging
logger = logging.getLogger("readEventList")
logger = logging.getLogger("NuRadioMC.EvtGen.readEventList")

VERSION = 0.2

Expand Down
4 changes: 2 additions & 2 deletions NuRadioMC/EvtGen/tests/T02_create_tau_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from NuRadioMC.EvtGen import generator
from NuRadioReco.utilities import units
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("testtaueventgen")
logger = logging.getLogger("NuRadioMC.EvtGen.test_tau_eventgen")
logger.setLevel(logging.DEBUG)

# define simulation volume
volume = {
Expand Down
3 changes: 1 addition & 2 deletions NuRadioMC/SignalGen/ARZ/ARZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
except ImportError:
numba_available = False

logger = logging.getLogger("SignalGen.ARZ")
logging.basicConfig()
logger = logging.getLogger("NuRadioMC.SignalGen.ARZ")
# logger.setLevel(logging.INFO)

######################
Expand Down
4 changes: 2 additions & 2 deletions NuRadioMC/SignalGen/ARZ/scripts/B01create_pulse_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from scipy import signal
import matplotlib.gridspec as gridspec

logger = logging.getLogger("test")
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger("NuRadioMC.SignalGen.test")
logger.setLevel(level=logging.WARNING)
rho = 0.924 * units.g / units.cm ** 3 # density g cm^-3

plot=False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from scipy import signal
import matplotlib.gridspec as gridspec

logger = logging.getLogger("test")
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger("NuRadioMC.SignalGen.test")
logger.setLevel(level=logging.WARNING)
rho = 0.924 * units.g / units.cm ** 3 # density g cm^-3

sampling_rate = 5 * units.GHz
Expand Down
4 changes: 3 additions & 1 deletion NuRadioMC/SignalGen/ARZ/tests/T02TestARZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from NuRadioMC.SignalGen.ARZ import ARZ
from radiotools import coordinatesystems as cstrafo
import logging
logging.basicConfig(level=logging.INFO)

logger = logging.getLogger("NuRadioMC.T02TestARZ")
logger.setLevel(logging.INFO)

shower_energy = 1.24e18 *units.eV
theta = 56 * units.deg
Expand Down
4 changes: 2 additions & 2 deletions NuRadioMC/SignalGen/ARZ/tests/T03TestSpeedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import matplotlib.gridspec as gridspec


logger = logging.getLogger("test")
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger("NuRadioMC.SignalGen.test")
logger.setLevel(level=logging.WARNING)
rho = 0.924 * units.g / units.cm ** 3 # density g cm^-3

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion NuRadioMC/SignalGen/HCRB2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from scipy import constants
from scipy.optimize import curve_fit
import logging
logger = logging.getLogger("HCRB2017")
logger = logging.getLogger("NuRadioMC.SignalGen.HCRB2017")
logger.setLevel(logging.INFO)


Expand Down
7 changes: 1 addition & 6 deletions NuRadioMC/SignalGen/askaryan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
from NuRadioReco.utilities import units, fft
from NuRadioMC.SignalGen import parametrizations as par
import logging
logger = logging.getLogger("SignalGen.askaryan")


def set_log_level(level):
logger.setLevel(level)
par.set_log_level(level)
logger = logging.getLogger("NuRadioMC.SignalGen.askaryan")


def get_time_trace(energy, theta, N, dt, shower_type, n_index, R, model, interp_factor=None, interp_factor2=None,
Expand Down
18 changes: 15 additions & 3 deletions NuRadioMC/SignalGen/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from NuRadioReco.utilities import units, fft
import NuRadioReco.framework.base_trace
import logging
logger = logging.getLogger("SignalGen.emitter")
logger = logging.getLogger("NuRadioMC.SignalGen.emitter")
import os
import pickle, lzma

Expand Down Expand Up @@ -270,6 +270,19 @@ def get_frequency_spectrum(amplitude, N, dt, model, full_output=False, **kwargs)
* idl1 & hvsp1 : these are the waveforms generated in KU lab and stored in hdf5 files
* gaussian : represents a gaussian pulse where sigma is defined through the half width at half maximum
* ARA02-calPulser : a new normalized voltage signal which depicts the original CalPulser shape used in ARA-02
* efield_idl1_spice: direct measurement of the efield from the idl1 pulser and its antenna as used in the SPICE
calibration campaigns from 2018 and 2019.
The `launch_vector` needs to be specified in the kwargs. See Journal of Instrumentation 15 (2020) P09039,
doi:10.1088/1748-0221/15/09/P09039 arXiv:2006.03027 for details.
the `amplitude` is used to rescale the efield relatively, i.e., amplitude = 1 will return the measured efield amplitude, an
amplitude of 10 will return 10 times the measured efield amplitude, etc.
Use kwarg `iN` to select a specific pulse from the 10 available pulses. The default is a random selection.
* efield_delta_pulse: a simple signal model of a delta pulse emitter. The kwarg `polarization` needs
to be specified to select the polarization of the efield, defined as float between 0 and 1 with
0 = eTheta polarized and 1 = ePhi polarized. The default is 0.5, i.e. unpolarized. The amplitudes are
set to preserve the total power of the delta pulse, i.e. A_theta = sqrt(1-polarization)
and A_phi = sqrt(polarization).
full_output: bool (default False)
if True, can return additional output
Expand All @@ -285,8 +298,7 @@ def get_frequency_spectrum(amplitude, N, dt, model, full_output=False, **kwargs)
Returns
-------
time trace: 1d or 2d array, shape (N) or (3, N) for `NuRadioReco.framework.electric_field`
the amplitudes for each time bin. In case of an efield, the the amplitude for the three componente eR, eTheta, ePhi are returned.
frequency spectrum: 1d or 2d array, shape (N/2+1) or (3, N/2+1) for `NuRadioReco.framework.electric_field`
additional information: dict
only available if `full_output` enabled
"""
Expand Down
6 changes: 1 addition & 5 deletions NuRadioMC/SignalGen/parametrizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
from NuRadioReco.utilities import units
from scipy import constants
import logging
logger = logging.getLogger("SignalGen.parametrizations")


def set_log_level(level):
logger.setLevel(level)
logger = logging.getLogger("NuRadioMC.SignalGen.parametrizations")

"""
Expand Down
5 changes: 4 additions & 1 deletion NuRadioMC/SignalGen/tests/T04CompareModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import matplotlib.pyplot as plt
from radiotools import plthelpers as php
import logging
logging.basicConfig(level=logging.INFO)


logger = logging.getLogger("NuRadioMC.T04CompareModels")
logger.setLevel(logging.INFO)

interp_factor = 20
# HAD for different viewing angles
Expand Down
Loading

0 comments on commit d8a9850

Please sign in to comment.