mirror of
https://github.com/pim-n/pg-rad
synced 2026-06-17 15:59:35 +02:00
Merge pull request #72 from pim-n/release-0.1.0
prepare for release 0.1.0
This commit is contained in:
@ -18,6 +18,7 @@ angle,662,1173,1332
|
||||
160,1.113,1.096,1.099
|
||||
170,1.091,1.076,1.083
|
||||
180,1.076,1.066,1.078
|
||||
-180,1.076,1.066,1.078
|
||||
-170,1.102,1.091,1.093
|
||||
-160,1.122,1.100,1.102
|
||||
-150,1.128,1.105,1.093
|
||||
|
||||
|
@ -7,6 +7,7 @@ from matplotlib.patches import Circle
|
||||
from pg_rad.landscape.landscape import Landscape
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
plt.set_loglevel(level='warning')
|
||||
|
||||
|
||||
class LandscapeSlicePlotter:
|
||||
|
||||
@ -10,6 +10,9 @@ from pg_rad.simulator.outputs import SimulationOutput
|
||||
from pg_rad.landscape.landscape import Landscape
|
||||
|
||||
|
||||
plt.set_loglevel(level='warning')
|
||||
|
||||
|
||||
class ResultPlotter:
|
||||
def __init__(self, landscape: Landscape, output: SimulationOutput):
|
||||
self.landscape = landscape
|
||||
|
||||
@ -12,6 +12,7 @@ from pg_rad.simulator.outputs import SimulationOutput
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logging.getLogger("PIL").setLevel(logging.WARNING)
|
||||
|
||||
|
||||
class NumpyEncoder(json.JSONEncoder):
|
||||
@ -43,6 +44,13 @@ def save_results(sim: SimulationOutput, folder_name: str) -> None:
|
||||
if ans.lower() == 'n':
|
||||
return
|
||||
|
||||
logger.debug(
|
||||
f"Integrated counts: {list(sim.count_rate.integrated_counts)}"
|
||||
)
|
||||
logger.debug(
|
||||
f"Distances: {list(sim.count_rate.distance)}"
|
||||
)
|
||||
|
||||
df = generate_df(sim)
|
||||
csv_name = generate_csv_name(sim)
|
||||
df.to_csv(f"{folder_name}/{csv_name}.csv", index=False)
|
||||
@ -67,10 +75,22 @@ def generate_df(sim: SimulationOutput) -> DataFrame:
|
||||
sim.count_rate.mean_bkg_cps
|
||||
)
|
||||
|
||||
east_coords = sim.count_rate.x[1:]
|
||||
north_coords = sim.count_rate.y[1:]
|
||||
|
||||
if len(east_coords) != sim.count_rate.integrated_counts.shape:
|
||||
east_coords = None
|
||||
north_coords = None
|
||||
logger.warning(
|
||||
"PG-RAD currently does not support interpolation"
|
||||
" of experimental paths for export. Only ROI_P, ROI_BR and Dist"
|
||||
" will be saved."
|
||||
)
|
||||
|
||||
result_df = DataFrame(
|
||||
{
|
||||
"East": sim.count_rate.x[1:],
|
||||
"North": sim.count_rate.y[1:],
|
||||
"East": east_coords,
|
||||
"North": north_coords,
|
||||
"ROI_P": sim.count_rate.integrated_counts,
|
||||
"ROI_BR": br_array,
|
||||
"Dist": sim.count_rate.distance
|
||||
|
||||
Reference in New Issue
Block a user