From d3205ca7df68aad37417139b5be0ad18f6a49d14 Mon Sep 17 00:00:00 2001 From: Hoilijoki Sanni M Date: Wed, 25 Jun 2025 10:34:39 +0300 Subject: [PATCH 1/3] Correction to plot_colormap3 and change the return of pitch angles --- analysator/pyCalculations/pitchangle.py | 3 ++- analysator/pyPlots/plot_colormap3dslice.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/analysator/pyCalculations/pitchangle.py b/analysator/pyCalculations/pitchangle.py index 19286777..1b651605 100644 --- a/analysator/pyCalculations/pitchangle.py +++ b/analysator/pyCalculations/pitchangle.py @@ -209,6 +209,7 @@ def pitch_angles( vlsvReader, # Wrap the data into a custon format result = output_1d([angles, weights], ["Pitch_angle", "sum_avgs"], [units, "1/m3"]) + rho_summed = np.sum(avgs) rho_nonsphere = np.sum(avgs_nonsphere) @@ -254,4 +255,4 @@ def pitch_angles( vlsvReader, outfilewrite.close() # Return the histogram - return result + return [angles, weights] diff --git a/analysator/pyPlots/plot_colormap3dslice.py b/analysator/pyPlots/plot_colormap3dslice.py index 1261046d..e70e82e9 100644 --- a/analysator/pyPlots/plot_colormap3dslice.py +++ b/analysator/pyPlots/plot_colormap3dslice.py @@ -371,7 +371,7 @@ def exprMA_cust(exprmaps, requestvariables=False): # xyz = (slice normal direction, 0:x, 1:y, 2:z slicestr='_slice' if not isinstance(normal, str): - if len(normal!=3): + if len(normal)!=3: logging.info("Error in interpreting normal " + str(normal)) exit else: From 6151d0551f2c7f608ac94e98d40946d3551b09dd Mon Sep 17 00:00:00 2001 From: Sanni Hoilijoki <6534491+hoilijoki@users.noreply.github.com> Date: Wed, 25 Jun 2025 11:17:24 +0300 Subject: [PATCH 2/3] revert pitch angle commit --- analysator/pyCalculations/pitchangle.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/analysator/pyCalculations/pitchangle.py b/analysator/pyCalculations/pitchangle.py index 1b651605..19286777 100644 --- a/analysator/pyCalculations/pitchangle.py +++ b/analysator/pyCalculations/pitchangle.py @@ -209,7 +209,6 @@ def pitch_angles( vlsvReader, # Wrap the data into a custon format result = output_1d([angles, weights], ["Pitch_angle", "sum_avgs"], [units, "1/m3"]) - rho_summed = np.sum(avgs) rho_nonsphere = np.sum(avgs_nonsphere) @@ -255,4 +254,4 @@ def pitch_angles( vlsvReader, outfilewrite.close() # Return the histogram - return [angles, weights] + return result From 60a7a98b831aca2c6a3d7a6b5a58cdf8a1ff03c8 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Wed, 25 Jun 2025 11:44:38 +0300 Subject: [PATCH 3/3] plot_colormap3dslice docstring to note axis-aligned slices only --- analysator/pyPlots/plot_colormap3dslice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/analysator/pyPlots/plot_colormap3dslice.py b/analysator/pyPlots/plot_colormap3dslice.py index e70e82e9..dba7476c 100644 --- a/analysator/pyPlots/plot_colormap3dslice.py +++ b/analysator/pyPlots/plot_colormap3dslice.py @@ -75,7 +75,8 @@ def plot_colormap3dslice(filename=None, useimshow=False, imshowinterp='none', ): - ''' Plots a coloured plot with axes and a colour bar. + ''' Plots a coloured plot with axes and a colour bar, slicing through a 3D domain. Currently only supports axis- + aligned slices. :kword filename: path to .vlsv file to use for input. Assumes a bulk file. :kword vlsvobj: Optionally provide a python vlsvfile object instead @@ -192,7 +193,7 @@ def plot_colormap3dslice(filename=None, Note that the aspect ratio of the colormap is made equal in any case, hence the axes proportions may change if the box and axes size are not designed to match by the user :kword cbaxes: Provide the routine a set of axes for the colourbar. - :kword normal: Direction of the normal of the 2D cut through ('x', 'y', or 'z' or a vector) + :kword normal: Direction of the normal of the 2D cut through ('x', 'y', or 'z' or a vector along x,y, or z) :kword cutpoint: Coordinate (in normal direction) through which the cut must pass [m] :kword cutpointre: Coordinate (in normal direction) through which the cut must pass [rE] :kword useimshow: Use imshow for raster background instead (default: False)