From 4d156bc0b04b5d195951e876544c3a7dfdff2316 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 13:48:36 +0300 Subject: [PATCH 001/341] Update testpackage_compare.py added newline at end of file --- testpackage/testpackage_compare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 5b5e71b9..c74b44b4 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -106,4 +106,4 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): -compare_images_in_folders(a,b,output_folder) \ No newline at end of file +compare_images_in_folders(a,b,output_folder) From 1ba200034c1e596b63778e836e01499c6c3f470a Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 14:12:36 +0300 Subject: [PATCH 002/341] Testing --- testpackage/testpackage_compare.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index c74b44b4..a1ce7f89 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -42,7 +42,7 @@ def compare_images(a,b): a,b,output_folder = args.folder_a,args.folder_b,args.output_folder #Create output folder if it doesn't exist -if not os.path.exists(output_folder): +if not os.path.exists(output_folder) and output_folder!='NULL:': proc = subprocess.Popen(f'mkdir {output_folder}'.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) out,err = proc.communicate() @@ -78,6 +78,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: + print(file) if(not compare_images(file,file.replace(a,b))): filename = file.split("/")[-1].rstrip(".png") cmd = f"compare -metric RMSE {file} {file.replace(a,b)} {output_folder}/difference_output_{filename}.png" From 1ecdde56f376de0a14722b32bce6ff693cbe1fb1 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 14:18:48 +0300 Subject: [PATCH 003/341] Changes to workflow --- .github/workflows/test_compare_colourmap_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index a6a7aba3..3e73e346 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - extras: ["none", "all", "bvtk"] + extras: ["all"] steps: - uses: actions/checkout@v4 - name: Install uv From 394f6809245587d52d166bb25e8f0bc504c67bc8 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 14:30:25 +0300 Subject: [PATCH 004/341] debug print --- testpackage/testpackage_compare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index a1ce7f89..799ca5a3 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -78,9 +78,9 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: - print(file) + print(file,file.replace(a,b)) if(not compare_images(file,file.replace(a,b))): - filename = file.split("/")[-1].rstrip(".png") + filename = file.split("/")[-1].rstrip(".png") #is it always png? cmd = f"compare -metric RMSE {file} {file.replace(a,b)} {output_folder}/difference_output_{filename}.png" if output_folder=='NULL:': From baaf6b3bf454f49e4d6e2ea7d0aee37d41b877c7 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:05:52 +0300 Subject: [PATCH 005/341] updated which branches do the action --- .github/workflows/test_compare_colourmap_images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 3e73e346..db4b7b3f 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -5,9 +5,9 @@ name: Turso compare colourmap images on: push: - branches: [ master, dev ] + branches: [ master, dev, image_compare] pull_request: - branches: [ master, dev ] + branches: [ master, dev, image_compare] schedule: - cron: '0 8 * * MON' workflow_dispatch: From 9c5495a4d10c080803f54c8a775c30239ac6aa8e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:41:53 +0300 Subject: [PATCH 006/341] test --- testpackage/testpackage_compare.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 799ca5a3..653a2a1c 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -7,6 +7,7 @@ def compare_images(a,b): cmd = f'compare -metric RMSE {a} {b} NULL:' + print(cmd.split(" ")) proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) out,err = proc.communicate() From 2839bffd7250e4517a8c9d89251fe63fa03ed40e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:44:30 +0300 Subject: [PATCH 007/341] updated the command to actually be correct --- testpackage/testpackage_compare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 653a2a1c..638f9b16 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -6,7 +6,7 @@ def compare_images(a,b): - cmd = f'compare -metric RMSE {a} {b} NULL:' + cmd = f'magick compare -metric RMSE {a} {b} NULL:' print(cmd.split(" ")) proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) out,err = proc.communicate() From 5a4c7ada53bc0de6494e0ccdf3ed482cfc098730 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:44:39 +0300 Subject: [PATCH 008/341] cleaned print --- testpackage/testpackage_compare.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 638f9b16..d4346ee1 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -7,7 +7,6 @@ def compare_images(a,b): cmd = f'magick compare -metric RMSE {a} {b} NULL:' - print(cmd.split(" ")) proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) out,err = proc.communicate() @@ -79,7 +78,6 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: - print(file,file.replace(a,b)) if(not compare_images(file,file.replace(a,b))): filename = file.split("/")[-1].rstrip(".png") #is it always png? cmd = f"compare -metric RMSE {file} {file.replace(a,b)} {output_folder}/difference_output_{filename}.png" From 098c3debb811363a674d420c14525f6c997c1cbb Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:50:00 +0300 Subject: [PATCH 009/341] debugging --- .github/workflows/test_compare_colourmap_images.yml | 2 ++ testpackage/run_compare.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index db4b7b3f..0c8dedc1 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -34,5 +34,7 @@ jobs: - name: Comparing plotted data run: | export TMPDIR=$RUNNER_TEMP + module purge + module load ImageMagick/7.1.1-10-gompi-2023a . CI_env/bin/activate ../analysator/testpackage/run_compare.sh diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 7c6f718c..d5cee307 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -6,7 +6,8 @@ folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpacka folder_2="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/5e40f1f7621c858984903d89771a5e7a00047863/" -output=$(python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) +output=$(python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} ) +#Make it so stderr is also captured if [[ $output == "" ]]; then From f9aaac6e7fc86f7f0f1dc5ac1c1646bdecd873ef Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 15:51:58 +0300 Subject: [PATCH 010/341] sigh --- .github/workflows/test_compare_colourmap_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 0c8dedc1..c539fc34 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -35,6 +35,6 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP module purge - module load ImageMagick/7.1.1-10-gompi-2023a + module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate ../analysator/testpackage/run_compare.sh From 4cab29c717bbb3fc7086a202068116c4c8b1b8d1 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 16:01:47 +0300 Subject: [PATCH 011/341] changed so the stderr gets directed to stdout such that the if statement actually gives exit code 1 on errors --- testpackage/run_compare.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index d5cee307..e16c57b0 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -6,7 +6,9 @@ folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpacka folder_2="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/5e40f1f7621c858984903d89771a5e7a00047863/" -output=$(python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} ) +output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) + + #Make it so stderr is also captured From b7ae18005a81a6c0ea15142ad28d78661e447fa4 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 16:04:17 +0300 Subject: [PATCH 012/341] debugging changes --- .github/workflows/test_compare_colourmap_images.yml | 2 ++ testpackage/run_compare.sh | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index c539fc34..2b1c51c1 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -34,6 +34,8 @@ jobs: - name: Comparing plotted data run: | export TMPDIR=$RUNNER_TEMP + echo $TMPDIR + echo $PWD module purge module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index e16c57b0..f4623ecd 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -9,9 +9,6 @@ folder_2="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpacka output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) -#Make it so stderr is also captured - - if [[ $output == "" ]]; then echo "No differences found" exit 0 From 051b6e1d56e3f29ad2db9fa046d1b5d0f6360335 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 16:30:33 +0300 Subject: [PATCH 013/341] added plot production (hopefully, not sure if it might explode) --- .../test_compare_colourmap_images.yml | 15 +++++++++--- .../run_testpackage_colormap_workflow.sh | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 testpackage/run_testpackage_colormap_workflow.sh diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 2b1c51c1..ee206f18 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -31,12 +31,21 @@ jobs: uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] - - name: Comparing plotted data + - name: Produce plots run: | export TMPDIR=$RUNNER_TEMP - echo $TMPDIR - echo $PWD + module purge + export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + . CI_env/bin/activate + + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap.sh + cat testpackage_colormap_run.txt + - name: Comparing plotted data + run: | + export TMPDIR=$RUNNER_TEMP + + . CI_env/bin/activate ../analysator/testpackage/run_compare.sh diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh new file mode 100644 index 00000000..78ae6276 --- /dev/null +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -0,0 +1,23 @@ +#!/bin/bash -l +#SBATCH -t 00:30:00 +#SBATCH -J analysator_testpackage +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=0-20 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + + +#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + +hostname +source CI_env/bin/activate +mkdir $PWD/produced_plots + +export PTNONINTERACTIVE=1 +export PTOUTPUTDIR=$PWD/produced_plots/ + +python testpackage_colormap.py $jobcount $index +echo Job $SLURM_ARRAY_TASK_ID complete. From 422aee88186ca315e3cbc7289ac24e570cc00069 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 16:53:23 +0300 Subject: [PATCH 014/341] setup for testing small run with sbatch --- .../test_compare_colourmap_images.yml | 2 +- testpackage/color_small_test.py | 465 ++++++++++++++++++ testpackage/run_compare.sh | 4 +- .../run_testpackage_colormap_workflow.sh | 2 +- 4 files changed, 468 insertions(+), 5 deletions(-) create mode 100644 testpackage/color_small_test.py diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index ee206f18..90114fe9 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -40,7 +40,7 @@ jobs: module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap.sh + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt - name: Comparing plotted data run: | diff --git a/testpackage/color_small_test.py b/testpackage/color_small_test.py new file mode 100644 index 00000000..a584f363 --- /dev/null +++ b/testpackage/color_small_test.py @@ -0,0 +1,465 @@ +import analysator as pt +import sys, os +import numpy as np +import traceback + +datalocation = "/wrk/group/spacephysics/vlasiator" +runs = [] +runs.append( { 'name': 'ABC', + 'verifydir': 'testpackage_colormap/ABC/', + 'fileLocation': datalocation+'/2D/ABC/bulk/', + 'fluxLocation': datalocation+'/2D/ABC/flux/', + 'pops': ['avgs'], + 'time': 1000, + 'singletime': False, + 'filename': None, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) +runs.append( { 'name': 'BCQ', + 'verifydir': 'testpackage_colormap/BCQ/', + 'fileLocation': datalocation+'/2D/BCQ/bulk/', + 'fluxLocation': None, #datalocation+'/2D/BCQ/flux/', # missing on Vorna + 'pops': ['avgs'], + 'time': 2000, + 'singletime': False, + 'filename': None, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +runs.append( { 'name': 'BFD', + 'verifydir': 'testpackage_colormap/BFD/', + 'fileLocation': datalocation+'/2D/BFD/bulk/', + 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', + 'fluxprefix': 'bulk.', + 'pops': ['proton','helium'], + 'time': 2000, + 'singletime': False, + 'filename': None, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +# runs.append( { 'name': 'BCQr', +# 'verifydir': 'testpackage_colormap/BCQr/', +# 'fileLocation': datalocation+'/2D/BCQ/', +# 'fluxLocation': None, +# 'pops': ['avgs'], +# 'time': 0, +# 'singletime': False, +# 'filename': 'restart.0001361.vlsv', +# 'nosubpops': False, # backstreaming / non-backstreaming +# 'vlasiator5': False, +# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +# runs.append( { 'name': 'AFC', +# 'verifydir': 'testpackage_colormap/AFC/', +# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', +# 'fluxLocation': datalocation+'/2D/AFC/production_halfres/flux/', +# 'pops': ['proton'], +# 'time': 1000, +# 'singletime': False, +# 'filename': None, +# 'nosubpops': False, # backstreaming / non-backstreaming +# 'vlasiator5': False, +# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) +# runs.append( { 'name': 'AFCr', +# 'verifydir': 'testpackage_colormap/AFCr/', +# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', +# 'fluxLocation': None, +# 'pops': ['proton'], +# 'time': 0, +# 'singletime': False, +# 'filename': 'restart.0000592.2019-04-19_07-58-12.vlsv', +# 'nosubpops': False, # backstreaming / non-backstreaming +# 'vlasiator5': False, +# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) +# runs.append( { 'name': 'BFDr', +# 'verifydir': 'testpackage_colormap/BFDr/', +# 'fileLocation': datalocation+'/2D/BFD/restart/', +# 'fluxLocation': None, +# 'pops': ['avgs'], +# 'time': 0, +# 'singletime': False, +# 'filename': 'restart.0001126.2018-06-03_21-34-16.vlsv', +# 'nosubpops': False, # backstreaming / non-backstreaming +# 'vlasiator5': False, +# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +runs.append( { 'name': 'BGA', + 'verifydir': 'testpackage_colormap/BGA/', + 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', + 'fluxLocation': None, + 'pops': ['proton'], + 'time': 380, + 'singletime': True, # neighboring bulk files not available + 'filename': None, + 'vlasiator5': True, + 'nosubpops': True, # thermal / non-thermal + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) + +# Custom expression function +def exprMA_cust(exprmaps, requestvariables=False): + if vlasiator5 is True: + reqs = ['vg_va'] + else: + reqs = ['va'] + if requestvariables==True: + return reqs + # exprmaps is a dictionary of numpy arrays + # Each array has 2 dimensions [xsize, ysize] + # or 3 dimensions [xsize, ysize, components] + # here the function returns the M_A with a preset bulk velocity + custombulkspeed=1500000. # m/s + va = exprmaps[reqs[0]][:,:] + MA = np.ma.divide(custombulkspeed,va) + return MA + +# Second example of a more involved custom expression function +def expr_cav_cust(pass_maps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # This custom expression returns a map with values of + # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against + # time-averaged background values. This version doesn't do intelligent checks for the + # format of the incoming data. + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + + # Multiple time steps were found + ntimes = len(pass_maps) + dsteps = [x['dstep'] for x in pass_maps] + curri = dsteps.index(0) + thesemaps = pass_maps[curri] + + thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) + thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) + thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) + thisBmag = np.linalg.norm(thisB, axis=-1) + + avgrho = np.zeros(np.array(thisrho.shape)) + avgBmag = np.zeros(np.array(thisrho.shape)) + # avgbeta = np.zeros(np.array(thisrho.shape)) + + for i in range(ntimes): + if i==curri: # Exclude current frame from background value averaging + continue + nowmaps = pass_maps[i] + print(nowmaps['dstep']) + avgrho = np.add(avgrho, nowmaps[reqs[0]]) + avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) + avgBmag = np.add(avgBmag, avgBcalc) + # avgbeta = np.add(avgbeta, nowmaps[2]) + + avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) + avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) + #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) + + rhoratio = np.ma.divide(thisrho, avgrho) + Bmagratio = np.ma.divide(thisBmag, avgBmag) + #betaratio = np.divide(thisbeta, avgbeta) + + rhoratioreq = 0.9 + bmagratioreq = 0.9 + betashfareq = level_beta_SHFA + + # Calculations using masked arrays proved problematic so a less-than elegant method is used here. + empty = np.zeros(np.array(thisrho.shape))+0.0 + half = empty + 0.5 + one = empty + 1.0 + caviton = np.add(empty, one, where=(rhoratiobetashfareq)) + print("sum of SHFA ",shfa.sum()) + + combo = np.add(empty, half, where=(caviton>1.5)) + print("sum of combo ",combo.sum()) + combo2 = np.add(empty, half, where=(shfa>2.5)) + print("sum of combo2 ",combo2.sum()) + combo3 = combo+combo2 + print("sum of combo3 ",combo3.sum()) + + # Mask out anything that is inside the bow shock + combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) + print("sum of combo3 upstream ",combo3.sum()) + + return combo3 + + +# Second example of a more involved custom expression function +def timesmooth(pass_maps): + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # consists of a single [ysize,xsize] array to smooth over time + + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + ntimes = len(pass_maps) + print("this many time steps ",ntimes) + # Select first valid variable + listofkeys = iter(pass_maps[0]) + while True: + var = next(listofkeys) + if var!="dstep": break + + # Multiple time steps were found + avg = np.zeros(pass_maps[0][var].shape) + for i in range(ntimes): + avg = np.add(avg, pass_maps[i][var]) + return np.divide(avg, np.array([ntimes])) + +# Helper function for drawing on existing panel +def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + + rho = extmaps[reqs[0]] + beta = extmaps[reqs[2]] + # take magnitude of B + B = np.linalg.norm(extmaps[reqs[1]],axis=-1) + + # Colours to use + color_cavitons = '#924900' + color_SHFAs = '#B66DFF' + color_BS = '#FFFF6D' + + # mask cavitons + cavitons = np.ma.masked_greater_equal(B,level_B_caviton) + cavitons.mask[rho > level_n_caviton] = True + cavitons.fill_value = 0. + cavitons[cavitons.mask == False] = 1. + + # mask SHFAs + SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) + SHFAs.mask[rho > level_n_caviton] = True + SHFAs.mask[beta < level_beta_SHFA] = True + SHFAs.fill_value = 0. + SHFAs[SHFAs.mask == False] = 1. + + # draw contours + contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], + linewidths=1.2, colors=color_BS) + contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) + contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) + +regularcalls = [] + +nonrestartcalls = [ +# Overplots and flux lines +"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", +] + + +multipopcalls = [] + +v5regularcalls = [] + +v5nonrestartcalls = [] + +v5multipopcalls = [] +# For handier debugging, uncomment these to overwrite call lists and include only relevant calls +# regularcalls = [] +# nonrestartcalls = ["pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +# ] +# multipopcalls = [] +# v5regularcalls = [] +# v5nonrestartcalls = [] +# v5multipopcalls = [] + +# Construct test list +calls = [] +callrunids = [] +callrunindex = [] +for i,run in enumerate(runs): + # bulk and restart files + vlasiator5 = run['vlasiator5'] + filename = run['filename'] + fileLocation = run['fileLocation'] + singletime = run['singletime'] + nosubpops = run['nosubpops'] + fluxLocation = run['fluxLocation'] + + callindex = 0 + if vlasiator5: + for call in v5regularcalls: + if not filename is None: + call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + else: + for call in regularcalls: + if not filename is None: + call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + # non-restart files + if filename is None: + if vlasiator5: + for call in v5nonrestartcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + for pop in run['pops']: + if pop != 'avgs': + for call in v5multipopcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + else: + for call in nonrestartcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + for pop in run['pops']: + if pop != 'avgs': + for call in multipopcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + +nteststot = len(callrunids) + + + +# How many jobs? +jobcount=int(sys.argv[1]) +jobcurr=int(sys.argv[2]) +increment = int(nteststot/jobcount) +remainder = nteststot - jobcount * increment +start=jobcurr * increment +end=start + increment +# Remainder frames are divvied out evenly among tasks +if jobcurr < remainder: + start = start + jobcurr + end = end + jobcurr + 1 +else: + start = start + remainder + end = end + remainder + + +# Perform call +for j in range(start,end): + # Calculate which run + jrun = callrunindex[j] + runid = callrunids[j] + call = calls[j] + + runname = runs[runid]['name'] + verifydir = runs[runid]['verifydir'] + fileLocation = runs[runid]['fileLocation'] + fluxLocation = runs[runid]['fluxLocation'] + pops = runs[runid]['pops'] + time = runs[runid]['time'] + filename = runs[runid]['filename'] + vlasiator5 = runs[runid]['vlasiator5'] + singletime = runs[runid]['singletime'] + + level_bow_shock = runs[runid]['cavitonparams'][0] + level_n_caviton = runs[runid]['cavitonparams'][1] + level_B_caviton = runs[runid]['cavitonparams'][2] + level_beta_SHFA = runs[runid]['cavitonparams'][3] + + outputLocation=pt.plot.defaultoutputdir+verifydir + + # Source data files + if filename is None: + bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" + else: + bulkname = filename + if 'fluxprefix' in runs[runid]: + fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" + else: + fluxname = "flux."+str(time).rjust(7,'0')+".bin" + + call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") + call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") + call = call.replace('REPLACETIME',"'"+str(time)+"'") + + # Many different plots + print(j, runid, jrun, call) + f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) + try: + exec(call) + except Exception as e: + print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) + + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index f4623ecd..d5331604 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -3,9 +3,7 @@ folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" -folder_2="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/5e40f1f7621c858984903d89771a5e7a00047863/" - - +folder_2="${PWD}/produced_plots/" output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 78ae6276..26959500 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -19,5 +19,5 @@ mkdir $PWD/produced_plots export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -python testpackage_colormap.py $jobcount $index +python color_small_test.py $jobcount $index echo Job $SLURM_ARRAY_TASK_ID complete. From fd8cfbffd1938183205f1994f135e287d2c3cff9 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 16:57:57 +0300 Subject: [PATCH 015/341] testings --- testpackage/run_compare.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index d5331604..f4dbcf92 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -4,6 +4,7 @@ folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" +echo $(ls $(folder_2)) output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) From 2a36e4275152309d7d3c22e17f79449363ea7299 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 17:09:46 +0300 Subject: [PATCH 016/341] more tsting --- .github/workflows/test_compare_colourmap_images.yml | 1 + testpackage/run_testpackage_colormap_workflow.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 90114fe9..f866441e 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -37,6 +37,7 @@ jobs: module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH + module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 26959500..67850ddb 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -14,7 +14,7 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname source CI_env/bin/activate -mkdir $PWD/produced_plots +mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ From 75131172fd817dbbf65e415a3e4f7c7b86023aee Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 17:13:41 +0300 Subject: [PATCH 017/341] fixed path in python --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 67850ddb..30a7c1cc 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -19,5 +19,5 @@ mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -python color_small_test.py $jobcount $index +python ./testpackage/color_small_test.py $jobcount $index echo Job $SLURM_ARRAY_TASK_ID complete. From f69178b2dda635f2ba10bedd47aa61fb6fe4292b Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 17:14:08 +0300 Subject: [PATCH 018/341] reduced array count to 0-5 --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 30a7c1cc..7b4e8faf 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=0-20 +#SBATCH --array=0-5 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 From b7ff510f743893ad3f6899d69223a0cd837667a5 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 17:30:23 +0300 Subject: [PATCH 019/341] added module list to yml job --- .github/workflows/test_compare_colourmap_images.yml | 1 + testpackage/run_compare.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index f866441e..d1f94ee3 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -39,6 +39,7 @@ jobs: export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + module list . CI_env/bin/activate sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index f4dbcf92..d5331604 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -4,7 +4,6 @@ folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" -echo $(ls $(folder_2)) output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) From df7ace629e17e2473338ec05acdff2bb86d67dff Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 3 Oct 2025 17:41:18 +0300 Subject: [PATCH 020/341] added timeout to the workflow --- .github/workflows/test_compare_colourmap_images.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index d1f94ee3..244c518c 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -17,6 +17,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: carrington + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -41,6 +42,7 @@ jobs: module load ImageMagick/7.1.0-37-GCCcore-11.3.0 module list . CI_env/bin/activate + pip list sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt From 03e6e9598c9a96421c14f111761037f592da3f97 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:11:25 +0300 Subject: [PATCH 021/341] debugging workflow --- .github/workflows/test_compare_colourmap_images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 244c518c..e545367c 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -43,8 +43,8 @@ jobs: module list . CI_env/bin/activate pip list - - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh + python -c "import analysator as pt" + #sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt - name: Comparing plotted data run: | From 4ddfd3dd0843ec32667e8b5149df708ddb3f3ece Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:15:51 +0300 Subject: [PATCH 022/341] even more workflow debugging --- .github/workflows/test_compare_colourmap_images.yml | 2 +- testpackage/run_testpackage_colormap_workflow.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index e545367c..dd537f48 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -44,7 +44,7 @@ jobs: . CI_env/bin/activate pip list python -c "import analysator as pt" - #sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt - name: Comparing plotted data run: | diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 7b4e8faf..b09a3242 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=0-5 +#SBATCH --array=1 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 @@ -12,6 +12,8 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) +echo $PWD + hostname source CI_env/bin/activate mkdir -p $PWD/produced_plots From 18628f5e3db50296ad10e5acdf825cb7801a81a7 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:17:37 +0300 Subject: [PATCH 023/341] hmmmmmmmmmmmmm --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index b09a3242..ca755bb7 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=1 +#SBATCH --array=1-2 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 From 32904ac452787cd7f17405677d30cd3a6ad3fd95 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:28:41 +0300 Subject: [PATCH 024/341] i dont understand --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index ca755bb7..a21cee5f 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -15,7 +15,7 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) echo $PWD hostname -source CI_env/bin/activate +#source CI_env/bin/activate mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 From 945750a2b742b3aa12f67a83bbd35510758bdebe Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:46:12 +0300 Subject: [PATCH 025/341] testings --- testpackage/run_testpackage_colormap_workflow.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index a21cee5f..2d43170a 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -15,7 +15,8 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) echo $PWD hostname -#source CI_env/bin/activate +source CI_env/bin/activate +echo $PYTHONPATH mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 From 1e22599ac98cc76f7792f2ecd7de412c671f5978 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 10:59:15 +0300 Subject: [PATCH 026/341] test --- .github/workflows/test_compare_colourmap_images.yml | 10 +++++----- testpackage/run_testpackage_colormap_workflow.sh | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index dd537f48..79ccce51 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -36,11 +36,11 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP - module purge - export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH - module load Python/3.10.4-GCCcore-11.3.0 - module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - module list + #module purge + #export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH + #module load Python/3.10.4-GCCcore-11.3.0 + #module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + #module list . CI_env/bin/activate pip list python -c "import analysator as pt" diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 2d43170a..a02f49ad 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -15,8 +15,14 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) echo $PWD hostname + + +module purge +export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH +module load Python/3.10.4-GCCcore-11.3.0 +module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + source CI_env/bin/activate -echo $PYTHONPATH mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 From 5920f0934910f7c277ef81d0b50775d1aae817ba Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:00:17 +0300 Subject: [PATCH 027/341] test --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index a02f49ad..87ed2822 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -12,7 +12,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -echo $PWD +#echo $PWD hostname From 684ef4bd50537913f19db0f8b8e776dde7072c4e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:06:25 +0300 Subject: [PATCH 028/341] test --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 87ed2822..a02f49ad 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -12,7 +12,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -#echo $PWD +echo $PWD hostname From 167f888383bef0582f09542efbbdda899842144d Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:15:45 +0300 Subject: [PATCH 029/341] test --- .github/workflows/test_compare_colourmap_images.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 79ccce51..c6ccb1ec 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -29,6 +29,7 @@ jobs: - name: Install dependencies run: | export TMPDIR=$RUNNER_TEMP + export UV_LINK_MODE=copy uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] @@ -41,9 +42,9 @@ jobs: #module load Python/3.10.4-GCCcore-11.3.0 #module load ImageMagick/7.1.0-37-GCCcore-11.3.0 #module list - . CI_env/bin/activate - pip list - python -c "import analysator as pt" + #. CI_env/bin/activate + #pip list + #python -c "import analysator as pt" sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt - name: Comparing plotted data From 01c2901a06dda09a6d8a299b140245310d6f096c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:19:03 +0300 Subject: [PATCH 030/341] test --- .github/workflows/test_compare_colourmap_images.yml | 2 +- testpackage/run_testpackage_colormap_workflow.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index c6ccb1ec..8969dfe2 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -45,7 +45,7 @@ jobs: #. CI_env/bin/activate #pip list #python -c "import analysator as pt" - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ../analysator/testpackage/run_testpackage_colormap_workflow.sh + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt - name: Comparing plotted data run: | diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index a02f49ad..b56886bc 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -23,6 +23,8 @@ module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 source CI_env/bin/activate +pip list + mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 From 0d3b063b9995ba384aeab6ecd372da234ff9b585 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:20:00 +0300 Subject: [PATCH 031/341] test --- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index b56886bc..3b2322cf 100644 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -12,7 +12,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -echo $PWD +#echo $PWD hostname @@ -23,7 +23,7 @@ module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 source CI_env/bin/activate -pip list +uv pip list mkdir -p $PWD/produced_plots From f0aea0d411fe0cf1f1c1a0c0a836f62c7d50df6d Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:24:15 +0300 Subject: [PATCH 032/341] test --- .github/workflows/test_compare_colourmap_images.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 8969dfe2..f66e7eb9 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -30,6 +30,8 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy + module purge + module load Python/3.10.4-GCCcore-11.3.0 uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] From b7a08b86c1add0863dcfa72840fb432d0acc45e2 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:29:14 +0300 Subject: [PATCH 033/341] test --- .github/workflows/test_compare_colourmap_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index f66e7eb9..f204b84d 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -52,7 +52,7 @@ jobs: - name: Comparing plotted data run: | export TMPDIR=$RUNNER_TEMP - + module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate ../analysator/testpackage/run_compare.sh From 4a11a7289befc58903b4a032c8e55dedb55c9447 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 11:29:35 +0300 Subject: [PATCH 034/341] testing final? --- .github/workflows/test_compare_colourmap_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index f204b84d..7d297667 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -53,6 +53,6 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 - + module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate ../analysator/testpackage/run_compare.sh From 20315ed8c52a627dafe31551d656034e5b17a1c1 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 12:52:36 +0300 Subject: [PATCH 035/341] testing stderror output --- testpackage/color_small_test.py | 2 +- testpackage/run_testpackage_colormap_workflow.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 testpackage/run_testpackage_colormap_workflow.sh diff --git a/testpackage/color_small_test.py b/testpackage/color_small_test.py index a584f363..30de6ca5 100644 --- a/testpackage/color_small_test.py +++ b/testpackage/color_small_test.py @@ -3,7 +3,7 @@ import numpy as np import traceback -datalocation = "/wrk/group/spacephysics/vlasiator" +datalocation = "/wrk/group/spacephysics/vlasator" runs = [] runs.append( { 'name': 'ABC', 'verifydir': 'testpackage_colormap/ABC/', diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh old mode 100644 new mode 100755 index 3b2322cf..75b4b602 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -23,12 +23,13 @@ module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 source CI_env/bin/activate -uv pip list mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ +echo $? python ./testpackage/color_small_test.py $jobcount $index -echo Job $SLURM_ARRAY_TASK_ID complete. +echo $? +#echo Job $SLURM_ARRAY_TASK_ID complete. From 3e879efe9a157f2c8984cfeddcbc6b53d2c4bafd Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:14:52 +0300 Subject: [PATCH 036/341] added exit code output --- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 75b4b602..ed6a6e06 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -29,7 +29,7 @@ mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -echo $? + python ./testpackage/color_small_test.py $jobcount $index -echo $? +echo "EXIT_CODE_FROM_JOB {$?}" #echo Job $SLURM_ARRAY_TASK_ID complete. From a47bb0c5a05437c0212999f6bacec81c76736b56 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:24:09 +0300 Subject: [PATCH 037/341] error code parser added --- .../test_compare_colourmap_images.yml | 15 ++++++------- .../run_testpackage_colormap_workflow.sh | 2 +- testpackage/testpackage_get_job_error.py | 21 +++++++++++++++++++ 3 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 testpackage/testpackage_get_job_error.py diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 7d297667..66e66c66 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -38,17 +38,14 @@ jobs: - name: Produce plots run: | export TMPDIR=$RUNNER_TEMP - - #module purge - #export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH - #module load Python/3.10.4-GCCcore-11.3.0 - #module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - #module list - #. CI_env/bin/activate - #pip list - #python -c "import analysator as pt" + + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt + module purge + module load Python/3.10.4-GCCcore-11.3.0 + python ./testpackage/testpackage_get_job_error.py testpackage_colormap_run.txt + - name: Comparing plotted data run: | export TMPDIR=$RUNNER_TEMP diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index ed6a6e06..78635727 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -31,5 +31,5 @@ export PTOUTPUTDIR=$PWD/produced_plots/ python ./testpackage/color_small_test.py $jobcount $index -echo "EXIT_CODE_FROM_JOB {$?}" +echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_get_job_error.py b/testpackage/testpackage_get_job_error.py new file mode 100644 index 00000000..bbe9f06b --- /dev/null +++ b/testpackage/testpackage_get_job_error.py @@ -0,0 +1,21 @@ + +import os + +from argparse import ArgumentParser + + +parser = ArgumentParser(prog="Log file parser" + ,description="Parses a log file and extracts job error messages." + ) + +parser.add_argument("log_file",help="Log file to parse") + +args= parser.parse_args() + +file= args.log_file + +with open(file,'r') as f: + lines = f.readlines() + for line in lines: + if line.split(" ")[0]=="EXIT_CODE_FROM_JOB": + raise SystemExit(int(line.split(" ")[1].rstrip("\n"))) From b827e1b1d905c79097f26787bab96969035e7de2 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:27:32 +0300 Subject: [PATCH 038/341] error code testing --- testpackage/color_small_test.py | 2 +- testpackage/testpackage_get_job_error.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testpackage/color_small_test.py b/testpackage/color_small_test.py index 30de6ca5..a584f363 100644 --- a/testpackage/color_small_test.py +++ b/testpackage/color_small_test.py @@ -3,7 +3,7 @@ import numpy as np import traceback -datalocation = "/wrk/group/spacephysics/vlasator" +datalocation = "/wrk/group/spacephysics/vlasiator" runs = [] runs.append( { 'name': 'ABC', 'verifydir': 'testpackage_colormap/ABC/', diff --git a/testpackage/testpackage_get_job_error.py b/testpackage/testpackage_get_job_error.py index bbe9f06b..2c76747b 100644 --- a/testpackage/testpackage_get_job_error.py +++ b/testpackage/testpackage_get_job_error.py @@ -17,5 +17,6 @@ with open(file,'r') as f: lines = f.readlines() for line in lines: - if line.split(" ")[0]=="EXIT_CODE_FROM_JOB": + error_code = line.split(" ") + if error_code[0]=="EXIT_CODE_FROM_JOB" and error_code[1].rstrip("\n")!="0": raise SystemExit(int(line.split(" ")[1].rstrip("\n"))) From c7c100276c94c35660746727565b19196648e449 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:44:42 +0300 Subject: [PATCH 039/341] small fixes --- testpackage/run_compare.sh | 1 + testpackage/run_testpackage_colormap_workflow.sh | 5 ++++- testpackage/testpackage_get_job_error.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index d5331604..af957ec6 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -2,6 +2,7 @@ +#verification set is from: 6.10.2025 folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 78635727..66fdcc7a 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -12,7 +12,6 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -#echo $PWD hostname @@ -22,8 +21,12 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + + source CI_env/bin/activate +module list + mkdir -p $PWD/produced_plots export PTNONINTERACTIVE=1 diff --git a/testpackage/testpackage_get_job_error.py b/testpackage/testpackage_get_job_error.py index 2c76747b..5f99fc17 100644 --- a/testpackage/testpackage_get_job_error.py +++ b/testpackage/testpackage_get_job_error.py @@ -20,3 +20,5 @@ error_code = line.split(" ") if error_code[0]=="EXIT_CODE_FROM_JOB" and error_code[1].rstrip("\n")!="0": raise SystemExit(int(line.split(" ")[1].rstrip("\n"))) + + From 8706f8dd98bd8f6597669310f8588dbee71c62c7 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:46:32 +0300 Subject: [PATCH 040/341] added latest verification set to path in run_compare --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index af957ec6..ccb26fcf 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -3,7 +3,7 @@ #verification set is from: 6.10.2025 -folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" +folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/e39b15ed638dee8235f87d88cb12221f89d2e9d7/" folder_2="${PWD}/produced_plots/" output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) From 43ad0d5d3b240901a5809b59cb60389431f664da Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 13:48:15 +0300 Subject: [PATCH 041/341] changed to full test --- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 66fdcc7a..a2a0eaf5 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=1-2 +#SBATCH --array=1-4 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 @@ -33,6 +33,6 @@ export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -python ./testpackage/color_small_test.py $jobcount $index +python ./testpackage/testpackage_colormap.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. From a39e68b65343400561630fa39c41fe0cf5b7078e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 6 Oct 2025 15:48:01 +0300 Subject: [PATCH 042/341] correct verification set path --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index ccb26fcf..af957ec6 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -3,7 +3,7 @@ #verification set is from: 6.10.2025 -folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/e39b15ed638dee8235f87d88cb12221f89d2e9d7/" +folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) From 7f8300cd7c2af10d06432d0130a23ea4aae3979e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 11:42:47 +0300 Subject: [PATCH 043/341] changed so only unique files in folder "b" (i.e plots produced by the test) get outputted --- testpackage/testpackage_compare.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index d4346ee1..f3740646 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -28,6 +28,8 @@ def compare_images(a,b): #output_folder = "/home/siclasse/analysator/different_output/" +#!!!!!outputs unique files only from folder "b" + #Parse arguments parser = ArgumentParser(prog="Image compare" @@ -73,7 +75,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): line=line.split(" ") if line[0]=="Binary" and line[1]=="files": different_files.append(line[2]) - elif line[0]=="Only": + elif line[0]=="Only" and line[2].rstrip(":")==b: unique_files.append(line[2].rstrip(":")+line[3]) #Feed the different files to compare_images From 86635dc974a28bbdd909db50dbaaf14e48e89495 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 11:55:36 +0300 Subject: [PATCH 044/341] warning for unique files (testing) --- testpackage/run_compare.sh | 1 - testpackage/testpackage_compare.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index af957ec6..42345103 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -13,6 +13,5 @@ if [[ $output == "" ]]; then exit 0 else echo "$output" - exit 1 fi diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index f3740646..fd48f8b1 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -1,6 +1,7 @@ import subprocess import time as timetime import os +import sys from argparse import ArgumentParser @@ -59,6 +60,8 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): cmd = f'diff -r {a} {b}' proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) out,err = proc.communicate() + unique=False + different=False #If errors, raise an exception if err: err = str(err,'utf-8') @@ -81,6 +84,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: if(not compare_images(file,file.replace(a,b))): + different=True filename = file.split("/")[-1].rstrip(".png") #is it always png? cmd = f"compare -metric RMSE {file} {file.replace(a,b)} {output_folder}/difference_output_{filename}.png" @@ -106,6 +110,10 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): for file in unique_files: print("Unique file:",file) + if len(unique_files)!=0: + print("::warning title=Unique file(s)::Found new file(s) produced by the code") + if different: + sys.exit(1) compare_images_in_folders(a,b,output_folder) From aac4e2ba359c8025fb1baa015a2f3b55d1b7e902 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 14:35:58 +0300 Subject: [PATCH 045/341] compare images proper errorcode output and general rewriting --- testpackage/testpackage_compare.py | 39 ++++++++++++------------------ 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index fd48f8b1..e66e1dcd 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -6,15 +6,19 @@ -def compare_images(a,b): - cmd = f'magick compare -metric RMSE {a} {b} NULL:' +def compare_images(a,b,output_file="NULL:"): + + cmd = f"magick compare -metric RMSE {a} {b} {output_file}" proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) + out,err = proc.communicate() - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) + exitcode=proc.returncode + print(exitcode) + #If errors, raise an exception (This has to be odne like this as compare sends output to stderr) + if exitcode!=0 and exitcode != 1: + out = str(out,'utf-8') + raise RuntimeError(out) out = str(out,'utf-8') out=out.strip('\n') @@ -60,7 +64,6 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): cmd = f'diff -r {a} {b}' proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) out,err = proc.communicate() - unique=False different=False #If errors, raise an exception if err: @@ -85,25 +88,15 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): for file in different_files: if(not compare_images(file,file.replace(a,b))): different=True - filename = file.split("/")[-1].rstrip(".png") #is it always png? - cmd = f"compare -metric RMSE {file} {file.replace(a,b)} {output_folder}/difference_output_{filename}.png" - if output_folder=='NULL:': - cmd = cmd.replace(f"{output_folder}/difference_output_{filename}.png","NULL:") + if output_folder!= "NULL:": + filename = file.split("/")[-1].rstrip(".png") #is it always png? + output_folder=output_folder+f"/difference_output_{filename}.png" - proc = subprocess.run(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) - print("Images differ:",file,file.replace(a,b)) + compare_images(file,file.replace(a,b),output_folder) - # The error handling doesnt work, the compare sends the result to stderr also, so that's just great - ''' - out,err = proc.stdout,proc.stderr - print(out,err) + print("Images differ:",file,file.replace(a,b)) - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) - ''' #Print unique files @@ -113,7 +106,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if len(unique_files)!=0: print("::warning title=Unique file(s)::Found new file(s) produced by the code") if different: - sys.exit(1) + raise SystemError("Images Differ") compare_images_in_folders(a,b,output_folder) From 9b3db92380f4f1d7e3be7da8534d034072046f8b Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 15:08:49 +0300 Subject: [PATCH 046/341] error output tetsing --- testpackage/run_testpackage_colormap_workflow.sh | 3 ++- testpackage/testpackage_compare.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index a2a0eaf5..c673d870 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -33,6 +33,7 @@ export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -python ./testpackage/testpackage_colormap.py $jobcount $index +#python ./testpackage/testpackage_colormap.py $jobcount $index +python ./testpackage/color_small_test.py echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index e66e1dcd..3a9feda1 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -104,9 +104,9 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): print("Unique file:",file) if len(unique_files)!=0: - print("::warning title=Unique file(s)::Found new file(s) produced by the code") + print("::warning title=Unique file(s)::Found new file(s) produced by the code!") if different: - raise SystemError("Images Differ") + print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") compare_images_in_folders(a,b,output_folder) From ce28fe158485bd24a7a03d4734d5568658402ce0 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 15:12:15 +0300 Subject: [PATCH 047/341] more testing --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- testpackage/testpackage_compare.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index c673d870..dbcac355 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -34,6 +34,6 @@ export PTOUTPUTDIR=$PWD/produced_plots/ #python ./testpackage/testpackage_colormap.py $jobcount $index -python ./testpackage/color_small_test.py +python ./testpackage/color_small_test.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 3a9feda1..742b0975 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -107,6 +107,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): print("::warning title=Unique file(s)::Found new file(s) produced by the code!") if different: print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") + raise SystemError("Images Differ") compare_images_in_folders(a,b,output_folder) From 9c6d3ae0d207eb9a42c1f01d0e3f5d00d7fad6c4 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 15:21:35 +0300 Subject: [PATCH 048/341] test --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 42345103..d0a488aa 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -5,7 +5,7 @@ #verification set is from: 6.10.2025 folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" -output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) +output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1 || exit 1) if [[ $output == "" ]]; then From c34590a66d853d6285f8e094bbf754d0825c459d Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 15:38:40 +0300 Subject: [PATCH 049/341] sigh --- testpackage/run_compare.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index d0a488aa..76babafc 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -5,13 +5,15 @@ #verification set is from: 6.10.2025 folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" -output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1 || exit 1) +python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} +#output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) -if [[ $output == "" ]]; then - echo "No differences found" - exit 0 -else - echo "$output" -fi + +#if [[ $output == "" ]]; then +# echo "No differences found" +# exit 0 +#else +# echo "$output" +#fi From acd287e21c92a9762beac8617e633e94feb05fc9 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 15:58:12 +0300 Subject: [PATCH 050/341] test --- testpackage/run_compare.sh | 13 +------------ testpackage/testpackage_compare.py | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 76babafc..22fafb9b 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -5,15 +5,4 @@ #verification set is from: 6.10.2025 folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" folder_2="${PWD}/produced_plots/" -python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} - -#output=$((python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2}) 2>&1) - - -#if [[ $output == "" ]]; then -# echo "No differences found" -# exit 0 -#else -# echo "$output" -#fi - +python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found" diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 742b0975..9dc35ee8 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -14,7 +14,7 @@ def compare_images(a,b,output_file="NULL:"): out,err = proc.communicate() exitcode=proc.returncode - print(exitcode) + #If errors, raise an exception (This has to be odne like this as compare sends output to stderr) if exitcode!=0 and exitcode != 1: out = str(out,'utf-8') From 63bc3c2562b22844cc19da3e41ab757bf7d03918 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 7 Oct 2025 16:02:28 +0300 Subject: [PATCH 051/341] changed into the full test and added extra time for timeout, now 45 mins --- .github/workflows/test_compare_colourmap_images.yml | 2 +- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 66e66c66..e7baddd0 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -17,7 +17,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: carrington - timeout-minutes: 30 + timeout-minutes: 45 strategy: fail-fast: false matrix: diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index dbcac355..1618feaf 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -33,7 +33,7 @@ export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/produced_plots/ -#python ./testpackage/testpackage_colormap.py $jobcount $index -python ./testpackage/color_small_test.py $jobcount $index +python ./testpackage/testpackage_colormap.py $jobcount $index +#python ./testpackage/color_small_test.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. From 0904e4c98d71e57bbe36e69ed79911a07b10e10c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 8 Oct 2025 10:01:46 +0300 Subject: [PATCH 052/341] code cleanup --- testpackage/testpackage_compare.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 9dc35ee8..b2bc9da3 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -86,15 +86,12 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: - if(not compare_images(file,file.replace(a,b))): - different=True - - if output_folder!= "NULL:": - filename = file.split("/")[-1].rstrip(".png") #is it always png? - output_folder=output_folder+f"/difference_output_{filename}.png" - - compare_images(file,file.replace(a,b),output_folder) + if output_folder!= "NULL:": + filename = file.split("/")[-1].rstrip(".png") #is it always png? + output_folder=output_folder+f"/difference_output_{filename}.png" + if(not compare_images(file,file.replace(a,b),output_folder)): + different=True print("Images differ:",file,file.replace(a,b)) From 1edb93cd816cacc2856cfdfbfdc69e79a3da13e3 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:06:26 +0300 Subject: [PATCH 053/341] added fixfigsize parameter to mostly fix the output resolution of the image for use better use with ImageMagick compare. Note that noborder=1 may undo this. --- analysator/pyPlots/plot_vdf.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index bfc06a8b..36654e1a 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -427,7 +427,7 @@ def plot_vdf(filename=None, biglabel=None, biglabloc=None, noxlabels=None, noylabels=None, axes=None, cbaxes=None, - contours=None + contours=None,fixfigsize=False ): ''' Plots a coloured 2D plot of a VDF (a slice of given thickness or fully projected) with axes and a colour bar. @@ -521,7 +521,7 @@ def plot_vdf(filename=None, :kword scale_cb: Colour bar text additional scale factor (default=5.0) :kword scale_label: Big label text additional scale factor (default=12.0) :kword thick: line and axis thickness, default=1.0 - + :kword fixfigsize Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. This should not be used with noborder, as it may undo it. :returns: Outputs an image to a file or to the screen. @@ -1140,9 +1140,21 @@ def plot_vdf(filename=None, [XmeshXY,YmeshXY] = np.meshgrid(edgesX/velUnit,edgesY/velUnit) # Generates the mesh to map the data to if axes is None: - # Create 300 dpi image of suitable size - fig = plt.figure(figsize=figsize,dpi=300) - ax1 = plt.gca() # get current axes + if fixfigsize is not None: + #Matplotlib jank, it noborder changed the imagesize even though you'd think insetting would work + #it did fix the size if inset was something weird like [0.5,0.5,0.5,0.5] *shrug* + + if noborder: + logging.warning("noborder and fixfigsize enabled, this may undo effects of fixfigsize") + fig = plt.figure(figsize=[5,4],dpi=300) + axm=plt.gca() + axm.axis('off') + ax1 = axm.inset_axes([0.05,0.05,0.9,0.9]) + else: + # Create 300 dpi image of suitable size + fig = plt.figure(figsize=figsize,dpi=300) + ax1 = plt.gca() # get current axes + else: ax1=axes fig1 = ax1.pcolormesh(XmeshXY,YmeshXY,binsXY, cmap=colormap,norm=norm) From 0951f7c7bdc1215e3652a4a06b6c802638e6628d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:14:46 +0300 Subject: [PATCH 054/341] docstring formatting --- analysator/pyPlots/plot_vdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index 36654e1a..9f3fea21 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -521,7 +521,8 @@ def plot_vdf(filename=None, :kword scale_cb: Colour bar text additional scale factor (default=5.0) :kword scale_label: Big label text additional scale factor (default=12.0) :kword thick: line and axis thickness, default=1.0 - :kword fixfigsize Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. This should not be used with noborder, as it may undo it. + :kword fixfigsize Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. + This should not be used with noborder, as it may undo it. :returns: Outputs an image to a file or to the screen. From f1142ff715bec136ad977be3a91658a869df9b75 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:18:04 +0300 Subject: [PATCH 055/341] trying to fix the parameter kwords for sphinx --- analysator/pyPlots/plot_vdf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index 9f3fea21..fd498806 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -523,7 +523,6 @@ def plot_vdf(filename=None, :kword thick: line and axis thickness, default=1.0 :kword fixfigsize Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. This should not be used with noborder, as it may undo it. - :returns: Outputs an image to a file or to the screen. .. code-block:: python From 634b5ed7ae3dced1f51004e8692971480955d6bc Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:19:21 +0300 Subject: [PATCH 056/341] fixed now, missing : --- analysator/pyPlots/plot_vdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index fd498806..6609c9c8 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -521,8 +521,9 @@ def plot_vdf(filename=None, :kword scale_cb: Colour bar text additional scale factor (default=5.0) :kword scale_label: Big label text additional scale factor (default=12.0) :kword thick: line and axis thickness, default=1.0 - :kword fixfigsize Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. + :kword fixfigsize: Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. This should not be used with noborder, as it may undo it. + :returns: Outputs an image to a file or to the screen. .. code-block:: python From 51017c6265508a7935ee6f970079b4ddeb75614d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:27:08 +0300 Subject: [PATCH 057/341] set maximum parallel jobs to 1 --- .github/workflows/test_compare_colourmap_images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index e7baddd0..511cce80 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -20,6 +20,7 @@ jobs: timeout-minutes: 45 strategy: fail-fast: false + max-parallel: 1 matrix: extras: ["all"] steps: From 5fbcc7921e4999c5cc7baa99cc4abc39f85e69a8 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:36:53 +0300 Subject: [PATCH 058/341] changed max parallel to 2, changed so run is only run when a PR is opened, reopened or converted to a drafe so you can manually somewhat make it run instead of clogging up the server. --- .github/workflows/test_compare_colourmap_images.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 511cce80..bc0c86f0 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -5,9 +5,10 @@ name: Turso compare colourmap images on: push: - branches: [ master, dev, image_compare] + branches: [ master, dev ] pull_request: - branches: [ master, dev, image_compare] + branches: [ master, dev,image_compare ] + types: [opened, reopened,converted_to_draft] schedule: - cron: '0 8 * * MON' workflow_dispatch: @@ -20,7 +21,7 @@ jobs: timeout-minutes: 45 strategy: fail-fast: false - max-parallel: 1 + max-parallel: 2 matrix: extras: ["all"] steps: From 0860d7b4bcd73cdcbe4d6e86d6f106453fc6fc43 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 16:46:35 +0300 Subject: [PATCH 059/341] Revert "changed max parallel to 2, changed so run is only run when a PR is opened, reopened or converted to a drafe so you can manually somewhat make it run instead of clogging up the server." --- .github/workflows/test_compare_colourmap_images.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index bc0c86f0..511cce80 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -5,10 +5,9 @@ name: Turso compare colourmap images on: push: - branches: [ master, dev ] + branches: [ master, dev, image_compare] pull_request: - branches: [ master, dev,image_compare ] - types: [opened, reopened,converted_to_draft] + branches: [ master, dev, image_compare] schedule: - cron: '0 8 * * MON' workflow_dispatch: @@ -21,7 +20,7 @@ jobs: timeout-minutes: 45 strategy: fail-fast: false - max-parallel: 2 + max-parallel: 1 matrix: extras: ["all"] steps: From 155f269becacb255b066d85368f5db98e57398ca Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 17:01:12 +0300 Subject: [PATCH 060/341] Changed so only 1 run per PR and cancel previous runs in that PR, also changed max-parallel to 2 for good measure --- .github/workflows/test_compare_colourmap_images.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_colourmap_images.yml index 511cce80..ff7adfca 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_colourmap_images.yml @@ -12,6 +12,10 @@ on: - cron: '0 8 * * MON' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: turso_system: @@ -20,7 +24,7 @@ jobs: timeout-minutes: 45 strategy: fail-fast: false - max-parallel: 1 + max-parallel: 2 matrix: extras: ["all"] steps: From 183c779545aa79b68ca10e9ec64ea648237e594e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 17:36:52 +0300 Subject: [PATCH 061/341] added vdf plotting to the image compare, modified run_compare.sh to take in one argument for the folder name, renamed workflow file to reflect that vdf was added to it. --- ...map_images.yml => test_compare_images.yml} | 24 +++++++++++- testpackage/run_compare.sh | 2 +- .../run_testpackage_colormap_workflow.sh | 4 +- testpackage/run_testpackage_vdf_workflow.sh | 39 +++++++++++++++++++ 4 files changed, 64 insertions(+), 5 deletions(-) rename .github/workflows/{test_compare_colourmap_images.yml => test_compare_images.yml} (69%) create mode 100755 testpackage/run_testpackage_vdf_workflow.sh diff --git a/.github/workflows/test_compare_colourmap_images.yml b/.github/workflows/test_compare_images.yml similarity index 69% rename from .github/workflows/test_compare_colourmap_images.yml rename to .github/workflows/test_compare_images.yml index ff7adfca..e1f8042d 100644 --- a/.github/workflows/test_compare_colourmap_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -40,7 +40,7 @@ jobs: uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] - - name: Produce plots + - name: Produce colormap plots run: | export TMPDIR=$RUNNER_TEMP @@ -57,4 +57,24 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ../analysator/testpackage/run_compare.sh + ../analysator/testpackage/run_compare.sh testpackage_colormap + + - name: Produce vdf plots + run: | + export TMPDIR=$RUNNER_TEMP + + + sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh + cat testpackage_vdf_run.txt + module purge + module load Python/3.10.4-GCCcore-11.3.0 + python ./testpackage/testpackage_get_job_error.py testpackage_vdf_run.txt + + - name: Comparing plotted data + run: | + export TMPDIR=$RUNNER_TEMP + module load Python/3.10.4-GCCcore-11.3.0 + module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + . CI_env/bin/activate + ../analysator/testpackage/run_compare.sh testpackage_vdf + diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 22fafb9b..bf2a0abe 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -3,6 +3,6 @@ #verification set is from: 6.10.2025 -folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/" +folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/$1/" folder_2="${PWD}/produced_plots/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found" diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 1618feaf..fa2079a9 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -27,10 +27,10 @@ source CI_env/bin/activate module list -mkdir -p $PWD/produced_plots +mkdir -p $PWD/produced_plots/testpackage_colormap export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/produced_plots/ +export PTOUTPUTDIR=$PWD/produced_plots/testpackage_colormap/ python ./testpackage/testpackage_colormap.py $jobcount $index diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh new file mode 100755 index 00000000..026e72cf --- /dev/null +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -0,0 +1,39 @@ +#!/bin/bash -l +#SBATCH -t 00:30:00 +#SBATCH -J analysator_testpackage +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=1-4 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + + +#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + + +hostname + + +module purge +export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH +module load Python/3.10.4-GCCcore-11.3.0 +module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + + + +source CI_env/bin/activate + +module list + +mkdir -p $PWD/produced_plots/testpackage_vdf + +export PTNONINTERACTIVE=1 +export PTOUTPUTDIR=$PWD/produced_plots/testpackage_vdf/ + + +python ./testpackage/testpackage_vdf.py $jobcount $index +#python ./testpackage/color_small_test.py $jobcount $index +echo "EXIT_CODE_FROM_JOB $?" +#echo Job $SLURM_ARRAY_TASK_ID complete. From 5624ecfebbc2594e0cb5dbda705ee1b9461c2b15 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 17:47:34 +0300 Subject: [PATCH 062/341] added path given by arg to folder_2 --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index bf2a0abe..cb66f95f 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -4,5 +4,5 @@ #verification set is from: 6.10.2025 folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/$1/" -folder_2="${PWD}/produced_plots/" +folder_2="${PWD}/produced_plots/$1/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found" From 0879e6f13887376ed88513e1164d28a6ac424baa Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 17:54:31 +0300 Subject: [PATCH 063/341] trying to copy the scancel snippet from vlasiator github-ci.yml --- .github/workflows/test_compare_images.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index e1f8042d..b81cc368 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -77,4 +77,8 @@ jobs: module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate ../analysator/testpackage/run_compare.sh testpackage_vdf - + - name: scancel dangling job upon cancellation + if: cancelled() + run: | + scancel ${{ steps.run.outputs.SLURM_JOB_ID }} + From a8708df1a08a007aea7e424b81a4946d5cdbdcc9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 18:01:19 +0300 Subject: [PATCH 064/341] empty push to test cancelling --- .github/workflows/test_compare_images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index b81cc368..0afa0836 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -16,6 +16,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: turso_system: From 6ccf0ae6de4ae453c68a22a5088f3dbea218274a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 14 Oct 2025 18:14:54 +0300 Subject: [PATCH 065/341] bandaid solution for job cancelling --- .github/workflows/test_compare_images.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 0afa0836..1bb96c8d 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -46,7 +46,8 @@ jobs: export TMPDIR=$RUNNER_TEMP - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt + export SLURM_JOB_ID=$(cat temp_file.txt) cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -81,5 +82,5 @@ jobs: - name: scancel dangling job upon cancellation if: cancelled() run: | - scancel ${{ steps.run.outputs.SLURM_JOB_ID }} + scancel $SLURM_JOB_ID From fc3280742786eacd4f27be0f95c46e9c1852b9ff Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:12:50 +0300 Subject: [PATCH 066/341] added fixfigsize to testpackage vdf --- testpackage/testpackage_vdf.py | 178 ++++++++++++++++----------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/testpackage/testpackage_vdf.py b/testpackage/testpackage_vdf.py index 2f766a48..a4bd0c0a 100644 --- a/testpackage/testpackage_vdf.py +++ b/testpackage/testpackage_vdf.py @@ -43,131 +43,131 @@ regularcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_vdf(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", # cellids, coordinates -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", # Thickness, scale -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", # Tick interval -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", # msec musec titles -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", # B vector -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", # Zoom and units -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", # Watermarks -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", # Biglabels -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", # title, axes, noborders -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", # slicethick -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", # cellsize -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", # fmin, fmax, setThreshold -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", # colormaps -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", # cbulk, center, bvector -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", # wflux -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", # directions -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", ] multipopcalls = [ -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] +"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] From ba040847d7144475b3f620d362e37f3cd94f63ca Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:26:10 +0300 Subject: [PATCH 067/341] added cancel to vdf also and a check if the variables are set --- .github/workflows/test_compare_images.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 1bb96c8d..29201419 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -47,7 +47,7 @@ jobs: sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt - export SLURM_JOB_ID=$(cat temp_file.txt) + export SLURM_JOB_ID_COLORMAP=$(cat temp_file.txt) cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -66,7 +66,9 @@ jobs: export TMPDIR=$RUNNER_TEMP - sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh + sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh | grep -Po '\d+$' > temp_file.txt + export SLURM_JOB_ID_VDF=$(cat temp_file.txt) + cat testpackage_vdf_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -82,5 +84,12 @@ jobs: - name: scancel dangling job upon cancellation if: cancelled() run: | - scancel $SLURM_JOB_ID + #check if variables are set and try to scancel + + if [[ -v SLURM_JOB_ID_VDF ]]; then + scancel $SLURM_JOB_ID_VDF + fi + if [[ -v SLURM_JOB_ID_COLORMAP ]]; then + scancel $SLURM_JOB_ID_COLORMAP + fi From 752cbd99824b263177ab866e26c1bae4ba64fc3f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:40:24 +0300 Subject: [PATCH 068/341] added environment variables to workflow --- .github/workflows/test_compare_images.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 29201419..d5f3db9f 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -48,6 +48,7 @@ jobs: sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt export SLURM_JOB_ID_COLORMAP=$(cat temp_file.txt) + echo "Submitted job $SLURM_JOB_ID_COLORMAP" cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -68,7 +69,7 @@ jobs: sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh | grep -Po '\d+$' > temp_file.txt export SLURM_JOB_ID_VDF=$(cat temp_file.txt) - + echo "Submitted job $SLURM_JOB_ID_VDF" cat testpackage_vdf_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -85,7 +86,8 @@ jobs: if: cancelled() run: | #check if variables are set and try to scancel - + echo $SLURM_JOB_ID_COLORMAP + echo $SLURM_JOB_ID_VDF if [[ -v SLURM_JOB_ID_VDF ]]; then scancel $SLURM_JOB_ID_VDF fi From 3da883c1a7c73ec9ad00d4c37d0b8b58ba9555cf Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:54:07 +0300 Subject: [PATCH 069/341] workflow shenanigans to get it to cancel --- .github/workflows/test_compare_images.yml | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index d5f3db9f..839bb61d 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -16,6 +16,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +env: + SLURM_JOB_ID_COLORMAP: + SLURM_JOB_ID_VDF: jobs: @@ -42,13 +45,14 @@ jobs: . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] - name: Produce colormap plots + id: run_color run: | export TMPDIR=$RUNNER_TEMP sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt - export SLURM_JOB_ID_COLORMAP=$(cat temp_file.txt) - echo "Submitted job $SLURM_JOB_ID_COLORMAP" + echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT + echo "Submitted job ${{ steps.run_color.SLURM_JOB_ID }}" cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -63,13 +67,14 @@ jobs: ../analysator/testpackage/run_compare.sh testpackage_colormap - name: Produce vdf plots + id: run_vdf run: | export TMPDIR=$RUNNER_TEMP sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh | grep -Po '\d+$' > temp_file.txt - export SLURM_JOB_ID_VDF=$(cat temp_file.txt) - echo "Submitted job $SLURM_JOB_ID_VDF" + echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT + echo "Submitted job ${{ steps.run_vdf.SLURM_JOB_ID }}" cat testpackage_vdf_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -86,12 +91,12 @@ jobs: if: cancelled() run: | #check if variables are set and try to scancel - echo $SLURM_JOB_ID_COLORMAP - echo $SLURM_JOB_ID_VDF - if [[ -v SLURM_JOB_ID_VDF ]]; then - scancel $SLURM_JOB_ID_VDF + + if [[ -v {{ steps.run_color.SLURM_JOB_ID }} ]]; then + scancel ${{ steps.run_color.SLURM_JOB_ID }} + fi - if [[ -v SLURM_JOB_ID_COLORMAP ]]; then - scancel $SLURM_JOB_ID_COLORMAP + if [[ -v {{ steps.run_vdf.SLURM_JOB_ID }} ]]; then + scancel ${{ steps.run_vdf.SLURM_JOB_ID }} fi From 4ee115e8d05c71c22f32d1970273802569d4a285 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:56:37 +0300 Subject: [PATCH 070/341] removed unused env: vars in workflow --- .github/workflows/test_compare_images.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 839bb61d..dba792d5 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -16,10 +16,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} -env: - SLURM_JOB_ID_COLORMAP: - SLURM_JOB_ID_VDF: - jobs: turso_system: From 16b4fcfd3f5e880288248dd2bc9b2de9393a294b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 09:57:45 +0300 Subject: [PATCH 071/341] syntax error in if scancel step remoed whole if --- .github/workflows/test_compare_images.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index dba792d5..42889cd0 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -88,11 +88,8 @@ jobs: run: | #check if variables are set and try to scancel - if [[ -v {{ steps.run_color.SLURM_JOB_ID }} ]]; then - scancel ${{ steps.run_color.SLURM_JOB_ID }} + scancel ${{ steps.run_color.SLURM_JOB_ID }} + + scancel ${{ steps.run_vdf.SLURM_JOB_ID }} - fi - if [[ -v {{ steps.run_vdf.SLURM_JOB_ID }} ]]; then - scancel ${{ steps.run_vdf.SLURM_JOB_ID }} - fi From 379745c7e65cff3972ed48a5bc2a84748a84860c Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:01:05 +0300 Subject: [PATCH 072/341] removed echo as it comes after sbatch and it waits --- .github/workflows/test_compare_images.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 42889cd0..7463d82f 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -48,7 +48,6 @@ jobs: sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT - echo "Submitted job ${{ steps.run_color.SLURM_JOB_ID }}" cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -70,7 +69,6 @@ jobs: sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh | grep -Po '\d+$' > temp_file.txt echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT - echo "Submitted job ${{ steps.run_vdf.SLURM_JOB_ID }}" cat testpackage_vdf_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 From 99a77746f599f04628dca2617da023be56a471a1 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:02:38 +0300 Subject: [PATCH 073/341] workaround to remove the hanging jobs and also testing whether it cancels properly --- .github/workflows/test_compare_images.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 7463d82f..76a66f39 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,6 +33,10 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | + scancel 276963031 + scancel 276963014 + scancel 276963009 + export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge From 55e008ed9e0fd63c39044f938d83c8af7bf614e5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:07:11 +0300 Subject: [PATCH 074/341] even more testing --- .github/workflows/test_compare_images.yml | 12 +++++------- testpackage/run_testpackage_colormap_workflow.sh | 1 + testpackage/run_testpackage_vdf_workflow.sh | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 76a66f39..e45183b4 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,9 +33,9 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - scancel 276963031 - scancel 276963014 - scancel 276963009 + scancel 276963042 + scancel 276963035 + export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy @@ -50,8 +50,7 @@ jobs: export TMPDIR=$RUNNER_TEMP - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh | grep -Po '\d+$' > temp_file.txt - echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 @@ -71,8 +70,7 @@ jobs: export TMPDIR=$RUNNER_TEMP - sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh | grep -Po '\d+$' > temp_file.txt - echo "SLURM_JOB_ID=$(cat temp_file.txt)" >> $GITHUB_OUTPUT + sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh cat testpackage_vdf_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index fa2079a9..430d5853 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -22,6 +22,7 @@ module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 +echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 026e72cf..72cd8004 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -21,6 +21,7 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 +echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate From e003296b3b7380fa242d419f54cbff72256b38d5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:09:15 +0300 Subject: [PATCH 075/341] test to see if the job cancel FINALLY works --- .github/workflows/test_compare_images.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index e45183b4..eef8211d 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,8 +33,7 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - scancel 276963042 - scancel 276963035 + export TMPDIR=$RUNNER_TEMP From 836b531903a4e729009969ba13c2d85e2e830241 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:12:53 +0300 Subject: [PATCH 076/341] found the typo in cancel --- .github/workflows/test_compare_images.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index eef8211d..1ce290c0 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -34,7 +34,8 @@ jobs: - name: Install dependencies run: | - + scancel 276963046 + scancel 276963051 export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy @@ -87,8 +88,8 @@ jobs: run: | #check if variables are set and try to scancel - scancel ${{ steps.run_color.SLURM_JOB_ID }} + scancel ${{ steps.run_color.outputs.SLURM_JOB_ID }} - scancel ${{ steps.run_vdf.SLURM_JOB_ID }} + scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID }} From 4998d9b29f603d10c55e8a635073d9aecd08512a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:14:37 +0300 Subject: [PATCH 077/341] scancel should finally work, testing --- .github/workflows/test_compare_images.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 1ce290c0..272bf247 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,10 +33,7 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - - scancel 276963046 - scancel 276963051 - + export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge From dde02549c6f078584d0db18ecb80cc6219faac65 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:18:52 +0300 Subject: [PATCH 078/341] banging head against the wall with this --- .github/workflows/test_compare_images.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 272bf247..ea49b0e3 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,7 +33,7 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - + export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge @@ -85,8 +85,8 @@ jobs: run: | #check if variables are set and try to scancel - scancel ${{ steps.run_color.outputs.SLURM_JOB_ID }} + scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} - scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID }} + scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} From a5e219b69cddc65a04491be1cafaa89ccee788b2 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:25:13 +0300 Subject: [PATCH 079/341] added back if to test and appended 1 and 2 to the env vars --- .github/workflows/test_compare_images.yml | 12 +++++++----- testpackage/run_testpackage_colormap_workflow.sh | 2 +- testpackage/run_testpackage_vdf_workflow.sh | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index ea49b0e3..6c912736 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -84,9 +84,11 @@ jobs: if: cancelled() run: | #check if variables are set and try to scancel - - scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} - - scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} - + if [[ -v ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} ]]; then + scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} + fi + if [[ -v ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} ]]; then + scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} + fi + diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 430d5853..1b10bb9e 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -22,7 +22,7 @@ module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT +echo "SLURM_JOB_ID1=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 72cd8004..72f4f3d6 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -21,7 +21,7 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT +echo "SLURM_JOB_ID2=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate From ab60384906da3b66088173e597cd5cee5abde4f9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:28:33 +0300 Subject: [PATCH 080/341] the workflow stubbornly refuses to work as intentded --- .github/workflows/test_compare_images.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 6c912736..0dd947c0 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,7 +33,8 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - + scancel 276963064 + scancel 276963055 export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge From e9e6a6486e86097e3a10c94d5655367a0b7ebc6e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:33:17 +0300 Subject: [PATCH 081/341] removed the if statement as it doesnt work, need to recheck later --- .github/workflows/test_compare_images.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 0dd947c0..a7bac9f6 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -84,12 +84,8 @@ jobs: - name: scancel dangling job upon cancellation if: cancelled() run: | - #check if variables are set and try to scancel - if [[ -v ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} ]]; then - scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} - fi - if [[ -v ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} ]]; then - scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} - fi + #check if variables are set and try to scancel/need to add IF here somehow..... + scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} + scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} From 907fab6401ef59da028ef92b98445d9558f46b28 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 15 Oct 2025 10:54:47 +0300 Subject: [PATCH 082/341] updated info on verf. set --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index cb66f95f..e12bd142 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -2,7 +2,7 @@ -#verification set is from: 6.10.2025 +#verification set is from: 6.10.2025 (vdf 15.10.2025 from image_compare branch) folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/$1/" folder_2="${PWD}/produced_plots/$1/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found" From e8b197e2e729f5b415664af815308639b9222cb0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 14:45:02 +0300 Subject: [PATCH 083/341] test --- .github/workflows/test_compare_images.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index a7bac9f6..cbd442f8 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -33,8 +33,6 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - scancel 276963064 - scancel 276963055 export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge From 9c63ea400455019dd773c6e1dfa13adca1aecd4b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 15:00:40 +0300 Subject: [PATCH 084/341] more testing --- .github/workflows/test_compare_images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index cbd442f8..94938fe8 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -47,6 +47,7 @@ jobs: sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh + echo ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 From e527ba19b3c9294acffbd6c7b0082138b4efff8a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 15:56:01 +0300 Subject: [PATCH 085/341] testing --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 94938fe8..fc37d301 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -20,7 +20,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' - runs-on: carrington + runs-on: turso-carrington timeout-minutes: 45 strategy: fail-fast: false From 533369bf2c7e5cb5d99ff35be596d899fb15fa8a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 15:59:04 +0300 Subject: [PATCH 086/341] testing new runner --- .github/workflows/test_compare_images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index fc37d301..454b4873 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -16,6 +16,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: turso_system: From c1a97a9ded6b49aa5e8571bdb70767f923bbd6ee Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 16:02:49 +0300 Subject: [PATCH 087/341] test --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 454b4873..6cd51cfc 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -21,7 +21,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' - runs-on: turso-carrington + runs-on: turso-carrington-lasse timeout-minutes: 45 strategy: fail-fast: false From abf7251c86f9ddbd908f51a55fe0f8b1ca23ecd1 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 16:25:14 +0300 Subject: [PATCH 088/341] changed label so i can test it on the new runner --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 6cd51cfc..160573bf 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -21,7 +21,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' - runs-on: turso-carrington-lasse + runs-on: linux #carrington timeout-minutes: 45 strategy: fail-fast: false From 90d41e7fc32a4b6a6a84b21bbec0f2c6fb9acd6e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 16:32:15 +0300 Subject: [PATCH 089/341] testing if cancel works --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 160573bf..fb779194 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -22,7 +22,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: linux #carrington - timeout-minutes: 45 + timeout-minutes: 46 strategy: fail-fast: false max-parallel: 2 From b7f65ac0c569dbfd11e0f0284c8a7de2d4bdffbb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 16:43:00 +0300 Subject: [PATCH 090/341] testadoo --- testpackage/run_testpackage_colormap_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 1b10bb9e..538916cc 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -21,7 +21,7 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - +echo "SLURM_JOB_ID1=$SLURM_JOB_ID" echo "SLURM_JOB_ID1=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate From f54d8464673cb83047586a814efcdaafa8f3cc97 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 17:16:52 +0300 Subject: [PATCH 091/341] cancel should now work --- .github/workflows/test_compare_images.yml | 3 ++- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index fb779194..cdc887cf 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -47,7 +47,8 @@ jobs: export TMPDIR=$RUNNER_TEMP - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh + sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh + echo ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} cat testpackage_colormap_run.txt module purge diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 538916cc..84b9ed46 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -21,8 +21,8 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -echo "SLURM_JOB_ID1=$SLURM_JOB_ID" -echo "SLURM_JOB_ID1=$SLURM_JOB_ID" >> $GITHUB_OUTPUT +echo "SLURM_JOB_ID1=$SLURM_ARRAY_JOB_ID" +echo "SLURM_JOB_ID1=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate From f8e60ec544d9f381396a5afe3fd3b0dce000e33c Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 17:19:50 +0300 Subject: [PATCH 092/341] now everything should be butter --- .github/workflows/test_compare_images.yml | 3 +-- testpackage/run_testpackage_colormap_workflow.sh | 3 +-- testpackage/run_testpackage_vdf_workflow.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index cdc887cf..6198b939 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -86,7 +86,6 @@ jobs: if: cancelled() run: | #check if variables are set and try to scancel/need to add IF here somehow..... - scancel ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} - scancel ${{ steps.run_vdf.outputs.SLURM_JOB_ID2 }} + scancel ${{ steps.run_color.outputs.SLURM_JOB_ID }} diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index 84b9ed46..c6596529 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -21,8 +21,7 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -echo "SLURM_JOB_ID1=$SLURM_ARRAY_JOB_ID" -echo "SLURM_JOB_ID1=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT +echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 72f4f3d6..72cd8004 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -21,7 +21,7 @@ export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -echo "SLURM_JOB_ID2=$SLURM_JOB_ID" >> $GITHUB_OUTPUT +echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate From e749f83985164c4f16e4ce683bd634311e054d6b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 16 Oct 2025 17:38:27 +0300 Subject: [PATCH 093/341] ye --- .github/workflows/test_compare_images.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 6198b939..e780a193 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -85,7 +85,6 @@ jobs: - name: scancel dangling job upon cancellation if: cancelled() run: | - #check if variables are set and try to scancel/need to add IF here somehow..... scancel ${{ steps.run_color.outputs.SLURM_JOB_ID }} From 28fa576b686953b8b43b249b638eef6a09e7af90 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 10:36:08 +0300 Subject: [PATCH 094/341] testing whether the folder structure is correct now --- testpackage/run_testpackage_colormap_workflow.sh | 4 ++-- testpackage/run_testpackage_vdf_workflow.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh index c6596529..811b2de3 100755 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ b/testpackage/run_testpackage_colormap_workflow.sh @@ -27,10 +27,10 @@ source CI_env/bin/activate module list -mkdir -p $PWD/produced_plots/testpackage_colormap +mkdir -p $PWD/produced_plots/ export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/produced_plots/testpackage_colormap/ +export PTOUTPUTDIR=$PWD/produced_plots/ python ./testpackage/testpackage_colormap.py $jobcount $index diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 72cd8004..3cceef03 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -28,10 +28,10 @@ source CI_env/bin/activate module list -mkdir -p $PWD/produced_plots/testpackage_vdf +mkdir -p $PWD/produced_plots/ export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/produced_plots/testpackage_vdf/ +export PTOUTPUTDIR=$PWD/produced_plots/ python ./testpackage/testpackage_vdf.py $jobcount $index From 6163d3450c4bf05f410fe6ef7ee26c82fa72374f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 10:39:08 +0300 Subject: [PATCH 095/341] test --- testpackage/run_testpackage_vdf_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 3cceef03..75f73458 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -27,7 +27,7 @@ echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate module list - + mkdir -p $PWD/produced_plots/ export PTNONINTERACTIVE=1 From 532c712530b786292ad3bb2cf6e988c440cd2b9c Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 10:51:53 +0300 Subject: [PATCH 096/341] runner was stuck *sigh* --- testpackage/run_testpackage_vdf_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 75f73458..3cceef03 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -27,7 +27,7 @@ echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate module list - + mkdir -p $PWD/produced_plots/ export PTNONINTERACTIVE=1 From 2e3a3106fbc34018801ce6aa56db3b38942a7ddb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 11:17:51 +0300 Subject: [PATCH 097/341] test --- testpackage/run_testpackage_vdf_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh index 3cceef03..75f73458 100755 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ b/testpackage/run_testpackage_vdf_workflow.sh @@ -27,7 +27,7 @@ echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT source CI_env/bin/activate module list - + mkdir -p $PWD/produced_plots/ export PTNONINTERACTIVE=1 From 34570d1959763134f015e5622a3d4277b5cff416 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 11:20:39 +0300 Subject: [PATCH 098/341] made couple paths more readable --- .github/workflows/test_compare_images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index e780a193..8f634a86 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -61,7 +61,7 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ../analysator/testpackage/run_compare.sh testpackage_colormap + ./testpackage/run_compare.sh testpackage_colormap - name: Produce vdf plots id: run_vdf @@ -81,7 +81,7 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ../analysator/testpackage/run_compare.sh testpackage_vdf + ./testpackage/run_compare.sh testpackage_vdf - name: scancel dangling job upon cancellation if: cancelled() run: | From c6a5f2ab76f9d0a45045bd818f48fc4bbaa01a33 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 11:21:17 +0300 Subject: [PATCH 099/341] changed back the runs-on to target runners with 'carrington' label --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 8f634a86..bbc39b72 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -21,7 +21,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' - runs-on: linux #carrington + runs-on: carrington timeout-minutes: 46 strategy: fail-fast: false From 5983736db22e09128338bec78b90d7ae6bb58cf1 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 12:29:55 +0300 Subject: [PATCH 100/341] added warning for missing files --- testpackage/testpackage_compare.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index b2bc9da3..4c0b8efe 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -74,6 +74,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): different_files=[] unique_files=[] + missing_files=[] out=out.splitlines() #Parse the output of diff @@ -81,8 +82,12 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): line=line.split(" ") if line[0]=="Binary" and line[1]=="files": different_files.append(line[2]) - elif line[0]=="Only" and line[2].rstrip(":")==b: - unique_files.append(line[2].rstrip(":")+line[3]) + elif line[0]=="Only": + if line[2].rstrip(":")==b: + unique_files.append(line[2].rstrip(":")+line[3]) + else: + missing_files.append(line[2].rstrip(":")+line[3]) + #Feed the different files to compare_images for file in different_files: @@ -102,6 +107,9 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if len(unique_files)!=0: print("::warning title=Unique file(s)::Found new file(s) produced by the code!") + if len(missing_files)!=0: + print("::warning title=Missing file(s)::Found file(s) **not** produced by the code!") + if different: print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") raise SystemError("Images Differ") From 22a8571ee3922f37a53e02fe93383eca07e35585 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 17 Oct 2025 13:10:33 +0300 Subject: [PATCH 101/341] Now prints the missing files --- testpackage/testpackage_compare.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 4c0b8efe..745cc58a 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -101,9 +101,12 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): - #Print unique files + #Print unique and missing files for file in unique_files: print("Unique file:",file) + for file in missing_files: + print("Missing file:",file) + if len(unique_files)!=0: print("::warning title=Unique file(s)::Found new file(s) produced by the code!") From 23948094971647bd2e3b657bd6a9d3bcd96cfd50 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 22 Oct 2025 11:10:04 +0300 Subject: [PATCH 102/341] Changed wording of the output for compare --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index e12bd142..d06cb93c 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -5,4 +5,4 @@ #verification set is from: 6.10.2025 (vdf 15.10.2025 from image_compare branch) folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/$1/" folder_2="${PWD}/produced_plots/$1/" -python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found" +python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" From 4fdb0068b965a07433fdc9fe3b93cb9f2135730a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 22 Oct 2025 11:10:36 +0300 Subject: [PATCH 103/341] made testpackage_vdf outputLocation variable match that of testpackage_colormap --- testpackage/testpackage_vdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_vdf.py b/testpackage/testpackage_vdf.py index a4bd0c0a..c4eac9e7 100644 --- a/testpackage/testpackage_vdf.py +++ b/testpackage/testpackage_vdf.py @@ -217,7 +217,7 @@ time = runs[runid]['time'] filename = runs[runid]['filename'] - outputLocation=os.path.expandvars('$HOME/Plots/'+verifydir) + outputLocation=pt.plot.defaultoutputdir+verifydir # Source data files bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" From 0816fed11c8faf4749b3df3bce7b2782b675a550 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 23 Oct 2025 10:43:54 +0300 Subject: [PATCH 104/341] cleaned up comments and added missing slash to path when printing --- testpackage/testpackage_compare.py | 56 ++++++++++++++---------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 745cc58a..fab78866 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -6,34 +6,6 @@ -def compare_images(a,b,output_file="NULL:"): - - cmd = f"magick compare -metric RMSE {a} {b} {output_file}" - proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - - out,err = proc.communicate() - - exitcode=proc.returncode - - #If errors, raise an exception (This has to be odne like this as compare sends output to stderr) - if exitcode!=0 and exitcode != 1: - out = str(out,'utf-8') - raise RuntimeError(out) - - out = str(out,'utf-8') - out=out.strip('\n') - out = out.split(" ") - - #Returns true if images' RMSE = 0, i.e are identical - if out[0]=='0': - return True - - return False - - -#output_folder = "/home/siclasse/analysator/different_output/" - -#!!!!!outputs unique files only from folder "b" #Parse arguments @@ -59,6 +31,30 @@ def compare_images(a,b,output_file="NULL:"): raise RuntimeError(err) +def compare_images(a,b,output_file="NULL:"): + + cmd = f"magick compare -metric RMSE {a} {b} {output_file}" + proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) + + out,err = proc.communicate() + + exitcode=proc.returncode + + #If errors, raise an exception (This has to be odne like this as compare sends output to stderr) + if exitcode!=0 and exitcode != 1: + out = str(out,'utf-8') + raise RuntimeError(out) + + out = str(out,'utf-8') + out=out.strip('\n') + out = out.split(" ") + + #Returns true if images' RMSE = 0, i.e are identical + if out[0]=='0': + return True + + return False + def compare_images_in_folders(a,b,output_folder='NULL:'): cmd = f'diff -r {a} {b}' @@ -84,9 +80,9 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): different_files.append(line[2]) elif line[0]=="Only": if line[2].rstrip(":")==b: - unique_files.append(line[2].rstrip(":")+line[3]) + unique_files.append(line[2].rstrip(":")+'/'+line[3]) else: - missing_files.append(line[2].rstrip(":")+line[3]) + missing_files.append(line[2].rstrip(":")+'/'+line[3]) #Feed the different files to compare_images From 408c37f34a69a8c36f46bb5e131aa111b927d856 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 23 Oct 2025 11:47:06 +0300 Subject: [PATCH 105/341] added bit more time for the workflow (60min) --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index bbc39b72..7e9b266c 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -22,7 +22,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: carrington - timeout-minutes: 46 + timeout-minutes: 60 strategy: fail-fast: false max-parallel: 2 From b4fd86eabce196df498bed2a2b58c00d266472bd Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 23 Oct 2025 15:23:12 +0300 Subject: [PATCH 106/341] Added a script and an accompanying sbatch job script to generate verification sets --- testpackage/generate_verf_set.py | 39 +++++++++++++++++++ .../run_testpackage_generate_verf_set.sh | 22 +++++++++++ 2 files changed, 61 insertions(+) create mode 100644 testpackage/generate_verf_set.py create mode 100644 testpackage/run_testpackage_generate_verf_set.sh diff --git a/testpackage/generate_verf_set.py b/testpackage/generate_verf_set.py new file mode 100644 index 00000000..b0b6de82 --- /dev/null +++ b/testpackage/generate_verf_set.py @@ -0,0 +1,39 @@ +import subprocess +import os + + + +def system_call(cmd): + proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) + + out,err = proc.communicate() + + #If errors, raise an exception + if err: + err = str(err,'utf-8') + raise RuntimeError(err) + + out = str(out,'utf-8').rstrip('\n') + return out + +#output_dir named after the latest commit hash +output_dir="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/"+system_call("git rev-parse HEAD") + + +git_branch = system_call('git rev-parse --abbrev-ref HEAD') + +#Are we on master branch? +if git_branch!='master': + user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') + if user_input.capitalize() != 'Y': + quit() + +#Check if folder exists +if not os.path.isdir(output_dir): + system_call(f'mkdir -p {output_dir}') +else: + print('::warning output folder already exists, we might be overwriting something') + +#Call the sbatch +out=system_call(f'sbatch ./run_testpackage_generate_verf_set.sh {output_dir}') +print(out) \ No newline at end of file diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh new file mode 100644 index 00000000..b3271b8f --- /dev/null +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -0,0 +1,22 @@ +#!/bin/bash -l +#SBATCH -t 00:60:00 +#SBATCH -J analysator_testpackage +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=0-20 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + +hostname +source /wrk-vakka/group/spacephysics/proj/analysator_testpackage/pyvenv.sh + +export PTNONINTERACTIVE=1 +export PTOUTPUTDIR=$1 + +python testpackage_colormap.py $jobcount $index +python testpackage_vdf.py $jobcount $index + +echo Job $SLURM_ARRAY_TASK_ID complete. From 3214dfc803faf921a568b84ad1984773c6c0d120 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 24 Oct 2025 12:19:18 +0300 Subject: [PATCH 107/341] changed pyvenv path and reduced number of arrays for testing --- testpackage/run_testpackage_generate_verf_set.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index b3271b8f..43598fcf 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=0-20 +#SBATCH --array=0-10 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 @@ -11,7 +11,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname -source /wrk-vakka/group/spacephysics/proj/analysator_testpackage/pyvenv.sh +source /wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/pyvenv.sh export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 From 2030a2617056fe1844a2382ef8c8f6c2c83d3054 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 30 Oct 2025 15:29:51 +0200 Subject: [PATCH 108/341] changed source in generate_verf_set and fixed unique file parsing in compare --- testpackage/run_testpackage_generate_verf_set.sh | 4 +++- testpackage/testpackage_compare.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index 43598fcf..18b8e507 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -1,6 +1,7 @@ #!/bin/bash -l #SBATCH -t 00:60:00 #SBATCH -J analysator_testpackage +#SBATCH -o output-%j-generate_verf_set.out #SBATCH -p short #SBATCH -n 1 #SBATCH --array=0-10 @@ -11,7 +12,8 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname -source /wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/pyvenv.sh +#source /wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/pyvenv.sh +source pyvenv.sh export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index fab78866..50d64542 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -79,7 +79,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if line[0]=="Binary" and line[1]=="files": different_files.append(line[2]) elif line[0]=="Only": - if line[2].rstrip(":")==b: + if b in line[2]: unique_files.append(line[2].rstrip(":")+'/'+line[3]) else: missing_files.append(line[2].rstrip(":")+'/'+line[3]) From 9c0e32c059c3bb67e47774226d78dcaaa09d9032 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 30 Oct 2025 17:19:25 +0200 Subject: [PATCH 109/341] made create_env to create python environment that works with when sourcing the added pyvenv.sh --- testpackage/create_env.py | 28 ++++++++++++++++++++++++++++ testpackage/generate_verf_set.py | 6 +++--- testpackage/pyvenv.sh | 8 ++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 testpackage/create_env.py create mode 100644 testpackage/pyvenv.sh diff --git a/testpackage/create_env.py b/testpackage/create_env.py new file mode 100644 index 00000000..b0e132cf --- /dev/null +++ b/testpackage/create_env.py @@ -0,0 +1,28 @@ +import os +import venv +from sys import version_info as python_version_info + + +#CHANGE TO NAOTHER FILE +create_venv_CI = False +create_venv_local = True + + +if not 'venv_testpackage' in os.listdir('.') and create_venv_local: + print('venv_testpackage not found, creating virtual environment') + os.system("mkdir venv_testpackage") + virt_env= venv.EnvBuilder(with_pip=True,upgrade_deps=True) + context=virt_env.ensure_directories('venv_testpackage') + virt_env.create('./venv_testpackage') + virt_env.setup_python(context) + + #Does not work in python versions <3.13 + if python_version_info.major>=3 and python_version_info.minor>=13: + virt_env.create_git_ignore_file(context) + + virt_env.create_configuration(context) + virt_env.setup_scripts(context) + os.system('./venv_testpackage/bin/pip install --editable ../') + + + diff --git a/testpackage/generate_verf_set.py b/testpackage/generate_verf_set.py index b0b6de82..3f9afab5 100644 --- a/testpackage/generate_verf_set.py +++ b/testpackage/generate_verf_set.py @@ -1,9 +1,7 @@ import subprocess import os - - -def system_call(cmd): +def system_call(cmd,wait=False): proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) out,err = proc.communicate() @@ -14,6 +12,8 @@ def system_call(cmd): raise RuntimeError(err) out = str(out,'utf-8').rstrip('\n') + if wait: + proc.wait() return out #output_dir named after the latest commit hash diff --git a/testpackage/pyvenv.sh b/testpackage/pyvenv.sh new file mode 100644 index 00000000..6b4d57da --- /dev/null +++ b/testpackage/pyvenv.sh @@ -0,0 +1,8 @@ +module purge +export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH +module load Python/3.10.4-GCCcore-11.3.0 +module load ImageMagick/7.1.0-37-GCCcore-11.3.0 +module list +#source /wrk-vakka/group/spacephysics/proj/CI_analysator/analysator_testpackage/python3.10.4/bin/activate +source ./venv_testpackage/bin/activate + From 450947f54fea1832ac910a35295b951cb3d02531 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 10:50:43 +0200 Subject: [PATCH 110/341] More robust venvironment creation script --- testpackage/create_env.py | 64 ++++++++++++++++++++++++++------ testpackage/generate_verf_set.py | 17 +-------- 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index b0e132cf..33048c6c 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -1,19 +1,13 @@ import os import venv +import subprocess from sys import version_info as python_version_info -#CHANGE TO NAOTHER FILE -create_venv_CI = False -create_venv_local = True - - -if not 'venv_testpackage' in os.listdir('.') and create_venv_local: - print('venv_testpackage not found, creating virtual environment') - os.system("mkdir venv_testpackage") +def create_venv(path,install_analysator=True,editable=False): virt_env= venv.EnvBuilder(with_pip=True,upgrade_deps=True) - context=virt_env.ensure_directories('venv_testpackage') - virt_env.create('./venv_testpackage') + context=virt_env.ensure_directories(path) + virt_env.create(path) virt_env.setup_python(context) #Does not work in python versions <3.13 @@ -22,7 +16,55 @@ virt_env.create_configuration(context) virt_env.setup_scripts(context) - os.system('./venv_testpackage/bin/pip install --editable ../') + if install_analysator: + os.system(f'{path}/bin/pip install {'--editable' if editable else ''} ../') + print(f'Virtual environment created at {path}') + return 0 + +def system_call(cmd,wait=False): + proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) + + out,err = proc.communicate() + + #If errors, raise an exception + if err: + err = str(err,'utf-8') + raise RuntimeError(err) + + out = str(out,'utf-8').rstrip('\n') + if wait: + proc.wait() + return out + + +if __name__ == "__main__": + create_venv_CI = True + create_venv_local = False + + ci_path="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage" + + if not 'venv_testpackage' in os.listdir('.') and create_venv_local: + print('venv_testpackage not found, creating virtual environment') + os.system("mkdir venv_testpackage") #Is this necessary? + create_venv('venv_testpackage',editable=True) + + if create_venv_CI: + print('Creating virtual environment for CI') + import time + time=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") + + git_branch = system_call('git rev-parse --abbrev-ref HEAD') + + #Are we on master branch? + if git_branch!='master': + user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') + if user_input.capitalize() != 'Y': + quit() + path=f"{ci_path}/venv_testpackage-{time}-{git_branch}" + create_venv(path,install_analysator=True,editable=False) #Editable should be false (default) for CI! + + #Make group writable + print(system_call(f'chmod g+w {path}')) diff --git a/testpackage/generate_verf_set.py b/testpackage/generate_verf_set.py index 3f9afab5..4670e59e 100644 --- a/testpackage/generate_verf_set.py +++ b/testpackage/generate_verf_set.py @@ -1,20 +1,7 @@ -import subprocess -import os - -def system_call(cmd,wait=False): - proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) - out,err = proc.communicate() - - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) +import os +from create_env import system_call - out = str(out,'utf-8').rstrip('\n') - if wait: - proc.wait() - return out #output_dir named after the latest commit hash output_dir="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/"+system_call("git rev-parse HEAD") From fb78ba7ea7ff4a92451e3b05c8aa02a78d8b94ea Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 11:19:09 +0200 Subject: [PATCH 111/341] Minor fixes and better system_call function --- testpackage/create_env.py | 64 +++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 33048c6c..3751bb1e 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -4,6 +4,27 @@ from sys import version_info as python_version_info + + +def system_call(cmd,live_output=False): + with subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) as proc: + if live_output: + for line in proc.stdout: + print(str(line,'utf-8').rstrip('\n')) #Note that for example pip's progress bar is not displayed + + out,err = proc.communicate() + + #If errors, raise an exception + if proc.returncode!=0: + err = str(err,'utf-8') + raise RuntimeError(err) + + out = str(out,'utf-8').rstrip('\n') + + + + return out + def create_venv(path,install_analysator=True,editable=False): virt_env= venv.EnvBuilder(with_pip=True,upgrade_deps=True) context=virt_env.ensure_directories(path) @@ -17,54 +38,45 @@ def create_venv(path,install_analysator=True,editable=False): virt_env.create_configuration(context) virt_env.setup_scripts(context) if install_analysator: - os.system(f'{path}/bin/pip install {'--editable' if editable else ''} ../') + system_call(f'{path}/bin/pip install {'--editable' if editable else ''} ../',live_output=True) print(f'Virtual environment created at {path}') - return 0 - -def system_call(cmd,wait=False): - proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) - - out,err = proc.communicate() - - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) - - out = str(out,'utf-8').rstrip('\n') - if wait: - proc.wait() - return out - + return None if __name__ == "__main__": - create_venv_CI = True - create_venv_local = False + + create_venv_CI = False #Create a virtual environment for CI in wrk-vakka + create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder) + ci_path="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage" if not 'venv_testpackage' in os.listdir('.') and create_venv_local: print('venv_testpackage not found, creating virtual environment') - os.system("mkdir venv_testpackage") #Is this necessary? create_venv('venv_testpackage',editable=True) + else: + print('venv_testpackage found, not creating virtual environment') + + + + #Create a virtual environment for CI in wrk-vakka if create_venv_CI: print('Creating virtual environment for CI') import time - time=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") + gmtime_now=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") git_branch = system_call('git rev-parse --abbrev-ref HEAD') #Are we on master branch? - if git_branch!='master': + if git_branch not in ('master','main') : user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') if user_input.capitalize() != 'Y': quit() - path=f"{ci_path}/venv_testpackage-{time}-{git_branch}" + path=f"{ci_path}/venv_testpackage-{gmtime_now}-{git_branch}" create_venv(path,install_analysator=True,editable=False) #Editable should be false (default) for CI! - + #Make group writable - print(system_call(f'chmod g+w {path}')) + print(system_call(f'chmod -R g+w {path}')) From 2d6d94eb6c2efb8fad34b25c3d4b6a0491fd16c8 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 11:21:20 +0200 Subject: [PATCH 112/341] Now errors if unique or missing files --- testpackage/testpackage_compare.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 50d64542..eaf0e7ca 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -105,9 +105,11 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if len(unique_files)!=0: - print("::warning title=Unique file(s)::Found new file(s) produced by the code!") + raise SystemError("Found new file(s) produced by the code!") + if len(missing_files)!=0: - print("::warning title=Missing file(s)::Found file(s) **not** produced by the code!") + raise SystemError("Found file(s) **not** produced by the code!") + if different: print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") From 38062fab4a22e857fa33c6162a4485315e510c54 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 11:44:00 +0200 Subject: [PATCH 113/341] added check for git diff against remote and fixed system_call --- testpackage/create_env.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 3751bb1e..17e815d5 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -12,7 +12,8 @@ def system_call(cmd,live_output=False): for line in proc.stdout: print(str(line,'utf-8').rstrip('\n')) #Note that for example pip's progress bar is not displayed - out,err = proc.communicate() + out,err = proc.communicate() + #If errors, raise an exception if proc.returncode!=0: @@ -20,9 +21,6 @@ def system_call(cmd,live_output=False): raise RuntimeError(err) out = str(out,'utf-8').rstrip('\n') - - - return out def create_venv(path,install_analysator=True,editable=False): @@ -57,8 +55,7 @@ def create_venv(path,install_analysator=True,editable=False): print('venv_testpackage found, not creating virtual environment') - - + #Create a virtual environment for CI in wrk-vakka if create_venv_CI: print('Creating virtual environment for CI') @@ -73,6 +70,15 @@ def create_venv(path,install_analysator=True,editable=False): user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') if user_input.capitalize() != 'Y': quit() + else: + #Is local master up to date with remote? + git_diff=system_call('git diff --numstat origin/master...') + if git_diff!='': + print('::warning Local master branch not up to date with remote, are you sure you want to continue? y/n\n') + user_input=input() + if user_input.capitalize() != 'Y': + quit() + path=f"{ci_path}/venv_testpackage-{gmtime_now}-{git_branch}" From 6dc28a619259645ab47e29cfec1ae2d4b2065a24 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 11:45:36 +0200 Subject: [PATCH 114/341] now also prints the diff --- testpackage/create_env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 17e815d5..77e720b3 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -74,6 +74,7 @@ def create_venv(path,install_analysator=True,editable=False): #Is local master up to date with remote? git_diff=system_call('git diff --numstat origin/master...') if git_diff!='': + print(git_diff) print('::warning Local master branch not up to date with remote, are you sure you want to continue? y/n\n') user_input=input() if user_input.capitalize() != 'Y': From 58992609855276ca7752a8a7e098c2245402b80d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 13:52:10 +0200 Subject: [PATCH 115/341] Removed generate_verf_set.py and made a generation workflow generate_reference_plots.yml --- .../workflows/generate_reference_plots.yml | 46 +++++++++++++++++++ testpackage/generate_verf_set.py | 26 ----------- 2 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/generate_reference_plots.yml delete mode 100644 testpackage/generate_verf_set.py diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml new file mode 100644 index 00000000..084a3544 --- /dev/null +++ b/.github/workflows/generate_reference_plots.yml @@ -0,0 +1,46 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Turso compare colourmap images + +on: + workflow_dispatch: + + +jobs: + + turso_system: + if: github.repository_owner == 'fmihpc' + runs-on: carrington + timeout-minutes: 60 + strategy: + fail-fast: false + max-parallel: 2 + matrix: + extras: ["all"] + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install dependencies + run: | + export TMPDIR=$RUNNER_TEMP + export UV_LINK_MODE=copy + module purge + module load Python/3.10.4-GCCcore-11.3.0 + uv venv CI_env + . CI_env/bin/activate + uv pip install --editable ../analysator[${{ matrix.extras }}] + - name: Produce plots + run: | + export TMPDIR=$RUNNER_TEMP + + PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)"" + mkdir $PATH + sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH + + + cat testpackage_gen_verf.txt + module purge + module load Python/3.10.4-GCCcore-11.3.0 + python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt diff --git a/testpackage/generate_verf_set.py b/testpackage/generate_verf_set.py deleted file mode 100644 index 4670e59e..00000000 --- a/testpackage/generate_verf_set.py +++ /dev/null @@ -1,26 +0,0 @@ - -import os -from create_env import system_call - - -#output_dir named after the latest commit hash -output_dir="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/"+system_call("git rev-parse HEAD") - - -git_branch = system_call('git rev-parse --abbrev-ref HEAD') - -#Are we on master branch? -if git_branch!='master': - user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') - if user_input.capitalize() != 'Y': - quit() - -#Check if folder exists -if not os.path.isdir(output_dir): - system_call(f'mkdir -p {output_dir}') -else: - print('::warning output folder already exists, we might be overwriting something') - -#Call the sbatch -out=system_call(f'sbatch ./run_testpackage_generate_verf_set.sh {output_dir}') -print(out) \ No newline at end of file From 26d8799790d115410f9417e6fd21cb26a72f1894 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 13:52:52 +0200 Subject: [PATCH 116/341] big changes to create_env.py --- testpackage/create_env.py | 117 ++++++++++++++++++++++++++------------ 1 file changed, 82 insertions(+), 35 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 77e720b3..fdb5972e 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -40,50 +40,97 @@ def create_venv(path,install_analysator=True,editable=False): print(f'Virtual environment created at {path}') return None +def gitcheck(): + + git_branch = system_call('git rev-parse --abbrev-ref HEAD') + + + #Are we on master branch? + if git_branch not in ('master','main') : + user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') + if user_input.capitalize() != 'Y': + quit() + else: + #Is local master up to date with remote? + git_diff=system_call('git diff --numstat origin/master...') + if git_diff!='': + print(git_diff) + print('::warning Local master branch not up to date with remote, are you sure you want to continue? y/n\n') + user_input=input() + if user_input.capitalize() != 'Y': + quit() + return None + + +''' +def create_ci_venv(): + print('Creating virtual environment for CI') + import time + gmtime_now=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") + + gitcheck() + + ci_path="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage" + + path=f"{ci_path}/venv_testpackage-{gmtime_now}-{git_branch}" + + create_venv(path,install_analysator=True,editable=False) #Editable should be false (default) for CI! + + #Make group writable + print(system_call(f'chmod -R g+w {path}')) + + return path +''' + + +def create_venv_script(path,venv_path): + if path[-1]!="/": + path=path+"/" + + if not os.path.isdir(path): + raise FileNotFoundError(f"{path} does not exist.") + + if os.path.isfile(path+"pyvenv.sh"): + #If file exists, check for source line and add one if not present + source_line=False + with open(path+"pyvenv.sh","a+") as f: + f.seek(0) + for line in f: + if "source" in line[:6]: + source_line=True + print("Warning: source line already in pyvenv.sh, make sure it is correct for CI! Run regardless? y/n") + user_input=input() + if user_input.capitalize() != 'Y': + quit() + break + if not source_line: + f.write(f"source {path}/bin/activate\n") + f.close() + else: + #Create the file with the source line + with open(path+"pyvenv.sh","w") as f: + f.write("module purge\n") + if 'TURSO' in os.uname().nodename.upper(): + f.write("export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH\n") + f.write("module load ImageMagick/7.1.0-37-GCCcore-11.3.0\n") + f.write("module list\n") + f.write(f"source {path}/bin/activate\n") + f.close() + + if __name__ == "__main__": - create_venv_CI = False #Create a virtual environment for CI in wrk-vakka create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder) - ci_path="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage" + venv_name= 'venv_testpackage' - if not 'venv_testpackage' in os.listdir('.') and create_venv_local: + if not venv_name in os.listdir('.') and create_venv_local: print('venv_testpackage not found, creating virtual environment') - create_venv('venv_testpackage',editable=True) + create_venv(venv_name,editable=True) + create_venv_script('./',f'./{venv_name}') else: print('venv_testpackage found, not creating virtual environment') - #Create a virtual environment for CI in wrk-vakka - if create_venv_CI: - print('Creating virtual environment for CI') - import time - gmtime_now=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") - - git_branch = system_call('git rev-parse --abbrev-ref HEAD') - - - #Are we on master branch? - if git_branch not in ('master','main') : - user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') - if user_input.capitalize() != 'Y': - quit() - else: - #Is local master up to date with remote? - git_diff=system_call('git diff --numstat origin/master...') - if git_diff!='': - print(git_diff) - print('::warning Local master branch not up to date with remote, are you sure you want to continue? y/n\n') - user_input=input() - if user_input.capitalize() != 'Y': - quit() - - - path=f"{ci_path}/venv_testpackage-{gmtime_now}-{git_branch}" - - create_venv(path,install_analysator=True,editable=False) #Editable should be false (default) for CI! - - #Make group writable - print(system_call(f'chmod -R g+w {path}')) From ac4bd1ddbc6235e383ffa1db5232c4122cdac2c2 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 13:53:08 +0200 Subject: [PATCH 117/341] removed unnecessary echo from test_compare_images.yml --- .github/workflows/test_compare_images.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 7e9b266c..b3d4aef5 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -49,7 +49,6 @@ jobs: sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh - echo ${{ steps.run_color.outputs.SLURM_JOB_ID1 }} cat testpackage_colormap_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 From 400a637c801645f5a8ecfabb34f9e5cca487b780 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 13:53:30 +0200 Subject: [PATCH 118/341] deleted pyvenv.sh as it is now made by create_env script if needed --- testpackage/pyvenv.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 testpackage/pyvenv.sh diff --git a/testpackage/pyvenv.sh b/testpackage/pyvenv.sh deleted file mode 100644 index 6b4d57da..00000000 --- a/testpackage/pyvenv.sh +++ /dev/null @@ -1,8 +0,0 @@ -module purge -export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -module load Python/3.10.4-GCCcore-11.3.0 -module load ImageMagick/7.1.0-37-GCCcore-11.3.0 -module list -#source /wrk-vakka/group/spacephysics/proj/CI_analysator/analysator_testpackage/python3.10.4/bin/activate -source ./venv_testpackage/bin/activate - From 47eae7ac3a5e2a9f63271e9248ff1bc7fd75e203 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 13:53:51 +0200 Subject: [PATCH 119/341] changed generate_verf_set to source CI_env --- testpackage/run_testpackage_generate_verf_set.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index 18b8e507..ed0614e3 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -12,8 +12,8 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname -#source /wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/pyvenv.sh -source pyvenv.sh + +source CI_env/bin/activate export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 From 168e3214e54e7e1035f3820362f8fdbf1097da35 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:03:38 +0200 Subject: [PATCH 120/341] removed unused functions from create_env and fixed it --- testpackage/create_env.py | 60 ++++----------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index fdb5972e..8d650393 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -40,50 +40,8 @@ def create_venv(path,install_analysator=True,editable=False): print(f'Virtual environment created at {path}') return None -def gitcheck(): - git_branch = system_call('git rev-parse --abbrev-ref HEAD') - - - #Are we on master branch? - if git_branch not in ('master','main') : - user_input=input('::warning not in master branch, are you sure you want to continue? y/n\n') - if user_input.capitalize() != 'Y': - quit() - else: - #Is local master up to date with remote? - git_diff=system_call('git diff --numstat origin/master...') - if git_diff!='': - print(git_diff) - print('::warning Local master branch not up to date with remote, are you sure you want to continue? y/n\n') - user_input=input() - if user_input.capitalize() != 'Y': - quit() - return None - - -''' -def create_ci_venv(): - print('Creating virtual environment for CI') - import time - gmtime_now=time.strftime("%c",time.gmtime()).replace(" ","_").replace(":","-") - - gitcheck() - - ci_path="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage" - - path=f"{ci_path}/venv_testpackage-{gmtime_now}-{git_branch}" - - create_venv(path,install_analysator=True,editable=False) #Editable should be false (default) for CI! - - #Make group writable - print(system_call(f'chmod -R g+w {path}')) - - return path -''' - - -def create_venv_script(path,venv_path): +def create_venv_script(path,venv_name): if path[-1]!="/": path=path+"/" @@ -92,19 +50,13 @@ def create_venv_script(path,venv_path): if os.path.isfile(path+"pyvenv.sh"): #If file exists, check for source line and add one if not present - source_line=False with open(path+"pyvenv.sh","a+") as f: f.seek(0) for line in f: if "source" in line[:6]: - source_line=True - print("Warning: source line already in pyvenv.sh, make sure it is correct for CI! Run regardless? y/n") - user_input=input() - if user_input.capitalize() != 'Y': - quit() - break - if not source_line: - f.write(f"source {path}/bin/activate\n") + raise SystemError("source line already in pyvenv.sh!") + + f.write(f"source {path+venv_name}/bin/activate\n") f.close() else: #Create the file with the source line @@ -114,7 +66,7 @@ def create_venv_script(path,venv_path): f.write("export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH\n") f.write("module load ImageMagick/7.1.0-37-GCCcore-11.3.0\n") f.write("module list\n") - f.write(f"source {path}/bin/activate\n") + f.write(f"source {path+venv_name}/bin/activate\n") f.close() @@ -128,7 +80,7 @@ def create_venv_script(path,venv_path): if not venv_name in os.listdir('.') and create_venv_local: print('venv_testpackage not found, creating virtual environment') create_venv(venv_name,editable=True) - create_venv_script('./',f'./{venv_name}') + create_venv_script('./',venv_name) else: print('venv_testpackage found, not creating virtual environment') From df6a216062435cf912987a0b13a19a9a1bd4916b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:05:23 +0200 Subject: [PATCH 121/341] changed run_testpackages to use the local pyvenv.sh --- testpackage/run_testpackage_colormap.sh | 2 +- testpackage/run_testpackage_vdf.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_colormap.sh b/testpackage/run_testpackage_colormap.sh index 274926db..3454c8cd 100644 --- a/testpackage/run_testpackage_colormap.sh +++ b/testpackage/run_testpackage_colormap.sh @@ -11,7 +11,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname -source /wrk-vakka/group/spacephysics/proj/analysator_testpackage/pyvenv.sh +source pyvenv.sh export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/ diff --git a/testpackage/run_testpackage_vdf.sh b/testpackage/run_testpackage_vdf.sh index c6897a82..32200596 100644 --- a/testpackage/run_testpackage_vdf.sh +++ b/testpackage/run_testpackage_vdf.sh @@ -11,7 +11,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -source /wrk-vakka/group/spacephysics/proj/analysator_testpackage/pyvenv.sh +source pyvenv.sh export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$PWD/ From 2d968c05058bd1f898734c9d76dbb8d26923f9af Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:06:42 +0200 Subject: [PATCH 122/341] changed workflow name --- .github/workflows/generate_reference_plots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 084a3544..5a9a40a8 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Turso compare colourmap images +name: turso generate verification set on: workflow_dispatch: From ce29b375d158ce12e3b6aa73f7d7e67860297402 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:13:33 +0200 Subject: [PATCH 123/341] renamed workflow --- .../{generate_reference_plots.yml => generate_reference_data.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{generate_reference_plots.yml => generate_reference_data.yml} (100%) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_data.yml similarity index 100% rename from .github/workflows/generate_reference_plots.yml rename to .github/workflows/generate_reference_data.yml From 648ea063ead1cb68588f578f70809e2bd49159ca Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:26:43 +0200 Subject: [PATCH 124/341] removed sbatch output --- testpackage/run_testpackage_generate_verf_set.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index ed0614e3..adff83c5 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -1,7 +1,6 @@ #!/bin/bash -l #SBATCH -t 00:60:00 #SBATCH -J analysator_testpackage -#SBATCH -o output-%j-generate_verf_set.out #SBATCH -p short #SBATCH -n 1 #SBATCH --array=0-10 From 897fb943719fbea051b8d30e11a5209dd172ef55 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:29:08 +0200 Subject: [PATCH 125/341] Removed file accidentally tracked --- testpackage/color_small_test.py | 465 -------------------------------- 1 file changed, 465 deletions(-) delete mode 100644 testpackage/color_small_test.py diff --git a/testpackage/color_small_test.py b/testpackage/color_small_test.py deleted file mode 100644 index a584f363..00000000 --- a/testpackage/color_small_test.py +++ /dev/null @@ -1,465 +0,0 @@ -import analysator as pt -import sys, os -import numpy as np -import traceback - -datalocation = "/wrk/group/spacephysics/vlasiator" -runs = [] -runs.append( { 'name': 'ABC', - 'verifydir': 'testpackage_colormap/ABC/', - 'fileLocation': datalocation+'/2D/ABC/bulk/', - 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'pops': ['avgs'], - 'time': 1000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) -runs.append( { 'name': 'BCQ', - 'verifydir': 'testpackage_colormap/BCQ/', - 'fileLocation': datalocation+'/2D/BCQ/bulk/', - 'fluxLocation': None, #datalocation+'/2D/BCQ/flux/', # missing on Vorna - 'pops': ['avgs'], - 'time': 2000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -runs.append( { 'name': 'BFD', - 'verifydir': 'testpackage_colormap/BFD/', - 'fileLocation': datalocation+'/2D/BFD/bulk/', - 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', - 'fluxprefix': 'bulk.', - 'pops': ['proton','helium'], - 'time': 2000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -# runs.append( { 'name': 'BCQr', -# 'verifydir': 'testpackage_colormap/BCQr/', -# 'fileLocation': datalocation+'/2D/BCQ/', -# 'fluxLocation': None, -# 'pops': ['avgs'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0001361.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -# runs.append( { 'name': 'AFC', -# 'verifydir': 'testpackage_colormap/AFC/', -# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', -# 'fluxLocation': datalocation+'/2D/AFC/production_halfres/flux/', -# 'pops': ['proton'], -# 'time': 1000, -# 'singletime': False, -# 'filename': None, -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) -# runs.append( { 'name': 'AFCr', -# 'verifydir': 'testpackage_colormap/AFCr/', -# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', -# 'fluxLocation': None, -# 'pops': ['proton'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0000592.2019-04-19_07-58-12.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) -# runs.append( { 'name': 'BFDr', -# 'verifydir': 'testpackage_colormap/BFDr/', -# 'fileLocation': datalocation+'/2D/BFD/restart/', -# 'fluxLocation': None, -# 'pops': ['avgs'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0001126.2018-06-03_21-34-16.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -runs.append( { 'name': 'BGA', - 'verifydir': 'testpackage_colormap/BGA/', - 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', - 'fluxLocation': None, - 'pops': ['proton'], - 'time': 380, - 'singletime': True, # neighboring bulk files not available - 'filename': None, - 'vlasiator5': True, - 'nosubpops': True, # thermal / non-thermal - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) - -# Custom expression function -def exprMA_cust(exprmaps, requestvariables=False): - if vlasiator5 is True: - reqs = ['vg_va'] - else: - reqs = ['va'] - if requestvariables==True: - return reqs - # exprmaps is a dictionary of numpy arrays - # Each array has 2 dimensions [xsize, ysize] - # or 3 dimensions [xsize, ysize, components] - # here the function returns the M_A with a preset bulk velocity - custombulkspeed=1500000. # m/s - va = exprmaps[reqs[0]][:,:] - MA = np.ma.divide(custombulkspeed,va) - return MA - -# Second example of a more involved custom expression function -def expr_cav_cust(pass_maps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # This custom expression returns a map with values of - # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against - # time-averaged background values. This version doesn't do intelligent checks for the - # format of the incoming data. - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - - # Multiple time steps were found - ntimes = len(pass_maps) - dsteps = [x['dstep'] for x in pass_maps] - curri = dsteps.index(0) - thesemaps = pass_maps[curri] - - thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) - thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) - thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) - thisBmag = np.linalg.norm(thisB, axis=-1) - - avgrho = np.zeros(np.array(thisrho.shape)) - avgBmag = np.zeros(np.array(thisrho.shape)) - # avgbeta = np.zeros(np.array(thisrho.shape)) - - for i in range(ntimes): - if i==curri: # Exclude current frame from background value averaging - continue - nowmaps = pass_maps[i] - print(nowmaps['dstep']) - avgrho = np.add(avgrho, nowmaps[reqs[0]]) - avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) - avgBmag = np.add(avgBmag, avgBcalc) - # avgbeta = np.add(avgbeta, nowmaps[2]) - - avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) - avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) - #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) - - rhoratio = np.ma.divide(thisrho, avgrho) - Bmagratio = np.ma.divide(thisBmag, avgBmag) - #betaratio = np.divide(thisbeta, avgbeta) - - rhoratioreq = 0.9 - bmagratioreq = 0.9 - betashfareq = level_beta_SHFA - - # Calculations using masked arrays proved problematic so a less-than elegant method is used here. - empty = np.zeros(np.array(thisrho.shape))+0.0 - half = empty + 0.5 - one = empty + 1.0 - caviton = np.add(empty, one, where=(rhoratiobetashfareq)) - print("sum of SHFA ",shfa.sum()) - - combo = np.add(empty, half, where=(caviton>1.5)) - print("sum of combo ",combo.sum()) - combo2 = np.add(empty, half, where=(shfa>2.5)) - print("sum of combo2 ",combo2.sum()) - combo3 = combo+combo2 - print("sum of combo3 ",combo3.sum()) - - # Mask out anything that is inside the bow shock - combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) - print("sum of combo3 upstream ",combo3.sum()) - - return combo3 - - -# Second example of a more involved custom expression function -def timesmooth(pass_maps): - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # consists of a single [ysize,xsize] array to smooth over time - - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - ntimes = len(pass_maps) - print("this many time steps ",ntimes) - # Select first valid variable - listofkeys = iter(pass_maps[0]) - while True: - var = next(listofkeys) - if var!="dstep": break - - # Multiple time steps were found - avg = np.zeros(pass_maps[0][var].shape) - for i in range(ntimes): - avg = np.add(avg, pass_maps[i][var]) - return np.divide(avg, np.array([ntimes])) - -# Helper function for drawing on existing panel -def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - - rho = extmaps[reqs[0]] - beta = extmaps[reqs[2]] - # take magnitude of B - B = np.linalg.norm(extmaps[reqs[1]],axis=-1) - - # Colours to use - color_cavitons = '#924900' - color_SHFAs = '#B66DFF' - color_BS = '#FFFF6D' - - # mask cavitons - cavitons = np.ma.masked_greater_equal(B,level_B_caviton) - cavitons.mask[rho > level_n_caviton] = True - cavitons.fill_value = 0. - cavitons[cavitons.mask == False] = 1. - - # mask SHFAs - SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) - SHFAs.mask[rho > level_n_caviton] = True - SHFAs.mask[beta < level_beta_SHFA] = True - SHFAs.fill_value = 0. - SHFAs[SHFAs.mask == False] = 1. - - # draw contours - contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], - linewidths=1.2, colors=color_BS) - contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) - contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) - -regularcalls = [] - -nonrestartcalls = [ -# Overplots and flux lines -"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", -] - - -multipopcalls = [] - -v5regularcalls = [] - -v5nonrestartcalls = [] - -v5multipopcalls = [] -# For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# regularcalls = [] -# nonrestartcalls = ["pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -# ] -# multipopcalls = [] -# v5regularcalls = [] -# v5nonrestartcalls = [] -# v5multipopcalls = [] - -# Construct test list -calls = [] -callrunids = [] -callrunindex = [] -for i,run in enumerate(runs): - # bulk and restart files - vlasiator5 = run['vlasiator5'] - filename = run['filename'] - fileLocation = run['fileLocation'] - singletime = run['singletime'] - nosubpops = run['nosubpops'] - fluxLocation = run['fluxLocation'] - - callindex = 0 - if vlasiator5: - for call in v5regularcalls: - if not filename is None: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - else: - for call in regularcalls: - if not filename is None: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - # non-restart files - if filename is None: - if vlasiator5: - for call in v5nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in v5multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - else: - for call in nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - -nteststot = len(callrunids) - - - -# How many jobs? -jobcount=int(sys.argv[1]) -jobcurr=int(sys.argv[2]) -increment = int(nteststot/jobcount) -remainder = nteststot - jobcount * increment -start=jobcurr * increment -end=start + increment -# Remainder frames are divvied out evenly among tasks -if jobcurr < remainder: - start = start + jobcurr - end = end + jobcurr + 1 -else: - start = start + remainder - end = end + remainder - - -# Perform call -for j in range(start,end): - # Calculate which run - jrun = callrunindex[j] - runid = callrunids[j] - call = calls[j] - - runname = runs[runid]['name'] - verifydir = runs[runid]['verifydir'] - fileLocation = runs[runid]['fileLocation'] - fluxLocation = runs[runid]['fluxLocation'] - pops = runs[runid]['pops'] - time = runs[runid]['time'] - filename = runs[runid]['filename'] - vlasiator5 = runs[runid]['vlasiator5'] - singletime = runs[runid]['singletime'] - - level_bow_shock = runs[runid]['cavitonparams'][0] - level_n_caviton = runs[runid]['cavitonparams'][1] - level_B_caviton = runs[runid]['cavitonparams'][2] - level_beta_SHFA = runs[runid]['cavitonparams'][3] - - outputLocation=pt.plot.defaultoutputdir+verifydir - - # Source data files - if filename is None: - bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" - else: - bulkname = filename - if 'fluxprefix' in runs[runid]: - fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" - else: - fluxname = "flux."+str(time).rjust(7,'0')+".bin" - - call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") - call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") - call = call.replace('REPLACETIME',"'"+str(time)+"'") - - # Many different plots - print(j, runid, jrun, call) - f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) - try: - exec(call) - except Exception as e: - print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) - - traceback.print_exc() - print("END TRACE for call",j,"\n----------------------------") From d8fe9ed1d980a3343fe2da726e51fea57707ea31 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 14:56:32 +0200 Subject: [PATCH 126/341] Changed behaviour of fixfigsize and renamed it figsize to fix figsize --- analysator/pyPlots/plot_vdf.py | 14 ++- testpackage/testpackage_vdf.py | 178 ++++++++++++++++----------------- 2 files changed, 95 insertions(+), 97 deletions(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index 6609c9c8..e4f05af2 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -427,7 +427,7 @@ def plot_vdf(filename=None, biglabel=None, biglabloc=None, noxlabels=None, noylabels=None, axes=None, cbaxes=None, - contours=None,fixfigsize=False + contours=None,figsize=None ): ''' Plots a coloured 2D plot of a VDF (a slice of given thickness or fully projected) with axes and a colour bar. @@ -521,8 +521,7 @@ def plot_vdf(filename=None, :kword scale_cb: Colour bar text additional scale factor (default=5.0) :kword scale_label: Big label text additional scale factor (default=12.0) :kword thick: line and axis thickness, default=1.0 - :kword fixfigsize: Used for fixing the size of the output image for testpackage or for comparing images with ImageMagick compare. - This should not be used with noborder, as it may undo it. + :kword figsize: Set figure size, default=None which will use [4.0,3.15*ratio] :returns: Outputs an image to a file or to the screen. @@ -1135,25 +1134,24 @@ def plot_vdf(filename=None, # Define figure size ratio = (yvalsrange[1]-yvalsrange[0])/(xvalsrange[1]-xvalsrange[0]) # default for square figure is figsize=[4.0,3.15] - figsize = [4.0,3.15*ratio] # Plot the slice [XmeshXY,YmeshXY] = np.meshgrid(edgesX/velUnit,edgesY/velUnit) # Generates the mesh to map the data to if axes is None: - if fixfigsize is not None: + if figsize is not None: #Matplotlib jank, it noborder changed the imagesize even though you'd think insetting would work #it did fix the size if inset was something weird like [0.5,0.5,0.5,0.5] *shrug* if noborder: - logging.warning("noborder and fixfigsize enabled, this may undo effects of fixfigsize") - fig = plt.figure(figsize=[5,4],dpi=300) + logging.warning("noborder and figsize enabled, this may undo effects of figsize") + fig = plt.figure(figsize=figsize,dpi=300) axm=plt.gca() axm.axis('off') ax1 = axm.inset_axes([0.05,0.05,0.9,0.9]) else: # Create 300 dpi image of suitable size - fig = plt.figure(figsize=figsize,dpi=300) + fig = plt.figure(figsize=[4.0,3.15*ratio] ,dpi=300) ax1 = plt.gca() # get current axes else: diff --git a/testpackage/testpackage_vdf.py b/testpackage/testpackage_vdf.py index c4eac9e7..2e152f6b 100644 --- a/testpackage/testpackage_vdf.py +++ b/testpackage/testpackage_vdf.py @@ -43,131 +43,131 @@ regularcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_vdf(fixfigsize=True,filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", # cellids, coordinates -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", # Thickness, scale -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", # Tick interval -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", # msec musec titles -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", # B vector -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", # Zoom and units -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", # Watermarks -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", # Biglabels -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", # title, axes, noborders -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", # slicethick -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", # cellsize -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", # fmin, fmax, setThreshold -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", # colormaps -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", # cbulk, center, bvector -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", # wflux -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", # directions -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", ] multipopcalls = [ -"pt.plot.plot_vdf(fixfigsize=True,vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] From 8ddbd76195f142e4116fb00d80a7357cc5111835 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Fri, 31 Oct 2025 15:07:23 +0200 Subject: [PATCH 127/341] Rename workflow for generating reference data --- .github/workflows/generate_reference_data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_data.yml b/.github/workflows/generate_reference_data.yml index 5a9a40a8..889aabdf 100644 --- a/.github/workflows/generate_reference_data.yml +++ b/.github/workflows/generate_reference_data.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: turso generate verification set +name: generate_reference_data on: workflow_dispatch: From c19fc7279ca24946ef6d959f41378ec6bc56e8dd Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Fri, 31 Oct 2025 15:10:21 +0200 Subject: [PATCH 128/341] Add generate_reference_data_plots.yml workflow --- ...erate_reference_data.yml => generate_reference_data_plots.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{generate_reference_data.yml => generate_reference_data_plots.yml} (100%) diff --git a/.github/workflows/generate_reference_data.yml b/.github/workflows/generate_reference_data_plots.yml similarity index 100% rename from .github/workflows/generate_reference_data.yml rename to .github/workflows/generate_reference_data_plots.yml From ef377a01e4db5ac38de5568c8c76b07e2dc382f3 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 31 Oct 2025 16:47:52 +0200 Subject: [PATCH 129/341] fixed type --- .github/workflows/generate_reference_data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_data.yml b/.github/workflows/generate_reference_data.yml index 5a9a40a8..591b8d44 100644 --- a/.github/workflows/generate_reference_data.yml +++ b/.github/workflows/generate_reference_data.yml @@ -35,7 +35,7 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP - PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)"" + PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" mkdir $PATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH From b1e32ed432aafe46820b26892e01469994d329f6 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 31 Oct 2025 17:07:59 +0200 Subject: [PATCH 130/341] Get generate_reference_plots from master --- ..._reference_data_plots.yml => generate_reference_plots.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{generate_reference_data_plots.yml => generate_reference_plots.yml} (89%) diff --git a/.github/workflows/generate_reference_data_plots.yml b/.github/workflows/generate_reference_plots.yml similarity index 89% rename from .github/workflows/generate_reference_data_plots.yml rename to .github/workflows/generate_reference_plots.yml index 889aabdf..1f3131f9 100644 --- a/.github/workflows/generate_reference_data_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -35,8 +35,8 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP - PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)"" - mkdir $PATH + DATAPATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" + mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH From d4e0bf8b01a2f5738dfdf318c10f345221bdc221 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Mon, 3 Nov 2025 10:17:42 +0200 Subject: [PATCH 131/341] Update DATAPATH variable in workflow script --- .github/workflows/generate_reference_plots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 1f3131f9..cde8447a 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -37,7 +37,7 @@ jobs: DATAPATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" mkdir $DATAPATH - sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH + sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH cat testpackage_gen_verf.txt From 712382d623db3cea9aff3f5011ce4f6d8cd731f7 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Mon, 3 Nov 2025 10:22:13 +0200 Subject: [PATCH 132/341] Update workflow to move module loading for Python Moved module loading and added environment activation for Python. --- .github/workflows/generate_reference_plots.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index cde8447a..84fb5cf6 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -34,13 +34,15 @@ jobs: - name: Produce plots run: | export TMPDIR=$RUNNER_TEMP - + module purge + module load Python/3.10.4-GCCcore-11.3.0 + . CI_env/bin/activate + DATAPATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH cat testpackage_gen_verf.txt - module purge - module load Python/3.10.4-GCCcore-11.3.0 + python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt From 857d8c73ca4e11b9f814fce6e968b6ea385bb9db Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 3 Nov 2025 10:23:38 +0200 Subject: [PATCH 133/341] Log exit code after job completion in script Add exit code logging to the test package script. --- testpackage/run_testpackage_generate_verf_set.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index adff83c5..2c7ec29b 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -21,3 +21,4 @@ python testpackage_colormap.py $jobcount $index python testpackage_vdf.py $jobcount $index echo Job $SLURM_ARRAY_TASK_ID complete. +echo "EXIT_CODE_FROM_JOB $?" From 2baca9dd173afae8563d737eef81c18f3c7aa392 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 3 Nov 2025 10:26:14 +0200 Subject: [PATCH 134/341] Update script to use relative paths for Python scripts --- testpackage/run_testpackage_generate_verf_set.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index 2c7ec29b..e4af295b 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -17,8 +17,8 @@ source CI_env/bin/activate export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 -python testpackage_colormap.py $jobcount $index -python testpackage_vdf.py $jobcount $index +python ./testpackage/testpackage_colormap.py $jobcount $index +python ./testpackage/testpackage_vdf.py $jobcount $index echo Job $SLURM_ARRAY_TASK_ID complete. echo "EXIT_CODE_FROM_JOB $?" From b5e7d44ecbfb27aafede3d2c99735ec994aaf9cf Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 3 Nov 2025 10:28:16 +0200 Subject: [PATCH 135/341] Add exit code logging to test package script --- testpackage/run_testpackage_generate_verf_set.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index e4af295b..ec126047 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -18,7 +18,10 @@ export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 python ./testpackage/testpackage_colormap.py $jobcount $index +echo "EXIT_CODE_FROM_JOB $?" + python ./testpackage/testpackage_vdf.py $jobcount $index -echo Job $SLURM_ARRAY_TASK_ID complete. echo "EXIT_CODE_FROM_JOB $?" +echo Job $SLURM_ARRAY_TASK_ID complete. + From 075639f3e6d0ccc9d67fed2494ac0c246e65a714 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 3 Nov 2025 10:55:03 +0200 Subject: [PATCH 136/341] made compare use latest verification set --- testpackage/run_compare.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index d06cb93c..08441788 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -1,8 +1,9 @@ #!/bin/bash -l +verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" -#verification set is from: 6.10.2025 (vdf 15.10.2025 from image_compare branch) -folder_1="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/380989e7fa7a331fb90c7ac6c496ebec6397dec9/$1/" +#gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) +folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$1/" folder_2="${PWD}/produced_plots/$1/" -python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" +#python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" From 28607dedcf23e1e1d5768db8f6fa3d527f6a6e3d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 3 Nov 2025 11:00:00 +0200 Subject: [PATCH 137/341] oops comment removed --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 08441788..9559a0b6 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -6,4 +6,4 @@ verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpacka #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$1/" folder_2="${PWD}/produced_plots/$1/" -#python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" +python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" From d249c086015f53837ca1ac598b25e89b9b758203 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 4 Nov 2025 11:42:51 +0200 Subject: [PATCH 138/341] general create_env fixes --- testpackage/create_env.py | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 8d650393..5c2c5b07 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -2,7 +2,8 @@ import venv import subprocess from sys import version_info as python_version_info - +from sys import version as python_version +import argparse @@ -35,13 +36,15 @@ def create_venv(path,install_analysator=True,editable=False): virt_env.create_configuration(context) virt_env.setup_scripts(context) + virt_env.post_setup(context) if install_analysator: - system_call(f'{path}/bin/pip install {'--editable' if editable else ''} ../',live_output=True) + editable='--editable' if editable else None + system_call(f'{path}/bin/pip install {editable} ../',live_output=True) print(f'Virtual environment created at {path}') return None -def create_venv_script(path,venv_name): +def create_venv_script(path,venv_path): if path[-1]!="/": path=path+"/" @@ -56,7 +59,7 @@ def create_venv_script(path,venv_name): if "source" in line[:6]: raise SystemError("source line already in pyvenv.sh!") - f.write(f"source {path+venv_name}/bin/activate\n") + f.write(f"source {venv_path}/bin/activate\n") f.close() else: #Create the file with the source line @@ -64,23 +67,37 @@ def create_venv_script(path,venv_name): f.write("module purge\n") if 'TURSO' in os.uname().nodename.upper(): f.write("export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH\n") + + #Get used python version and gcc version + #note that this may break if the version string format changes + #this is required so that the python module is loaded, otherwise python cannot be called outside the directory the venv is in + version_info = python_version.split(" ") + used_python_version = version_info[0] + used_gcc_version = version_info[-1].strip("[]") + f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") + f.write("module load ImageMagick/7.1.0-37-GCCcore-11.3.0\n") f.write("module list\n") - f.write(f"source {path+venv_name}/bin/activate\n") + f.write(f"source {venv_path}/bin/activate\n") f.close() if __name__ == "__main__": - - create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder) + #Will install python venv with same version as the python this script was called with + create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder) + parser=argparse.ArgumentParser(description='Create virtual environment for testpackage.') + parser.add_argument('--no-analysator',action='store_true',help='Do not install analysator.',default=False) + parser.add_argument('--editable','-e',action='store_true',help='Install analysator as editable',default=False) + args=parser.parse_args() + venv_name= 'venv_testpackage' - + venv_path = os.path.abspath('./'+venv_name) if not venv_name in os.listdir('.') and create_venv_local: print('venv_testpackage not found, creating virtual environment') - create_venv(venv_name,editable=True) - create_venv_script('./',venv_name) + create_venv(venv_path,editable=args.editable,install_analysator=not args.no_analysator) + create_venv_script('./',venv_path) else: print('venv_testpackage found, not creating virtual environment') From a587a9ecd140ec648c0f66fe5500c2741e8e6d6b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 4 Nov 2025 15:57:44 +0200 Subject: [PATCH 139/341] added tests for colormap3dslice (WIP) --- .../run_testpackage_colormap3dslice.sh | 20 + testpackage/testpackage_colormap3dslice.py | 457 ++++++++++++++++++ 2 files changed, 477 insertions(+) create mode 100644 testpackage/run_testpackage_colormap3dslice.sh create mode 100644 testpackage/testpackage_colormap3dslice.py diff --git a/testpackage/run_testpackage_colormap3dslice.sh b/testpackage/run_testpackage_colormap3dslice.sh new file mode 100644 index 00000000..12da7277 --- /dev/null +++ b/testpackage/run_testpackage_colormap3dslice.sh @@ -0,0 +1,20 @@ +#!/bin/bash -l +#SBATCH -t 00:30:00 +#SBATCH -J analysator_testpackage +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=0-1 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + +hostname +source ./pyvenv2.sh + +export PTNONINTERACTIVE=1 +export PTOUTPUTDIR=$PWD/ + +python testpackage_colormap3dslice.py $jobcount $index +echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py new file mode 100644 index 00000000..e66ed803 --- /dev/null +++ b/testpackage/testpackage_colormap3dslice.py @@ -0,0 +1,457 @@ +import analysator as pt +import sys, os +import numpy as np +import traceback + +datalocation = "/wrk/group/spacephysics/vlasiator" +runs = [] +runs.append( { 'name': 'FHA', + 'verifydir': 'testpackage_colormap3dslice/FHA/', + 'fileLocation': datalocation+'/3D/FHA/bulk1/', + 'fluxLocation': None, + 'pops': ['avgs'], + 'time': 1000, + 'singletime': False, + 'filename': None, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': True, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) + + +# Custom expression function +def exprMA_cust(exprmaps, requestvariables=False): + if vlasiator5 is True: + reqs = ['vg_va'] + else: + reqs = ['va'] + if requestvariables==True: + return reqs + # exprmaps is a dictionary of numpy arrays + # Each array has 2 dimensions [xsize, ysize] + # or 3 dimensions [xsize, ysize, components] + # here the function returns the M_A with a preset bulk velocity + custombulkspeed=1500000. # m/s + va = exprmaps[reqs[0]][:,:] + MA = np.ma.divide(custombulkspeed,va) + return MA + +# Second example of a more involved custom expression function +def expr_cav_cust(pass_maps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # This custom expression returns a map with values of + # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against + # time-averaged background values. This version doesn't do intelligent checks for the + # format of the incoming data. + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + + # Multiple time steps were found + ntimes = len(pass_maps) + dsteps = [x['dstep'] for x in pass_maps] + curri = dsteps.index(0) + thesemaps = pass_maps[curri] + + thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) + thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) + thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) + thisBmag = np.linalg.norm(thisB, axis=-1) + + avgrho = np.zeros(np.array(thisrho.shape)) + avgBmag = np.zeros(np.array(thisrho.shape)) + # avgbeta = np.zeros(np.array(thisrho.shape)) + + for i in range(ntimes): + if i==curri: # Exclude current frame from background value averaging + continue + nowmaps = pass_maps[i] + print(nowmaps['dstep']) + avgrho = np.add(avgrho, nowmaps[reqs[0]]) + avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) + avgBmag = np.add(avgBmag, avgBcalc) + # avgbeta = np.add(avgbeta, nowmaps[2]) + + avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) + avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) + #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) + + rhoratio = np.ma.divide(thisrho, avgrho) + Bmagratio = np.ma.divide(thisBmag, avgBmag) + #betaratio = np.divide(thisbeta, avgbeta) + + rhoratioreq = 0.9 + bmagratioreq = 0.9 + betashfareq = level_beta_SHFA + + # Calculations using masked arrays proved problematic so a less-than elegant method is used here. + empty = np.zeros(np.array(thisrho.shape))+0.0 + half = empty + 0.5 + one = empty + 1.0 + + caviton=np.zeros(empty.shape,dtype='float64') + np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) + print("sum of SHFA ",shfa.sum()) + + combo=np.zeros(empty.shape,dtype='float64') + np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) + print("sum of combo ",combo.sum()) + combo2=np.zeros(empty.shape,dtype='float64') + combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) + print("sum of combo2 ",combo2.sum()) + combo3 = combo+combo2 + print("sum of combo3 ",combo3.sum()) + + # Mask out anything that is inside the bow shock + combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) + print("sum of combo3 upstream ",combo3.sum()) + + return combo3 + + +# Second example of a more involved custom expression function +def timesmooth(pass_maps): + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # consists of a single [ysize,xsize] array to smooth over time + + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + ntimes = len(pass_maps) + print("this many time steps ",ntimes) + # Select first valid variable + listofkeys = iter(pass_maps[0]) + while True: + var = next(listofkeys) + if var!="dstep": break + + # Multiple time steps were found + avg = np.zeros(pass_maps[0][var].shape) + for i in range(ntimes): + avg = np.add(avg, pass_maps[i][var]) + return np.divide(avg, np.array([ntimes])) + +# Helper function for drawing on existing panel +def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + + rho = extmaps[reqs[0]] + beta = extmaps[reqs[2]] + # take magnitude of B + B = np.linalg.norm(extmaps[reqs[1]],axis=-1) + + # Colours to use + color_cavitons = '#924900' + color_SHFAs = '#B66DFF' + color_BS = '#FFFF6D' + + # mask cavitons + cavitons = np.ma.masked_greater_equal(B,level_B_caviton) + cavitons.mask[rho > level_n_caviton] = True + cavitons.fill_value = 0. + cavitons[cavitons.mask == False] = 1. + + # mask SHFAs + SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) + SHFAs.mask[rho > level_n_caviton] = True + SHFAs.mask[beta < level_beta_SHFA] = True + SHFAs.fill_value = 0. + SHFAs[SHFAs.mask == False] = 1. + + # draw contours + contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], + linewidths=1.2, colors=color_BS) + contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) + contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) + +regularcalls = [] +regularcalls=[] + +nonrestartcalls = [] + + +multipopcalls = [] + +v5regularcalls = [ +# Input and output methods, nooverwrite +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", + +# Thickness, scale +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", + +# msec musec titles +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + +# title, axes, noborders +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + +# Variables, operators, colormaps, usesci, lin, vscale +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", + +#coloarbar +#not yet in in master see PR #359 +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + +#AMR, fsaved +#Does not work currently, fix for the AMR contour is in PR #364 +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" + +] + +v5nonrestartcalls = [] + +v5multipopcalls = [] + +# For handier debugging, uncomment these to overwrite call lists and include only relevant calls +# regularcalls = [] +# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +# ] +# multipopcalls = [] +# v5regularcalls = [] +# v5nonrestartcalls = [] +# v5multipopcalls = [] + +# Construct test list +calls = [] +callrunids = [] +callrunindex = [] +for i,run in enumerate(runs): + # bulk and restart files + vlasiator5 = run['vlasiator5'] + filename = run['filename'] + fileLocation = run['fileLocation'] + singletime = run['singletime'] + nosubpops = run['nosubpops'] + fluxLocation = run['fluxLocation'] + + callindex = 0 + if vlasiator5: + for call in v5regularcalls: + if not filename is None: + call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + else: + for call in regularcalls: + if not filename is None: + call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + # non-restart files + if filename is None: + if vlasiator5: + for call in v5nonrestartcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + for pop in run['pops']: + if pop != 'avgs': + for call in v5multipopcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + else: + for call in nonrestartcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + for pop in run['pops']: + if pop != 'avgs': + for call in multipopcalls: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + +nteststot = len(callrunids) + + + +# How many jobs? +jobcount=int(sys.argv[1]) +jobcurr=int(sys.argv[2]) +increment = int(nteststot/jobcount) +remainder = nteststot - jobcount * increment +start=jobcurr * increment +end=start + increment +# Remainder frames are divvied out evenly among tasks +if jobcurr < remainder: + start = start + jobcurr + end = end + jobcurr + 1 +else: + start = start + remainder + end = end + remainder + + +# Perform call +for j in range(start,end): + # Calculate which run + jrun = callrunindex[j] + runid = callrunids[j] + call = calls[j] + + runname = runs[runid]['name'] + verifydir = runs[runid]['verifydir'] + fileLocation = runs[runid]['fileLocation'] + fluxLocation = runs[runid]['fluxLocation'] + pops = runs[runid]['pops'] + time = runs[runid]['time'] + filename = runs[runid]['filename'] + vlasiator5 = runs[runid]['vlasiator5'] + singletime = runs[runid]['singletime'] + + level_bow_shock = runs[runid]['cavitonparams'][0] + level_n_caviton = runs[runid]['cavitonparams'][1] + level_B_caviton = runs[runid]['cavitonparams'][2] + level_beta_SHFA = runs[runid]['cavitonparams'][3] + + outputLocation=pt.plot.defaultoutputdir+verifydir + + # Source data files + if filename is None: + bulkname = "bulk1."+str(time).rjust(7,'0')+".vlsv" + else: + bulkname = filename + if 'fluxprefix' in runs[runid]: + fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" + else: + fluxname = "flux."+str(time).rjust(7,'0')+".bin" + + call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") + call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") + call = call.replace('REPLACETIME',"'"+str(time)+"'") + + # Many different plots + print(j, runid, jrun, call) + f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) + try: + exec(call) + except Exception as e: + print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) + + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") From 76895825222f5ee39caff9d3cc0a6a44bb2fa056 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 4 Nov 2025 16:05:12 +0200 Subject: [PATCH 140/341] added more tests and changed back the array parameter to higher number so test doesnt take 10 years to test --- testpackage/run_testpackage_colormap3dslice.sh | 2 +- testpackage/testpackage_colormap3dslice.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_colormap3dslice.sh b/testpackage/run_testpackage_colormap3dslice.sh index 12da7277..7cb415e1 100644 --- a/testpackage/run_testpackage_colormap3dslice.sh +++ b/testpackage/run_testpackage_colormap3dslice.sh @@ -3,7 +3,7 @@ #SBATCH -J analysator_testpackage #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=0-1 +#SBATCH --array=0-10 #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index e66ed803..bb53654d 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -265,6 +265,17 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", + +# Streamlines, vectors +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", + + #coloarbar #not yet in in master see PR #359 #"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", From a43b72fba708d3c5c6eb4387ce1c378261892bc9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 4 Nov 2025 16:38:43 +0200 Subject: [PATCH 141/341] some vectortests --- testpackage/testpackage_colormap3dslice.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index bb53654d..28a76f6c 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -267,16 +267,21 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # Streamlines, vectors -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", + "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", -#coloarbar + +#colorbar #not yet in in master see PR #359 #"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", @@ -287,7 +292,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] - v5nonrestartcalls = [] v5multipopcalls = [] From a84cce546968de211095f2871736e83546344a04 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 4 Nov 2025 17:57:14 +0200 Subject: [PATCH 142/341] more variable tests? --- testpackage/testpackage_colormap3dslice.py | 60 +++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index 28a76f6c..3c449543 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -3,7 +3,7 @@ import numpy as np import traceback -datalocation = "/wrk/group/spacephysics/vlasiator" +datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] runs.append( { 'name': 'FHA', 'verifydir': 'testpackage_colormap3dslice/FHA/', @@ -280,6 +280,54 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", + + +#bunch of reducers +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", #colorbar #not yet in in master see PR #359 @@ -292,6 +340,14 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] +''' +v5regularcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)" +] +''' v5nonrestartcalls = [] v5multipopcalls = [] @@ -461,7 +517,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): call = call.replace('REPLACETIME',"'"+str(time)+"'") # Many different plots - print(j, runid, jrun, call) + print(j, runid, jrun, call,fileLocation+bulkname) f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: exec(call) From f52072be6a7b28ea14df8cdb6b98393c44d0db36 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 5 Nov 2025 09:55:15 +0200 Subject: [PATCH 143/341] comment reminder --- testpackage/testpackage_colormap3dslice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index 3c449543..215c2873 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -286,7 +286,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", -#bunch of reducers +#bunch of reducers, none of the thermals worked? #"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", #"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", From 689019e8280bd490e69af923ef13c6bbb74d1fd8 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 5 Nov 2025 15:37:42 +0200 Subject: [PATCH 144/341] testpackage changes headache --- testpackage/testpackage_colormap3dslice.py | 148 +++++++++++++++------ 1 file changed, 105 insertions(+), 43 deletions(-) diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index 215c2873..d5f21973 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -12,8 +12,8 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming + 'filename': None, #restart file + 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) @@ -206,7 +206,18 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): multipopcalls = [] -v5regularcalls = [ +v5restartcalls = [ + +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" + +] + + + + +v5nonrestartcalls = [ + + # Input and output methods, nooverwrite "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX)", @@ -265,65 +276,85 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", +# Everything at once +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", # Streamlines, vectors "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", - "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", - "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", - "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", - -#bunch of reducers, none of the thermals worked? -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", + + +# More data reducers +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", @@ -340,17 +371,48 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] -''' -v5regularcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)" -] -''' -v5nonrestartcalls = [] -v5multipopcalls = [] + +v5multipopcalls= [ +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" +] # For handier debugging, uncomment these to overwrite call lists and include only relevant calls # regularcalls = [] @@ -376,7 +438,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): callindex = 0 if vlasiator5: - for call in v5regularcalls: + for call in v5restartcalls: if not filename is None: call = call.replace("var='V'","var='restart_V'") callrunids.append(i) From ce5fb6ae55c2cccf8bc9fc570034ae95b79333ae Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 6 Nov 2025 15:32:09 +0200 Subject: [PATCH 145/341] testpackage_colormap restructuring --- testpackage/testpackage_colormap.py | 133 +++++++++++----------------- 1 file changed, 53 insertions(+), 80 deletions(-) diff --git a/testpackage/testpackage_colormap.py b/testpackage/testpackage_colormap.py index 67ac67a5..ceaf7a87 100644 --- a/testpackage/testpackage_colormap.py +++ b/testpackage/testpackage_colormap.py @@ -789,7 +789,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # v5nonrestartcalls = [] # v5multipopcalls = [] -# Construct test list +#construct calls calls = [] callrunids = [] callrunindex = [] @@ -801,95 +801,68 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): singletime = run['singletime'] nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - callindex = 0 - if vlasiator5: - for call in v5regularcalls: - if not filename is None: + + calls_in=v5regularcalls if vlasiator5 else regularcalls + for call in calls_in: + if not filename is None: + if vlasiator5: + call = call.replace("var='vg_v'","var='vg_restart_v'") + else: call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + + # non-restart files + if filename is None: + #non restart calls + calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls + for call in calls_in: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + callrunids.append(i) calls.append(call) callrunindex.append(callindex) callindex += 1 - else: - for call in regularcalls: - if not filename is None: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - # non-restart files - if filename is None: - if vlasiator5: - for call in v5nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in v5multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - else: - for call in nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 + + #multipop calls + calls_in=v5multipopcalls if vlasiator5 else multipopcalls + for pop in run['pops']: + if pop != 'avgs': + for call in calls_in: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + nteststot = len(callrunids) - # How many jobs? jobcount=int(sys.argv[1]) jobcurr=int(sys.argv[2]) From fe03166fba39d95e25f0a21bc49128e4d1cb6a5b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 6 Nov 2025 15:32:48 +0200 Subject: [PATCH 146/341] added testpackage_commons , work in progress way of potentially doing all the testpackage calls with just one script --- testpackage/testpackage_commons.py | 676 +++++++++++++++++++++++++++++ 1 file changed, 676 insertions(+) create mode 100644 testpackage/testpackage_commons.py diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py new file mode 100644 index 00000000..191cdb90 --- /dev/null +++ b/testpackage/testpackage_commons.py @@ -0,0 +1,676 @@ +import analysator as pt +import sys, os +import numpy as np +import traceback +import inspect +import logging +import re + +datalocation = "/wrk-vakka/group/spacephysics/vlasiator" +runs = [] +runs.append( { 'name': 'FHA', + 'verifydir': '/FHA/', + 'fileLocation': datalocation+'/3D/FHA/bulk1/', + 'fluxLocation': None, + 'funcs': ['plot_colormap3dslice','plot_ionosphere'], + 'pops': ['avgs'], + 'time': 1000, + 'singletime': False, + 'filename': None, #restart file + 'manualcall':False, + 'nosubpops': True, # backstreaming / non-backstreaming + 'vlasiator5': True, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) + +runs.append( { 'name': 'BCQ', + 'verifydir': '/BCQ/', + 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/bulk/', + 'fluxLocation': None, + 'singletime': False, + 'pops': ['avgs'], + 'funcs': ['plot_colormap','plot_vdf'], + 'manualcall':False, + 'time': 1600, + 'filename': None, + 'vlasiator5':False, + 'nosubpops':False, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] + } ) + +# Custom expression function +def exprMA_cust(exprmaps, requestvariables=False): + if vlasiator5 is True: + reqs = ['vg_va'] + else: + reqs = ['va'] + if requestvariables==True: + return reqs + # exprmaps is a dictionary of numpy arrays + # Each array has 2 dimensions [xsize, ysize] + # or 3 dimensions [xsize, ysize, components] + # here the function returns the M_A with a preset bulk velocity + custombulkspeed=1500000. # m/s + va = exprmaps[reqs[0]][:,:] + MA = np.ma.divide(custombulkspeed,va) + return MA + +# Second example of a more involved custom expression function +def expr_cav_cust(pass_maps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # This custom expression returns a map with values of + # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against + # time-averaged background values. This version doesn't do intelligent checks for the + # format of the incoming data. + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + + # Multiple time steps were found + ntimes = len(pass_maps) + dsteps = [x['dstep'] for x in pass_maps] + curri = dsteps.index(0) + thesemaps = pass_maps[curri] + + thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) + thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) + thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) + thisBmag = np.linalg.norm(thisB, axis=-1) + + avgrho = np.zeros(np.array(thisrho.shape)) + avgBmag = np.zeros(np.array(thisrho.shape)) + # avgbeta = np.zeros(np.array(thisrho.shape)) + + for i in range(ntimes): + if i==curri: # Exclude current frame from background value averaging + continue + nowmaps = pass_maps[i] + print(nowmaps['dstep']) + avgrho = np.add(avgrho, nowmaps[reqs[0]]) + avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) + avgBmag = np.add(avgBmag, avgBcalc) + # avgbeta = np.add(avgbeta, nowmaps[2]) + + avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) + avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) + #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) + + rhoratio = np.ma.divide(thisrho, avgrho) + Bmagratio = np.ma.divide(thisBmag, avgBmag) + #betaratio = np.divide(thisbeta, avgbeta) + + rhoratioreq = 0.9 + bmagratioreq = 0.9 + betashfareq = level_beta_SHFA + + # Calculations using masked arrays proved problematic so a less-than elegant method is used here. + empty = np.zeros(np.array(thisrho.shape))+0.0 + half = empty + 0.5 + one = empty + 1.0 + + caviton=np.zeros(empty.shape,dtype='float64') + np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) + print("sum of SHFA ",shfa.sum()) + + combo=np.zeros(empty.shape,dtype='float64') + np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) + print("sum of combo ",combo.sum()) + combo2=np.zeros(empty.shape,dtype='float64') + combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) + print("sum of combo2 ",combo2.sum()) + combo3 = combo+combo2 + print("sum of combo3 ",combo3.sum()) + + # Mask out anything that is inside the bow shock + combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) + print("sum of combo3 upstream ",combo3.sum()) + + return combo3 + + +# Second example of a more involved custom expression function +def timesmooth(pass_maps): + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # consists of a single [ysize,xsize] array to smooth over time + + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + ntimes = len(pass_maps) + print("this many time steps ",ntimes) + # Select first valid variable + listofkeys = iter(pass_maps[0]) + while True: + var = next(listofkeys) + if var!="dstep": break + + # Multiple time steps were found + avg = np.zeros(pass_maps[0][var].shape) + for i in range(ntimes): + avg = np.add(avg, pass_maps[i][var]) + return np.divide(avg, np.array([ntimes])) + +# Helper function for drawing on existing panel +def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + + rho = extmaps[reqs[0]] + beta = extmaps[reqs[2]] + # take magnitude of B + B = np.linalg.norm(extmaps[reqs[1]],axis=-1) + + # Colours to use + color_cavitons = '#924900' + color_SHFAs = '#B66DFF' + color_BS = '#FFFF6D' + + # mask cavitons + cavitons = np.ma.masked_greater_equal(B,level_B_caviton) + cavitons.mask[rho > level_n_caviton] = True + cavitons.fill_value = 0. + cavitons[cavitons.mask == False] = 1. + + # mask SHFAs + SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) + SHFAs.mask[rho > level_n_caviton] = True + SHFAs.mask[beta < level_beta_SHFA] = True + SHFAs.fill_value = 0. + SHFAs[SHFAs.mask == False] = 1. + + # draw contours + contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], + linewidths=1.2, colors=color_BS) + contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) + contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) + +regularcalls=[ + # cellids, coordinates +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", +] + +nonrestartcalls = [] + + +multipopcalls = [] + +v5restartcalls = [ + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" + +] + + + + +v5nonrestartcalls = [ + + +# Input and output methods, nooverwrite +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", + +# Thickness, scale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", + +# msec musec titles +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + +# title, axes, noborders +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + +# Variables, operators, colormaps, usesci, lin, vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", + +# Zoom and units +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + +# Externals and expressions +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", + + +# Everything at once +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", + + +# More data reducers +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", + +#colorbar +#not yet in in master see PR #359 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + +#AMR, fsaved +#Does not work currently, fix for the AMR contour is in PR #364 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" + +] + +v5multipopcalls= [ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" +] + +manualcalls=[ + "pt.plot.colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" +] +#keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop + +# For handier debugging, uncomment these to overwrite call lists and include only relevant calls +# regularcalls = [] +# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +# ] +# multipopcalls = [] +# v5regularcalls = [] +# v5nonrestartcalls = [] +# v5multipopcalls = [] + +def call_replace(call,func): + call=call.replace('REPLACEFUNC',func) + + #Get the arguments of the call + args = re.search(r'\((.+)\)',call).group(1) + args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] + #Get parameters of the func + function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args + #Remove args that are not present as parameters for the func + args_out=[] + for arg in args: + if arg: + if arg.split("=")[0] in function_pars: + args_out.append(arg) + else: + logging.warning(f"Argument {arg} removed from call {call}") + + call=call[:call.rfind("(")+1]+",".join(args_out)+")" + + return call + + + +#construct calls +calls = [] +callrunids = [] +callrunindex = [] +funcids=[] +for i,run in enumerate(runs): + # bulk and restart files + vlasiator5 = run['vlasiator5'] + filename = run['filename'] + fileLocation = run['fileLocation'] + singletime = run['singletime'] + nosubpops = run['nosubpops'] + fluxLocation = run['fluxLocation'] + functions = run['funcs'] + + callindex = 0 + if run['manualcall']: + for call in manualcalls: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + + for j,func in enumerate(functions): + calls_in=v5restartcalls if vlasiator5 else regularcalls + for call in calls_in: + funcids.append(j) + call=call_replace(call,func) + if func == "plot_vdf" and ('cellids' not in call and 'coordinates' not in call and 'coordsre' not in call): + continue + if not filename is None: + if vlasiator5: + call = call.replace("var='vg_v'","var='vg_restart_v'") + else: + call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + + # non-restart files + if filename is None: + #non restart calls + calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls + for call in calls_in: + funcids.append(j) + call=call_replace(call,func) + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + + #multipop calls + calls_in=v5multipopcalls if vlasiator5 else multipopcalls + for pop in run['pops']: + if pop != 'avgs': + for call in calls_in: + funcids.append(j) + call=call_replace(call,func) + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + + +nteststot = len(callrunids) + +# How many jobs? +jobcount=int(sys.argv[1]) +jobcurr=int(sys.argv[2]) +increment = int(nteststot/jobcount) +remainder = nteststot - jobcount * increment +start=jobcurr * increment +end=start + increment +# Remainder frames are divvied out evenly among tasks +if jobcurr < remainder: + start = start + jobcurr + end = end + jobcurr + 1 +else: + start = start + remainder + end = end + remainder + + +# Perform call +for j in range(start,end): + # Calculate which run + jrun = callrunindex[j] + runid = callrunids[j] + call = calls[j] + + funcid=funcids[j] + + runname = runs[runid]['name'] + func = runs[runid]['funcs'][funcid] + verifydir = func+runs[runid]['verifydir'] + fileLocation = runs[runid]['fileLocation'] + fluxLocation = runs[runid]['fluxLocation'] + pops = runs[runid]['pops'] + time = runs[runid]['time'] + filename = runs[runid]['filename'] + vlasiator5 = runs[runid]['vlasiator5'] + singletime = runs[runid]['singletime'] + + level_bow_shock = runs[runid]['cavitonparams'][0] + level_n_caviton = runs[runid]['cavitonparams'][1] + level_B_caviton = runs[runid]['cavitonparams'][2] + level_beta_SHFA = runs[runid]['cavitonparams'][3] + + verifydir=os.path.join("testpackage_run",verifydir) + outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) + + if func == "plot_ionosphere" and "var='vg_" in call: + print(f"skipped call {j}") + continue + + # Source data files + if filename is None: + if '2D' not in fileLocation: + bulkname = "bulk1."+str(time).rjust(7,'0')+".vlsv" + else: + bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" + else: + bulkname = filename + if 'fluxprefix' in runs[runid]: + fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" + else: + fluxname = "flux."+str(time).rjust(7,'0')+".bin" + + + if run=="ABC": + bulkname = "distributions."+str(time).rjust(7,'0')+".vlsv" + + + call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") + call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") + call = call.replace('REPLACETIME',"'"+str(time)+"'") + + call = call.replace('REPLACECELLID','1') + call = call.replace('REPLACECOORDRE','[10,0,0]') + call = call.replace('REPLACECOORDINATES','[6.371e7,0,0]') + call = call.replace('REPLACEMULTIPLECELLID','[1,51,101]') + call = call.replace('REPLACEMULTIPLECOORDRE','[[10,0,0],[15,0,0],[20,0,0]]') + call = call.replace('REPLACEMULTIPLECOORDINATES','[[6.371e7,0,0],[9.5565e7,0,0],[12.742e7,0,0]]') + + + # Many different plots + print(j, runid, jrun, call,fileLocation+bulkname) + f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) + try: + exec(call) + except Exception as e: + print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) + + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") From 8cbb9eeaa83cd284f9ddca734c7186bf578662e7 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 6 Nov 2025 15:57:50 +0200 Subject: [PATCH 147/341] restructuring of testpackage_colormap3dslice based on what was done to colormap --- testpackage/testpackage_colormap3dslice.py | 158 ++++++++++----------- 1 file changed, 76 insertions(+), 82 deletions(-) diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py index d5f21973..eb994b21 100644 --- a/testpackage/testpackage_colormap3dslice.py +++ b/testpackage/testpackage_colormap3dslice.py @@ -198,8 +198,8 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) -regularcalls = [] -regularcalls=[] + +restartcalls=[] nonrestartcalls = [] @@ -273,8 +273,24 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", + +# Zoom and units +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + +# Externals and expressions +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", + # Everything at once "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", @@ -318,6 +334,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # More data reducers "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", @@ -368,6 +385,8 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): #Does not work currently, fix for the AMR contour is in PR #364 #"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] @@ -424,6 +443,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # v5multipopcalls = [] # Construct test list +#construct calls calls = [] callrunids = [] callrunindex = [] @@ -435,90 +455,64 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): singletime = run['singletime'] nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - callindex = 0 - if vlasiator5: - for call in v5restartcalls: - if not filename is None: + + calls_in=v5restartcalls if vlasiator5 else restartcalls + for call in calls_in: + if not filename is None: + if vlasiator5: + call = call.replace("var='vg_v'","var='vg_restart_v'") + else: call = call.replace("var='V'","var='restart_V'") + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + + # non-restart files + if filename is None: + #non restart calls + calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls + for call in calls_in: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + callrunids.append(i) calls.append(call) callrunindex.append(callindex) callindex += 1 - else: - for call in regularcalls: - if not filename is None: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - # non-restart files - if filename is None: - if vlasiator5: - for call in v5nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in v5multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - else: - for call in nonrestartcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - for pop in run['pops']: - if pop != 'avgs': - for call in multipopcalls: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 + + #multipop calls + calls_in=v5multipopcalls if vlasiator5 else multipopcalls + for pop in run['pops']: + if pop != 'avgs': + for call in calls_in: + # Skip flux function calls if no flux files + if "flux" in call and fluxLocation is None: + continue + # skip time integration if only one file available + if "pass_times" in call and singletime: + continue + # thermal / non-thermal subpopulations + if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: + continue + elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: + continue + mpcall = call.replace('REPLACEPOP',pop) + callrunids.append(i) + calls.append(mpcall) + callrunindex.append(callindex) + callindex += 1 + nteststot = len(callrunids) From e82f789300833b52d8a0060f41f4d8ff360812c9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 6 Nov 2025 16:52:03 +0200 Subject: [PATCH 148/341] added a way to skip variables 'var' in calls --- testpackage/testpackage_commons.py | 61 +++++++++++++++++++----------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 191cdb90..18250946 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -16,6 +16,7 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, + 'skipped_vars':{'plot_ionosphere':'vg_'}, 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming @@ -31,6 +32,7 @@ 'funcs': ['plot_colormap','plot_vdf'], 'manualcall':False, 'time': 1600, + 'skipped_vars':None, 'filename': None, 'vlasiator5':False, 'nosubpops':False, @@ -311,7 +313,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", @@ -472,7 +474,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # v5nonrestartcalls = [] # v5multipopcalls = [] -def call_replace(call,func): +def call_replace(call,func,skipped_vars): call=call.replace('REPLACEFUNC',func) #Get the arguments of the call @@ -484,7 +486,9 @@ def call_replace(call,func): args_out=[] for arg in args: if arg: - if arg.split("=")[0] in function_pars: + if skipped_vars and func in skipped_vars.keys() and skipped_vars[func] in arg.split("=")[1]: + continue + elif arg.split("=")[0] in function_pars: args_out.append(arg) else: logging.warning(f"Argument {arg} removed from call {call}") @@ -500,6 +504,7 @@ def call_replace(call,func): callrunids = [] callrunindex = [] funcids=[] +offset=0 for i,run in enumerate(runs): # bulk and restart files vlasiator5 = run['vlasiator5'] @@ -509,10 +514,13 @@ def call_replace(call,func): nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] functions = run['funcs'] + skipped_vars=run['skipped_vars'] + callindex = 0 if run['manualcall']: for call in manualcalls: + funcids.append(-1) callrunids.append(i) calls.append(call) callrunindex.append(callindex) @@ -522,7 +530,7 @@ def call_replace(call,func): calls_in=v5restartcalls if vlasiator5 else regularcalls for call in calls_in: funcids.append(j) - call=call_replace(call,func) + call=call_replace(call,func,skipped_vars) if func == "plot_vdf" and ('cellids' not in call and 'coordinates' not in call and 'coordsre' not in call): continue if not filename is None: @@ -530,10 +538,12 @@ def call_replace(call,func): call = call.replace("var='vg_v'","var='vg_restart_v'") else: call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 + + if call not in calls: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 # non-restart files if filename is None: @@ -541,7 +551,7 @@ def call_replace(call,func): calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls for call in calls_in: funcids.append(j) - call=call_replace(call,func) + call=call_replace(call,func,skipped_vars) # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue @@ -553,19 +563,19 @@ def call_replace(call,func): continue elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue - - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - + if call not in calls: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + #multipop calls calls_in=v5multipopcalls if vlasiator5 else multipopcalls for pop in run['pops']: if pop != 'avgs': for call in calls_in: funcids.append(j) - call=call_replace(call,func) + call=call_replace(call,func,skipped_vars) # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue @@ -578,10 +588,11 @@ def call_replace(call,func): elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 + if call not in calls: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 nteststot = len(callrunids) @@ -609,11 +620,13 @@ def call_replace(call,func): runid = callrunids[j] call = calls[j] - funcid=funcids[j] + funcid=funcids[jrun] #offset due to manualcalls runname = runs[runid]['name'] + func = runs[runid]['funcs'][funcid] verifydir = func+runs[runid]['verifydir'] + fileLocation = runs[runid]['fileLocation'] fluxLocation = runs[runid]['fluxLocation'] pops = runs[runid]['pops'] @@ -629,7 +642,7 @@ def call_replace(call,func): verifydir=os.path.join("testpackage_run",verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) - + if func == "plot_ionosphere" and "var='vg_" in call: print(f"skipped call {j}") continue @@ -674,3 +687,7 @@ def call_replace(call,func): traceback.print_exc() print("END TRACE for call",j,"\n----------------------------") + +#add way to specify which function to test +#add a way to add expections to variables etc easily. +#currenlty does multiple calls From 23ac2fd56fd5411be44952cb9c7b7a6251e01152 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 7 Nov 2025 12:07:07 +0200 Subject: [PATCH 149/341] More enhancements to the testpackage_commons --- testpackage/testpackage_commons.py | 241 ++++++++++++++++++++++++++--- 1 file changed, 217 insertions(+), 24 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 18250946..bfd71e0e 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -8,6 +8,19 @@ datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] + + +#required args for functions, lists are handled as OR statements, tuples within lists as AND +#add a way to add required args automatically + +required_args ={ + "plot_vdf":["coordre","coordinates","cellids"] + + + +} + + runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', @@ -16,13 +29,14 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, - 'skipped_vars':{'plot_ionosphere':'vg_'}, + 'skipped_args':{'plot_ionosphere':{'var':'vg_'}}, 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) + runs.append( { 'name': 'BCQ', 'verifydir': '/BCQ/', 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/bulk/', @@ -32,7 +46,7 @@ 'funcs': ['plot_colormap','plot_vdf'], 'manualcall':False, 'time': 1600, - 'skipped_vars':None, + 'skipped_args':None, 'filename': None, 'vlasiator5':False, 'nosubpops':False, @@ -229,7 +243,161 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", ] -nonrestartcalls = [] +nonrestartcalls = [ +# Overplots and flux lines +"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", + +# Vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", + +# Symlog and vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", + +# Zoom and units +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + +# Externals and expressions +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", + +# Everything at once +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", + + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", + +# More data reducers +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] multipopcalls = [] @@ -474,21 +642,42 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # v5nonrestartcalls = [] # v5multipopcalls = [] -def call_replace(call,func,skipped_vars): +def call_replace(call,func,skipped_args): + #This is kind of scuffed maybe + call=call.replace('REPLACEFUNC',func) #Get the arguments of the call args = re.search(r'\((.+)\)',call).group(1) args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] + named_parameters=[arg.split("=")[0] for arg in args] + #Get parameters of the func function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args #Remove args that are not present as parameters for the func args_out=[] + + #check that all required func args are set + if required_args and func in required_args.keys(): + required_params=required_args[func] + check=False + for param in required_params: + if any((all(r in named_parameters for r in param),(param in named_parameters))): + check=True + break + if not check: + #print("REQUIRED",call,named_parameters,required_params) + return None + + #add execption for tuple? for arg in args: if arg: - if skipped_vars and func in skipped_vars.keys() and skipped_vars[func] in arg.split("=")[1]: - continue - elif arg.split("=")[0] in function_pars: + if skipped_args and func in skipped_args.keys(): + skipped_args_dict=skipped_args[func] + call_args=arg.split("=") + if call_args[0] in skipped_args_dict.keys() and skipped_args_dict[call_args[0]] in call_args[1]: + continue + if arg.split("=")[0] in function_pars: args_out.append(arg) else: logging.warning(f"Argument {arg} removed from call {call}") @@ -514,7 +703,7 @@ def call_replace(call,func,skipped_vars): nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] functions = run['funcs'] - skipped_vars=run['skipped_vars'] + skipped_args=run['skipped_args'] callindex = 0 @@ -529,9 +718,8 @@ def call_replace(call,func,skipped_vars): for j,func in enumerate(functions): calls_in=v5restartcalls if vlasiator5 else regularcalls for call in calls_in: - funcids.append(j) - call=call_replace(call,func,skipped_vars) - if func == "plot_vdf" and ('cellids' not in call and 'coordinates' not in call and 'coordsre' not in call): + call=call_replace(call,func,skipped_args) + if not call: continue if not filename is None: if vlasiator5: @@ -544,14 +732,18 @@ def call_replace(call,func,skipped_vars): calls.append(call) callrunindex.append(callindex) callindex += 1 + funcids.append(j) + # non-restart files if filename is None: #non restart calls calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls for call in calls_in: - funcids.append(j) - call=call_replace(call,func,skipped_vars) + + call=call_replace(call,func,skipped_args) + if not call: + continue # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue @@ -568,14 +760,17 @@ def call_replace(call,func,skipped_vars): calls.append(call) callrunindex.append(callindex) callindex += 1 + funcids.append(j) #multipop calls calls_in=v5multipopcalls if vlasiator5 else multipopcalls for pop in run['pops']: if pop != 'avgs': for call in calls_in: - funcids.append(j) - call=call_replace(call,func,skipped_vars) + + call=call_replace(call,func,skipped_args) + if not call: + continue # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue @@ -593,7 +788,7 @@ def call_replace(call,func,skipped_vars): calls.append(call) callrunindex.append(callindex) callindex += 1 - + funcids.append(j) nteststot = len(callrunids) @@ -620,7 +815,7 @@ def call_replace(call,func,skipped_vars): runid = callrunids[j] call = calls[j] - funcid=funcids[jrun] #offset due to manualcalls + funcid=funcids[j] runname = runs[runid]['name'] @@ -643,10 +838,6 @@ def call_replace(call,func,skipped_vars): verifydir=os.path.join("testpackage_run",verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) - if func == "plot_ionosphere" and "var='vg_" in call: - print(f"skipped call {j}") - continue - # Source data files if filename is None: if '2D' not in fileLocation: @@ -681,7 +872,8 @@ def call_replace(call,func,skipped_vars): print(j, runid, jrun, call,fileLocation+bulkname) f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - exec(call) + #exec(call) + print(call) except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) @@ -689,5 +881,6 @@ def call_replace(call,func,skipped_vars): print("END TRACE for call",j,"\n----------------------------") #add way to specify which function to test -#add a way to add expections to variables etc easily. -#currenlty does multiple calls +#add a way to add expections to variables etc easily. (DONE) +#currenlty does multiple calls (Fixed with list but still needs better implementation as we waste bit of time going through multiple things) +#add manual calls (DONE) From bcab7ad100ed3e9828914b8bfb0e054e9d28e5e6 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 7 Nov 2025 16:41:59 +0200 Subject: [PATCH 150/341] many more additions to the new testpackage sript --- testpackage/testpackage_commons.py | 100 ++++++++++++++++++++++++++--- 1 file changed, 91 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index bfd71e0e..87b11ebf 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -13,8 +13,10 @@ #required args for functions, lists are handled as OR statements, tuples within lists as AND #add a way to add required args automatically +#tuple, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults + required_args ={ - "plot_vdf":["coordre","coordinates","cellids"] + "plot_vdf":(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]) @@ -400,7 +402,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] -multipopcalls = [] +multipopcalls = ["pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] v5restartcalls = [ @@ -433,6 +435,8 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # Tick interval "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", # msec musec titles "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", @@ -446,6 +450,9 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + + + # title, axes, noborders "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", @@ -477,6 +484,64 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + + +# slicethick (Mostly for vdf,vdf_prof,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", +# cellsize (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", +# fmin, fmax, setThreshold (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", +# Biglabels(vdf,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", +# cbulk, center, bvector(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + +# wflux(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +# directions(about same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", + + +# colormaps +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", + + # Externals and expressions "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", @@ -629,7 +694,11 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): ] manualcalls=[ - "pt.plot.colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" + "pt.plot.colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')", + +#plot_vdf manual calls + "pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)" + ] #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop @@ -656,10 +725,10 @@ def call_replace(call,func,skipped_args): function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args #Remove args that are not present as parameters for the func args_out=[] - #check that all required func args are set if required_args and func in required_args.keys(): - required_params=required_args[func] + required_params=required_args[func][0] + default_params=required_args[func][1] check=False for param in required_params: if any((all(r in named_parameters for r in param),(param in named_parameters))): @@ -667,7 +736,16 @@ def call_replace(call,func,skipped_args): break if not check: #print("REQUIRED",call,named_parameters,required_params) - return None + + #Add parameters if there are default_params + if default_params: + for param in default_params: + args_out.append(param) + #print("ADDED",param,call) + else: + #print("NOT ADDED",call) + return None + #add execption for tuple? for arg in args: @@ -681,7 +759,9 @@ def call_replace(call,func,skipped_args): args_out.append(arg) else: logging.warning(f"Argument {arg} removed from call {call}") - + + if not args_out: + return None call=call[:call.rfind("(")+1]+",".join(args_out)+")" return call @@ -872,8 +952,8 @@ def call_replace(call,func,skipped_args): print(j, runid, jrun, call,fileLocation+bulkname) f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - #exec(call) - print(call) + exec(call) + #print(call) except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) @@ -884,3 +964,5 @@ def call_replace(call,func,skipped_args): #add a way to add expections to variables etc easily. (DONE) #currenlty does multiple calls (Fixed with list but still needs better implementation as we waste bit of time going through multiple things) #add manual calls (DONE) +#why spend time going through all calls on all threads? +#v5 vdf?? \ No newline at end of file From da187904dfa34b3ea8382a38b4dae3cf8679b9e9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 10 Nov 2025 12:58:50 +0200 Subject: [PATCH 151/341] added agnostic calls --- testpackage/testpackage_commons.py | 296 +++++++++++++++-------------- 1 file changed, 155 insertions(+), 141 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 87b11ebf..16221892 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -236,16 +236,74 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) regularcalls=[ - # cellids, coordinates +] + +#This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake +agnostic_call = [ + +# cellids, coordinates "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", -] -nonrestartcalls = [ +# Input and output methods, nooverwrite +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", + + + +# Thickness, scale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", + +# msec musec titles +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + + + + +# title, axes, noborders +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + + + # Overplots and flux lines "pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", @@ -254,6 +312,96 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", +# Vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", + + +# Zoom and units +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + + +# slicethick (Mostly for vdf,vdf_prof,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", +# cellsize (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", +# fmin, fmax, setThreshold (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", +# Biglabels(vdf,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", +# cbulk, center, bvector(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + +# wflux(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +# directions(about same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", + + + +# colormaps +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", + +#colorbar +#not yet in in master see PR #359 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + +#AMR, fsaved +#Does not work currently, fix for the AMR contour is in PR #364 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", +] + +nonrestartcalls = [ + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", @@ -270,10 +418,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", -# Vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", @@ -285,13 +429,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", -# Zoom and units -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - # Externals and expressions "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", @@ -414,58 +551,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): v5nonrestartcalls = [ - - -# Input and output methods, nooverwrite -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", - -# Thickness, scale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", - -# msec musec titles -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - - - - -# title, axes, noborders -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - # Variables, operators, colormaps, usesci, lin, vscale "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", @@ -477,70 +562,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", -# Zoom and units -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - - - -# slicethick (Mostly for vdf,vdf_prof,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", -# cellsize (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", -# fmin, fmax, setThreshold (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", -# Biglabels(vdf,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", -# cbulk, center, bvector(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", - -# wflux(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", -# directions(about same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", - - -# colormaps -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", - # Externals and expressions "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", @@ -638,16 +659,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -#colorbar -#not yet in in master see PR #359 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", - -#AMR, fsaved -#Does not work currently, fix for the AMR contour is in PR #364 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] @@ -774,6 +785,9 @@ def call_replace(call,func,skipped_args): callrunindex = [] funcids=[] offset=0 +nonrestartcalls.extend(agnostic_call) +v5nonrestartcalls.extend(agnostic_call) + for i,run in enumerate(runs): # bulk and restart files vlasiator5 = run['vlasiator5'] @@ -965,4 +979,4 @@ def call_replace(call,func,skipped_args): #currenlty does multiple calls (Fixed with list but still needs better implementation as we waste bit of time going through multiple things) #add manual calls (DONE) #why spend time going through all calls on all threads? -#v5 vdf?? \ No newline at end of file +#v5 vdf?? (post 2019 are v5) \ No newline at end of file From 52b0d6aa65be9af2d5c9828ec62a418c9553d639 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 10 Nov 2025 13:46:54 +0200 Subject: [PATCH 152/341] reordering of agnostic calls so they are first --- testpackage/testpackage_commons.py | 37 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 16221892..d377c67e 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -235,19 +235,24 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) +''' + + DISCLAIMER + + Add to the end of the list always so the output file names remain the same + + + +''' + + + regularcalls=[ ] #This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake agnostic_call = [ -# cellids, coordinates -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", # Input and output methods, nooverwrite "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", @@ -256,6 +261,14 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", "pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +# cellids, coordinates +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", + # Thickness, scale @@ -400,6 +413,14 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", ] + +#This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls +nonrestartcalls=[] +v5nonrestartcalls=[] +nonrestartcalls.extend(agnostic_call) +v5nonrestartcalls.extend(agnostic_call) + + nonrestartcalls = [ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", @@ -785,8 +806,6 @@ def call_replace(call,func,skipped_args): callrunindex = [] funcids=[] offset=0 -nonrestartcalls.extend(agnostic_call) -v5nonrestartcalls.extend(agnostic_call) for i,run in enumerate(runs): # bulk and restart files From d787618de80ed2f5289ae25f643d5bcab1926d8f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 10 Nov 2025 14:48:56 +0200 Subject: [PATCH 153/341] added isosurface, vdf_profiles, changed it so multile required args work --- testpackage/testpackage_commons.py | 51 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index d377c67e..ecf99959 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -13,21 +13,22 @@ #required args for functions, lists are handled as OR statements, tuples within lists as AND #add a way to add required args automatically -#tuple, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults +#list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults required_args ={ - "plot_vdf":(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]) - - + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"])] } +#'plot_isosurface':{'var':''} runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', 'fluxLocation': None, - 'funcs': ['plot_colormap3dslice','plot_ionosphere'], + 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], 'pops': ['avgs'], 'time': 1000, 'singletime': False, @@ -45,7 +46,7 @@ 'fluxLocation': None, 'singletime': False, 'pops': ['avgs'], - 'funcs': ['plot_colormap','plot_vdf'], + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'manualcall':False, 'time': 1600, 'skipped_args':None, @@ -759,24 +760,26 @@ def call_replace(call,func,skipped_args): args_out=[] #check that all required func args are set if required_args and func in required_args.keys(): - required_params=required_args[func][0] - default_params=required_args[func][1] - check=False - for param in required_params: - if any((all(r in named_parameters for r in param),(param in named_parameters))): - check=True - break - if not check: - #print("REQUIRED",call,named_parameters,required_params) - - #Add parameters if there are default_params - if default_params: - for param in default_params: - args_out.append(param) - #print("ADDED",param,call) - else: - #print("NOT ADDED",call) - return None + for required_tuple in required_args[func]: + required_params=required_tuple[0] + default_params=required_tuple[1] + check=False + for param in required_params: + if any((all(r in named_parameters for r in param),(param in named_parameters))): + check=True + break + if not check: + #print("REQUIRED",call,named_parameters,required_params) + + #Add parameters if there are default_params + if default_params: + for param in default_params: + if param not in named_parameters: + args_out.append(param) + #print("ADDED",param,call) + else: + #print("NOT ADDED",call) + return None #add execption for tuple? From 174b9b0d3e68532baf55cb145a521b412909998b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 10 Nov 2025 15:42:52 +0200 Subject: [PATCH 154/341] comment changes --- testpackage/testpackage_commons.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index ecf99959..f21aaf82 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -15,6 +15,7 @@ #list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults +#maybe add overide to this in runs append required_args ={ "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], @@ -22,7 +23,6 @@ } -#'plot_isosurface':{'var':''} runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', @@ -32,7 +32,7 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, - 'skipped_args':{'plot_ionosphere':{'var':'vg_'}}, + 'skipped_args':{'plot_ionosphere':{'var':'vg_'}}, #Uses 'in' operator for the values of the inner dict, so skipping arg completely can be done with {'var':''} 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming @@ -776,7 +776,7 @@ def call_replace(call,func,skipped_args): for param in default_params: if param not in named_parameters: args_out.append(param) - #print("ADDED",param,call) + # print("ADDED",param,call) else: #print("NOT ADDED",call) return None @@ -798,7 +798,7 @@ def call_replace(call,func,skipped_args): if not args_out: return None call=call[:call.rfind("(")+1]+",".join(args_out)+")" - +# print("BEFORE",call) return call From ed3218f73a81e76945a39fe65d99f55926d4d99f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 10:18:47 +0200 Subject: [PATCH 155/341] Removed testpackage_colormap3dslice from this PR, can be put into another if needed --- testpackage/testpackage_colormap3dslice.py | 584 --------------------- 1 file changed, 584 deletions(-) delete mode 100644 testpackage/testpackage_colormap3dslice.py diff --git a/testpackage/testpackage_colormap3dslice.py b/testpackage/testpackage_colormap3dslice.py deleted file mode 100644 index eb994b21..00000000 --- a/testpackage/testpackage_colormap3dslice.py +++ /dev/null @@ -1,584 +0,0 @@ -import analysator as pt -import sys, os -import numpy as np -import traceback - -datalocation = "/wrk-vakka/group/spacephysics/vlasiator" -runs = [] -runs.append( { 'name': 'FHA', - 'verifydir': 'testpackage_colormap3dslice/FHA/', - 'fileLocation': datalocation+'/3D/FHA/bulk1/', - 'fluxLocation': None, - 'pops': ['avgs'], - 'time': 1000, - 'singletime': False, - 'filename': None, #restart file - 'nosubpops': True, # backstreaming / non-backstreaming - 'vlasiator5': True, - 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) - - -# Custom expression function -def exprMA_cust(exprmaps, requestvariables=False): - if vlasiator5 is True: - reqs = ['vg_va'] - else: - reqs = ['va'] - if requestvariables==True: - return reqs - # exprmaps is a dictionary of numpy arrays - # Each array has 2 dimensions [xsize, ysize] - # or 3 dimensions [xsize, ysize, components] - # here the function returns the M_A with a preset bulk velocity - custombulkspeed=1500000. # m/s - va = exprmaps[reqs[0]][:,:] - MA = np.ma.divide(custombulkspeed,va) - return MA - -# Second example of a more involved custom expression function -def expr_cav_cust(pass_maps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # This custom expression returns a map with values of - # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against - # time-averaged background values. This version doesn't do intelligent checks for the - # format of the incoming data. - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - - # Multiple time steps were found - ntimes = len(pass_maps) - dsteps = [x['dstep'] for x in pass_maps] - curri = dsteps.index(0) - thesemaps = pass_maps[curri] - - thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) - thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) - thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) - thisBmag = np.linalg.norm(thisB, axis=-1) - - avgrho = np.zeros(np.array(thisrho.shape)) - avgBmag = np.zeros(np.array(thisrho.shape)) - # avgbeta = np.zeros(np.array(thisrho.shape)) - - for i in range(ntimes): - if i==curri: # Exclude current frame from background value averaging - continue - nowmaps = pass_maps[i] - print(nowmaps['dstep']) - avgrho = np.add(avgrho, nowmaps[reqs[0]]) - avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) - avgBmag = np.add(avgBmag, avgBcalc) - # avgbeta = np.add(avgbeta, nowmaps[2]) - - avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) - avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) - #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) - - rhoratio = np.ma.divide(thisrho, avgrho) - Bmagratio = np.ma.divide(thisBmag, avgBmag) - #betaratio = np.divide(thisbeta, avgbeta) - - rhoratioreq = 0.9 - bmagratioreq = 0.9 - betashfareq = level_beta_SHFA - - # Calculations using masked arrays proved problematic so a less-than elegant method is used here. - empty = np.zeros(np.array(thisrho.shape))+0.0 - half = empty + 0.5 - one = empty + 1.0 - - caviton=np.zeros(empty.shape,dtype='float64') - np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) - print("sum of SHFA ",shfa.sum()) - - combo=np.zeros(empty.shape,dtype='float64') - np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) - print("sum of combo ",combo.sum()) - combo2=np.zeros(empty.shape,dtype='float64') - combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) - print("sum of combo2 ",combo2.sum()) - combo3 = combo+combo2 - print("sum of combo3 ",combo3.sum()) - - # Mask out anything that is inside the bow shock - combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) - print("sum of combo3 upstream ",combo3.sum()) - - return combo3 - - -# Second example of a more involved custom expression function -def timesmooth(pass_maps): - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # consists of a single [ysize,xsize] array to smooth over time - - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - ntimes = len(pass_maps) - print("this many time steps ",ntimes) - # Select first valid variable - listofkeys = iter(pass_maps[0]) - while True: - var = next(listofkeys) - if var!="dstep": break - - # Multiple time steps were found - avg = np.zeros(pass_maps[0][var].shape) - for i in range(ntimes): - avg = np.add(avg, pass_maps[i][var]) - return np.divide(avg, np.array([ntimes])) - -# Helper function for drawing on existing panel -def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - - rho = extmaps[reqs[0]] - beta = extmaps[reqs[2]] - # take magnitude of B - B = np.linalg.norm(extmaps[reqs[1]],axis=-1) - - # Colours to use - color_cavitons = '#924900' - color_SHFAs = '#B66DFF' - color_BS = '#FFFF6D' - - # mask cavitons - cavitons = np.ma.masked_greater_equal(B,level_B_caviton) - cavitons.mask[rho > level_n_caviton] = True - cavitons.fill_value = 0. - cavitons[cavitons.mask == False] = 1. - - # mask SHFAs - SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) - SHFAs.mask[rho > level_n_caviton] = True - SHFAs.mask[beta < level_beta_SHFA] = True - SHFAs.fill_value = 0. - SHFAs[SHFAs.mask == False] = 1. - - # draw contours - contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], - linewidths=1.2, colors=color_BS) - contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) - contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) - - -restartcalls=[] - -nonrestartcalls = [] - - -multipopcalls = [] - -v5restartcalls = [ - -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" - -] - - - - -v5nonrestartcalls = [ - - -# Input and output methods, nooverwrite -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", - -# Thickness, scale -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", - -# msec musec titles -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - -# title, axes, noborders -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - -# Variables, operators, colormaps, usesci, lin, vscale -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", - -# Zoom and units -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - -# Externals and expressions -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", - - -# Everything at once -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", - -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", - - -# More data reducers -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", - -#colorbar -#not yet in in master see PR #359 -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", - -#AMR, fsaved -#Does not work currently, fix for the AMR contour is in PR #364 -#"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" - -] - - -v5multipopcalls= [ -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" -] - -# For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# regularcalls = [] -# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -# ] -# multipopcalls = [] -# v5regularcalls = [] -# v5nonrestartcalls = [] -# v5multipopcalls = [] - -# Construct test list -#construct calls -calls = [] -callrunids = [] -callrunindex = [] -for i,run in enumerate(runs): - # bulk and restart files - vlasiator5 = run['vlasiator5'] - filename = run['filename'] - fileLocation = run['fileLocation'] - singletime = run['singletime'] - nosubpops = run['nosubpops'] - fluxLocation = run['fluxLocation'] - callindex = 0 - - calls_in=v5restartcalls if vlasiator5 else restartcalls - for call in calls_in: - if not filename is None: - if vlasiator5: - call = call.replace("var='vg_v'","var='vg_restart_v'") - else: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - - # non-restart files - if filename is None: - #non restart calls - calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls - for call in calls_in: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - - #multipop calls - calls_in=v5multipopcalls if vlasiator5 else multipopcalls - for pop in run['pops']: - if pop != 'avgs': - for call in calls_in: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - - -nteststot = len(callrunids) - - - -# How many jobs? -jobcount=int(sys.argv[1]) -jobcurr=int(sys.argv[2]) -increment = int(nteststot/jobcount) -remainder = nteststot - jobcount * increment -start=jobcurr * increment -end=start + increment -# Remainder frames are divvied out evenly among tasks -if jobcurr < remainder: - start = start + jobcurr - end = end + jobcurr + 1 -else: - start = start + remainder - end = end + remainder - - -# Perform call -for j in range(start,end): - # Calculate which run - jrun = callrunindex[j] - runid = callrunids[j] - call = calls[j] - - runname = runs[runid]['name'] - verifydir = runs[runid]['verifydir'] - fileLocation = runs[runid]['fileLocation'] - fluxLocation = runs[runid]['fluxLocation'] - pops = runs[runid]['pops'] - time = runs[runid]['time'] - filename = runs[runid]['filename'] - vlasiator5 = runs[runid]['vlasiator5'] - singletime = runs[runid]['singletime'] - - level_bow_shock = runs[runid]['cavitonparams'][0] - level_n_caviton = runs[runid]['cavitonparams'][1] - level_B_caviton = runs[runid]['cavitonparams'][2] - level_beta_SHFA = runs[runid]['cavitonparams'][3] - - outputLocation=pt.plot.defaultoutputdir+verifydir - - # Source data files - if filename is None: - bulkname = "bulk1."+str(time).rjust(7,'0')+".vlsv" - else: - bulkname = filename - if 'fluxprefix' in runs[runid]: - fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" - else: - fluxname = "flux."+str(time).rjust(7,'0')+".bin" - - call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") - call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") - call = call.replace('REPLACETIME',"'"+str(time)+"'") - - # Many different plots - print(j, runid, jrun, call,fileLocation+bulkname) - f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) - try: - exec(call) - except Exception as e: - print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) - - traceback.print_exc() - print("END TRACE for call",j,"\n----------------------------") From 1e47f65c172dcafc401aaf791ef4507c430dc426 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 10:33:15 +0200 Subject: [PATCH 156/341] eof addition also made it so only specific functions can be tested via cmd args --- testpackage/testpackage_commons.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index f21aaf82..3620b960 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -5,6 +5,18 @@ import inspect import logging import re +import argparse + +argp=argparse.ArgumentParser( + prog='Analysator Testpackage', + description='Outputs test plots' +) +argp.add_argument("jobcount",type=int) +argp.add_argument("jobindex",type=int) + +argp.add_argument('funcs',type=str,help="function/list of functions to test, if none give does all.",nargs='*') +cmd_args=argp.parse_args() +funcs_to_use=cmd_args.funcs datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] @@ -818,7 +830,14 @@ def call_replace(call,func,skipped_args): singletime = run['singletime'] nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - functions = run['funcs'] + + if not funcs_to_use: + functions = run['funcs'] + else: + functions = list(set(run['funcs']) & set(funcs_to_use)) + if not functions: + continue + skipped_args=run['skipped_args'] @@ -909,8 +928,9 @@ def call_replace(call,func,skipped_args): nteststot = len(callrunids) # How many jobs? -jobcount=int(sys.argv[1]) -jobcurr=int(sys.argv[2]) +jobcount=cmd_args.jobcount +jobcurr=cmd_args.jobindex + increment = int(nteststot/jobcount) remainder = nteststot - jobcount * increment start=jobcurr * increment @@ -1001,4 +1021,5 @@ def call_replace(call,func,skipped_args): #currenlty does multiple calls (Fixed with list but still needs better implementation as we waste bit of time going through multiple things) #add manual calls (DONE) #why spend time going through all calls on all threads? -#v5 vdf?? (post 2019 are v5) \ No newline at end of file +#v5 vdf?? (post 2019 are v5) + From 08e305d7dff9dba7c3fc33ce8a63ca0113edd54a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 11:25:22 +0200 Subject: [PATCH 157/341] removed testpackage_colormap3dslice batch script --- .../run_testpackage_colormap3dslice.sh | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 testpackage/run_testpackage_colormap3dslice.sh diff --git a/testpackage/run_testpackage_colormap3dslice.sh b/testpackage/run_testpackage_colormap3dslice.sh deleted file mode 100644 index 7cb415e1..00000000 --- a/testpackage/run_testpackage_colormap3dslice.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -l -#SBATCH -t 00:30:00 -#SBATCH -J analysator_testpackage -#SBATCH -p short -#SBATCH -n 1 -#SBATCH --array=0-10 -#SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 - -jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) -index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) - -hostname -source ./pyvenv2.sh - -export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/ - -python testpackage_colormap3dslice.py $jobcount $index -echo Job $SLURM_ARRAY_TASK_ID complete. From 80f93d22360b6527ec247e623c5d0e611df00814 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 15:16:29 +0200 Subject: [PATCH 158/341] Implementing the new testpackage script into the new image compare workflow etc --- .github/workflows/test_compare_images.yml | 38 ++++---------- testpackage/run_compare.sh | 14 +++-- .../run_testpackage_generate_verf_set.sh | 6 +-- testpackage/run_testpackage_workflow.sh | 40 ++++++++++++++ testpackage/testpackage_get_diff.py | 52 +++++++++++++++++++ 5 files changed, 113 insertions(+), 37 deletions(-) create mode 100644 testpackage/run_testpackage_workflow.sh create mode 100644 testpackage/testpackage_get_diff.py diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index b3d4aef5..28364491 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -41,38 +41,19 @@ jobs: uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] - - name: Produce colormap plots - id: run_color + - name: Produce plots + id: run_cl run: | export TMPDIR=$RUNNER_TEMP - + export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) + echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT - sbatch -W -o testpackage_colormap_run.txt --job-name gen_plots ./testpackage/run_testpackage_colormap_workflow.sh - - cat testpackage_colormap_run.txt - module purge - module load Python/3.10.4-GCCcore-11.3.0 - python ./testpackage/testpackage_get_job_error.py testpackage_colormap_run.txt - - - name: Comparing plotted data - run: | - export TMPDIR=$RUNNER_TEMP - module load Python/3.10.4-GCCcore-11.3.0 - module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - . CI_env/bin/activate - ./testpackage/run_compare.sh testpackage_colormap + sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT - - name: Produce vdf plots - id: run_vdf - run: | - export TMPDIR=$RUNNER_TEMP - - - sbatch -W -o testpackage_vdf_run.txt --job-name gen_plots ./testpackage/run_testpackage_vdf_workflow.sh - cat testpackage_vdf_run.txt + cat testpackage_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 - python ./testpackage/testpackage_get_job_error.py testpackage_vdf_run.txt + python ./testpackage/testpackage_get_job_error.py testpackage_run.txt - name: Comparing plotted data run: | @@ -80,10 +61,11 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ./testpackage/run_compare.sh testpackage_vdf + ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + - name: scancel dangling job upon cancellation if: cancelled() run: | - scancel ${{ steps.run_color.outputs.SLURM_JOB_ID }} + scancel ${{ steps.run_cl.outputs.SLURM_JOB_ID }} diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 9559a0b6..8f0d0350 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -1,9 +1,13 @@ #!/bin/bash -l - verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" -#gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) -folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$1/" -folder_2="${PWD}/produced_plots/$1/" -python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" + +for i in $@ +do + echo "Testing for $i" + #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$1/" + folder_2="${PWD}/produced_plots/testpackage_run/$1/" + python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" +done \ No newline at end of file diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index ec126047..2831315c 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -17,11 +17,9 @@ source CI_env/bin/activate export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 -python ./testpackage/testpackage_colormap.py $jobcount $index -echo "EXIT_CODE_FROM_JOB $?" - -python ./testpackage/testpackage_vdf.py $jobcount $index +python ./testpackage/testpackage_commons.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" + echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh new file mode 100644 index 00000000..a51b5478 --- /dev/null +++ b/testpackage/run_testpackage_workflow.sh @@ -0,0 +1,40 @@ +#!/bin/bash -l +#SBATCH -t 00:30:00 +#SBATCH -J analysator_testpackage +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=1-4 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + + +#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + + +hostname + + +module purge +export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH +module load Python/3.10.4-GCCcore-11.3.0 +module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + +echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT + +source CI_env/bin/activate + +module list + +mkdir -p $PWD/produced_plots/ + +export PTNONINTERACTIVE=1 +export PTOUTPUTDIR=$PWD/produced_plots/ + + + +python ./testpackage/testpackage_colormap.py $jobcount $index $1 +#python ./testpackage/color_small_test.py $jobcount $index +echo "EXIT_CODE_FROM_JOB $?" +#echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py new file mode 100644 index 00000000..d20d4ffb --- /dev/null +++ b/testpackage/testpackage_get_diff.py @@ -0,0 +1,52 @@ +#from testpackage_helper import system_call +from create_env import system_call + +git_diff=system_call('git diff --name-only origin/master...').split('\n') +git_diff = ["plot_vdfdiff.py","plot_isosurface.py"] + +#Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). +#Checking uses 'in' operation, case insensitive +#If None, everything will be run + +file_checks = { +"plot_threeslice.py":"plot_threeslice", +"plot_colormap.py":"plot_colormap", +"plot_colormap3dslice.py":"plot_colormap3dslice", +"plot_ionosphere.py":"plot_ionosphere", +"plot_isosurface.py":["plot_isosurface","plot_neutral_sheet"], +"plot_vdf.py":"plot_vdf", +"plot_vdf_profiles.py":"plot_vdf_profiles", +"plot_vdfdiff.py":"plot_vdfdiff", +"plot_variables.py":None, +"plot_helpers.py":None, +"plot.py":None, +"colormaps.py":None, +"calculations":None, +"vlsv":None, +"testpackage_commons.py":None, +"MayaVi":None, +"compare_images.yml":None +} + +#Override if there are many changes as run all tests +if len(git_diff)>30: + quit() + +output=[] + +for diff_line in git_diff: + for key,val in file_checks.items(): + if key.lower() in diff_line.lower(): + if not val: + #run all tests + quit() + elif type(val)==list: + output.extend(val) + else: + output.append(val) + + +if output: + print(" ".join(output)) +else: + print("None") \ No newline at end of file From 05d7eef7395e869f3f381806fb135dc34c7fde3f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 15:21:24 +0200 Subject: [PATCH 159/341] eof --- testpackage/testpackage_get_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index d20d4ffb..dff0b691 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -49,4 +49,4 @@ if output: print(" ".join(output)) else: - print("None") \ No newline at end of file + print("None") From c167e1ce37e6615f1f39579439b52d3f56cb5cf0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 15:22:38 +0200 Subject: [PATCH 160/341] another eof complain sigh --- testpackage/run_compare.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 8f0d0350..770fb202 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -7,7 +7,7 @@ for i in $@ do echo "Testing for $i" #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$1/" - folder_2="${PWD}/produced_plots/testpackage_run/$1/" + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" + folder_2="${PWD}/produced_plots/testpackage_run/$i/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" -done \ No newline at end of file +done From a2bf026963ee0d7c25894138c0a887d4a1af07fd Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 15:45:55 +0200 Subject: [PATCH 161/341] making things so workflows work and the workflow can skip plots that are not necessary --- testpackage/run_compare.sh | 4 ++++ testpackage/run_testpackage_workflow.sh | 2 +- testpackage/testpackage_commons.py | 2 ++ testpackage/testpackage_get_diff.py | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 770fb202..355f481c 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -2,6 +2,10 @@ verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" +#if pass we do not check for anything +if echo $@ | grep -q -P "\spass$|\spass\s"; then + exit 0 +fi for i in $@ do diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index a51b5478..fdb468c3 100644 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -34,7 +34,7 @@ export PTOUTPUTDIR=$PWD/produced_plots/ -python ./testpackage/testpackage_colormap.py $jobcount $index $1 +python ./testpackage/testpackage_commons.py $jobcount $index $@ #python ./testpackage/color_small_test.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" #echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 3620b960..48045c7b 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -17,6 +17,8 @@ argp.add_argument('funcs',type=str,help="function/list of functions to test, if none give does all.",nargs='*') cmd_args=argp.parse_args() funcs_to_use=cmd_args.funcs +if "pass" in funcs_to_use: + quit() datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index dff0b691..3dbaa682 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -49,4 +49,4 @@ if output: print(" ".join(output)) else: - print("None") + print("pass") From 93710a91acce0c690403f60c940bf5ec770a3e55 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 15:57:42 +0200 Subject: [PATCH 162/341] removed left debug line from code --- testpackage/testpackage_get_diff.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 3dbaa682..30ef6975 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -2,7 +2,6 @@ from create_env import system_call git_diff=system_call('git diff --name-only origin/master...').split('\n') -git_diff = ["plot_vdfdiff.py","plot_isosurface.py"] #Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). #Checking uses 'in' operation, case insensitive From ce1b17adca8359bec1c90b92d863c8717b0facc9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 16:26:23 +0200 Subject: [PATCH 163/341] run compare now runs correctly if called without commandline args, which will result in comparing all --- testpackage/run_compare.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 355f481c..27f90e01 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -7,11 +7,22 @@ if echo $@ | grep -q -P "\spass$|\spass\s"; then exit 0 fi +check=true + for i in $@ do - echo "Testing for $i" + check=false + echo "Comparing for $i" #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/$i/" folder_2="${PWD}/produced_plots/testpackage_run/$i/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" done + +if $check; +then + echo "Comparing all" + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/" + folder_2="${PWD}/produced_plots/testpackage_run/" + python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" +fi From 82e78372490108306128bf68da8dcc264d8ef499 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 16:37:24 +0200 Subject: [PATCH 164/341] clarifying comment --- testpackage/run_compare.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 27f90e01..ba5cfe7f 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -9,6 +9,7 @@ fi check=true +#Note that this is skipped if on arguments are passed for i in $@ do check=false From 5803652376bbcbaf6c4506f73831bf48f6186dba Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 11 Nov 2025 19:34:36 +0200 Subject: [PATCH 165/341] added bit of a dirty fix for passing multiple argument skips, also made it skip exprMA and expr_cav_cust for 3dsclice as for whatever reason those cause errors --- testpackage/testpackage_commons.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 48045c7b..49e4eafd 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -46,7 +46,9 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, - 'skipped_args':{'plot_ionosphere':{'var':'vg_'}}, #Uses 'in' operator for the values of the inner dict, so skipping arg completely can be done with {'var':''} + + #Uses 'in' operator for the values of the inner dict, so skipping arg completely can be done with {'var':''} + 'skipped_args':{'plot_ionosphere':{'var':'vg_'},'plot_colormap3dslice':{'expression':['expr_cav_cust','exprMA_cust']}}, 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming @@ -70,6 +72,10 @@ 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) + + + + # Custom expression function def exprMA_cust(exprmaps, requestvariables=False): if vlasiator5 is True: @@ -802,12 +808,15 @@ def call_replace(call,func,skipped_args): if skipped_args and func in skipped_args.keys(): skipped_args_dict=skipped_args[func] call_args=arg.split("=") - if call_args[0] in skipped_args_dict.keys() and skipped_args_dict[call_args[0]] in call_args[1]: - continue + if call_args[0] in skipped_args_dict.keys(): + if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: + continue + elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): + continue if arg.split("=")[0] in function_pars: args_out.append(arg) - else: - logging.warning(f"Argument {arg} removed from call {call}") + #else: + # logging.warning(f"Argument {arg} removed from call {call}") if not args_out: return None From 071c7232370ee7a1d6c2e352c14fc78c317a5acf Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 12 Nov 2025 12:28:16 +0200 Subject: [PATCH 166/341] added more runs and added non v5 multipops --- testpackage/testpackage_commons.py | 94 ++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 11 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 49e4eafd..4db651a0 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -7,6 +7,8 @@ import re import argparse +#add manualcals filtering or something since rightnow it tries to do it for 3D data? does it work? + argp=argparse.ArgumentParser( prog='Analysator Testpackage', description='Outputs test plots' @@ -37,7 +39,7 @@ } - +''' runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', @@ -48,7 +50,9 @@ 'singletime': False, #Uses 'in' operator for the values of the inner dict, so skipping arg completely can be done with {'var':''} - 'skipped_args':{'plot_ionosphere':{'var':'vg_'},'plot_colormap3dslice':{'expression':['expr_cav_cust','exprMA_cust']}}, + 'skipped_args':{'plot_ionosphere':{'var':'vg_'}, + 'plot_colormap3dslice':{'expression':['expr_cav_cust','exprMA_cust']} + }, 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming @@ -71,10 +75,38 @@ 'nosubpops':False, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) - - - +''' +runs.append( { 'name': 'BGA', + 'verifydir': '/BGA/', + 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', + 'fluxLocation': None, + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'pops': ['proton'], + 'skipped_args':{'plot_vdf':{'normal':''}}, + 'time': 380, + 'manualcall':False, + 'singletime': True, # neighboring bulk files not available + 'filename': None, + 'vlasiator5': True, + 'nosubpops': True, # thermal / non-thermal + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) + +runs.append( { 'name': 'BFD', + 'verifydir': '/BFD/', + 'fileLocation': datalocation+'/2D/BFD/bulk/', + 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', + 'fluxprefix': 'bulk.', + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'skipped_args':{'plot_vdf':{'normal':''}}, + 'pops': ['proton','helium'], + 'time': 2000, + 'singletime': False, + 'filename': None, + 'manualcall':False, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) # Custom expression function def exprMA_cust(exprmaps, requestvariables=False): @@ -268,7 +300,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): -regularcalls=[ +restartcalls=[ ] #This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake @@ -581,7 +613,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] -multipopcalls = ["pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] v5restartcalls = [ @@ -700,11 +731,11 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ] + v5multipopcalls= [ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", @@ -746,10 +777,51 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" ] + +multipopcalls = [ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] + manualcalls=[ "pt.plot.colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')", - -#plot_vdf manual calls + #plot_vdf manual calls "pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)" ] @@ -928,7 +1000,7 @@ def call_replace(call,func,skipped_args): continue elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue - mpcall = call.replace('REPLACEPOP',pop) + call = call.replace('REPLACEPOP',pop) if call not in calls: callrunids.append(i) calls.append(call) From e49b175d902d8523ebd668798ada562a2cc623a3 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 12 Nov 2025 12:30:29 +0200 Subject: [PATCH 167/341] finished renaming regularcalls to restartcalls --- testpackage/testpackage_commons.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4db651a0..5718be5c 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -828,11 +828,11 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop # For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# regularcalls = [] +# restartcalls = [] # nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", # ] # multipopcalls = [] -# v5regularcalls = [] +# v5restartcalls = [] # v5nonrestartcalls = [] # v5multipopcalls = [] @@ -934,7 +934,7 @@ def call_replace(call,func,skipped_args): callindex += 1 for j,func in enumerate(functions): - calls_in=v5restartcalls if vlasiator5 else regularcalls + calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: call=call_replace(call,func,skipped_args) if not call: From bdea6f4010298045f37bfefbbcc308eebefb707f Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 12 Nov 2025 12:42:37 +0200 Subject: [PATCH 168/341] added BCQr, testing whether it works --- testpackage/testpackage_commons.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 5718be5c..97cba48c 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -76,7 +76,20 @@ 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) ''' - +runs.append( { 'name': 'BCQr', + 'verifydir': '/BCQr/', + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/restart/', + 'pops': ['avgs'], + 'fluxLocation': None, + 'singletime': True, # neighboring bulk files not available + 'time': 0, + 'manualcall':False, + 'vlasiator5': False, + 'nosubpops': False, # thermal / non-thermal + 'filename': 'restart.0001361.vlsv', + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +''' runs.append( { 'name': 'BGA', 'verifydir': '/BGA/', 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', @@ -107,7 +120,7 @@ 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) - +''' # Custom expression function def exprMA_cust(exprmaps, requestvariables=False): if vlasiator5 is True: From fafb8281663af7d15e87e3102a89f9e4060a3425 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 12 Nov 2025 12:55:06 +0200 Subject: [PATCH 169/341] more testing with restarts and added missing key to dict --- testpackage/testpackage_commons.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 97cba48c..0844caf6 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -84,6 +84,7 @@ 'fluxLocation': None, 'singletime': True, # neighboring bulk files not available 'time': 0, + 'skipped_args':None, 'manualcall':False, 'vlasiator5': False, 'nosubpops': False, # thermal / non-thermal @@ -314,6 +315,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): restartcalls=[ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='hot_desaturated')", ] #This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake From ca0b29fbb58a56e96d9a376e787527d9d89b675f Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 12 Nov 2025 13:03:46 +0200 Subject: [PATCH 170/341] made restart calls work correctly such that agnostic calls are included --- testpackage/testpackage_commons.py | 57 +++++++++++++++++------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 0844caf6..4be933b2 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -314,9 +314,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): -restartcalls=[ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='hot_desaturated')", -] #This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake agnostic_call = [ @@ -485,9 +482,23 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): #This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls nonrestartcalls=[] v5nonrestartcalls=[] +restartcalls=[] +v5restartcalls=[] nonrestartcalls.extend(agnostic_call) v5nonrestartcalls.extend(agnostic_call) +restartcalls.extend(agnostic_call) +v5restartcalls.extend(agnostic_call) + +v5restartcalls = [ + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" + +] + +restartcalls=[ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" +] nonrestartcalls = [ @@ -629,11 +640,6 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): -v5restartcalls = [ - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" - -] @@ -949,23 +955,24 @@ def call_replace(call,func,skipped_args): callindex += 1 for j,func in enumerate(functions): - calls_in=v5restartcalls if vlasiator5 else restartcalls - for call in calls_in: - call=call_replace(call,func,skipped_args) - if not call: - continue - if not filename is None: - if vlasiator5: - call = call.replace("var='vg_v'","var='vg_restart_v'") - else: - call = call.replace("var='V'","var='restart_V'") - - if call not in calls: - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + if filename is not None: + calls_in=v5restartcalls if vlasiator5 else restartcalls + for call in calls_in: + call=call_replace(call,func,skipped_args) + if not call: + continue + if not filename is None: + if vlasiator5: + call = call.replace("var='vg_v'","var='vg_restart_v'") + else: + call = call.replace("var='V'","var='restart_V'") + + if call not in calls: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) # non-restart files From 85531417af70ffe82976b45b28e3d476e5330fc5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 12 Nov 2025 13:10:16 +0200 Subject: [PATCH 171/341] fixed an amateurish mistake with the lists, they were not extended correctly --- testpackage/testpackage_commons.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4be933b2..6065afc1 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -489,18 +489,18 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): restartcalls.extend(agnostic_call) v5restartcalls.extend(agnostic_call) -v5restartcalls = [ +v5restartcalls.extend([ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" -] +]) -restartcalls=[ +restartcalls.extend([ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" -] +]) -nonrestartcalls = [ +nonrestartcalls.extend([ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", @@ -636,7 +636,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"]) @@ -644,7 +644,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): -v5nonrestartcalls = [ +v5nonrestartcalls.extend([ # Variables, operators, colormaps, usesci, lin, vscale "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", @@ -754,10 +754,10 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" -] +]) -v5multipopcalls= [ +v5multipopcalls=[ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", @@ -799,7 +799,7 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): ] -multipopcalls = [ +multipopcalls=[ "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", From 8340a7c7c6c61e9034e684f4da515d487a979b76 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 17 Nov 2025 09:48:43 +0200 Subject: [PATCH 172/341] Added filedir and step as required args --- testpackage/testpackage_commons.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4be933b2..e76f7230 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -32,11 +32,14 @@ #list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults #maybe add overide to this in runs append -required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], - "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"])], - "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"])] +#filedir issues test with the one below and see if fixed, alos other errors + +required_args ={ + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] + } ''' From 599aefa8ff19476e97b8e7cd10d1c243e2c059cc Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 17 Nov 2025 11:54:17 +0200 Subject: [PATCH 173/341] filtering out empty args from args_out --- testpackage/testpackage_commons.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 27958078..3cb7990e 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -36,7 +36,7 @@ #filedir issues test with the one below and see if fixed, alos other errors required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] @@ -869,7 +869,6 @@ def call_replace(call,func,skipped_args): args = re.search(r'\((.+)\)',call).group(1) args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] named_parameters=[arg.split("=")[0] for arg in args] - #Get parameters of the func function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args #Remove args that are not present as parameters for the func @@ -916,6 +915,9 @@ def call_replace(call,func,skipped_args): if not args_out: return None + if func=="plot_vdf": + print(args_out) + args_out=filter(None,args_out) call=call[:call.rfind("(")+1]+",".join(args_out)+")" # print("BEFORE",call) return call @@ -1118,6 +1120,7 @@ def call_replace(call,func,skipped_args): try: exec(call) #print(call) + #quit() except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) From 97564392e2f2290e01aef6e8b8d8349bf9bb78ff Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 17 Nov 2025 16:18:23 +0200 Subject: [PATCH 174/341] changing into importing the test lists --- testpackage/testpackage_commons.py | 889 ++--------------------------- 1 file changed, 44 insertions(+), 845 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 3cb7990e..54e11530 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -26,21 +26,6 @@ runs = [] -#required args for functions, lists are handled as OR statements, tuples within lists as AND -#add a way to add required args automatically - -#list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults - -#maybe add overide to this in runs append - -#filedir issues test with the one below and see if fixed, alos other errors - -required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], - "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], - "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] - -} ''' runs.append( { 'name': 'FHA', @@ -51,17 +36,12 @@ 'pops': ['avgs'], 'time': 1000, 'singletime': False, - - #Uses 'in' operator for the values of the inner dict, so skipping arg completely can be done with {'var':''} - 'skipped_args':{'plot_ionosphere':{'var':'vg_'}, - 'plot_colormap3dslice':{'expression':['expr_cav_cust','exprMA_cust']} - }, 'filename': None, #restart file 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) - +''' runs.append( { 'name': 'BCQ', 'verifydir': '/BCQ/', @@ -78,7 +58,9 @@ 'nosubpops':False, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) -''' + + +''' runs.append( { 'name': 'BCQr', 'verifydir': '/BCQr/', 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], @@ -93,6 +75,8 @@ 'nosubpops': False, # thermal / non-thermal 'filename': 'restart.0001361.vlsv', 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +''' + ''' runs.append( { 'name': 'BGA', 'verifydir': '/BGA/', @@ -125,730 +109,7 @@ 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) ''' -# Custom expression function -def exprMA_cust(exprmaps, requestvariables=False): - if vlasiator5 is True: - reqs = ['vg_va'] - else: - reqs = ['va'] - if requestvariables==True: - return reqs - # exprmaps is a dictionary of numpy arrays - # Each array has 2 dimensions [xsize, ysize] - # or 3 dimensions [xsize, ysize, components] - # here the function returns the M_A with a preset bulk velocity - custombulkspeed=1500000. # m/s - va = exprmaps[reqs[0]][:,:] - MA = np.ma.divide(custombulkspeed,va) - return MA - -# Second example of a more involved custom expression function -def expr_cav_cust(pass_maps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # This custom expression returns a map with values of - # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against - # time-averaged background values. This version doesn't do intelligent checks for the - # format of the incoming data. - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - - # Multiple time steps were found - ntimes = len(pass_maps) - dsteps = [x['dstep'] for x in pass_maps] - curri = dsteps.index(0) - thesemaps = pass_maps[curri] - - thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) - thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) - thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) - thisBmag = np.linalg.norm(thisB, axis=-1) - - avgrho = np.zeros(np.array(thisrho.shape)) - avgBmag = np.zeros(np.array(thisrho.shape)) - # avgbeta = np.zeros(np.array(thisrho.shape)) - - for i in range(ntimes): - if i==curri: # Exclude current frame from background value averaging - continue - nowmaps = pass_maps[i] - print(nowmaps['dstep']) - avgrho = np.add(avgrho, nowmaps[reqs[0]]) - avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) - avgBmag = np.add(avgBmag, avgBcalc) - # avgbeta = np.add(avgbeta, nowmaps[2]) - - avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) - avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) - #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) - - rhoratio = np.ma.divide(thisrho, avgrho) - Bmagratio = np.ma.divide(thisBmag, avgBmag) - #betaratio = np.divide(thisbeta, avgbeta) - - rhoratioreq = 0.9 - bmagratioreq = 0.9 - betashfareq = level_beta_SHFA - - # Calculations using masked arrays proved problematic so a less-than elegant method is used here. - empty = np.zeros(np.array(thisrho.shape))+0.0 - half = empty + 0.5 - one = empty + 1.0 - - caviton=np.zeros(empty.shape,dtype='float64') - np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) - print("sum of SHFA ",shfa.sum()) - - combo=np.zeros(empty.shape,dtype='float64') - np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) - print("sum of combo ",combo.sum()) - combo2=np.zeros(empty.shape,dtype='float64') - combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) - print("sum of combo2 ",combo2.sum()) - combo3 = combo+combo2 - print("sum of combo3 ",combo3.sum()) - - # Mask out anything that is inside the bow shock - combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) - print("sum of combo3 upstream ",combo3.sum()) - - return combo3 - - -# Second example of a more involved custom expression function -def timesmooth(pass_maps): - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # consists of a single [ysize,xsize] array to smooth over time - - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - ntimes = len(pass_maps) - print("this many time steps ",ntimes) - # Select first valid variable - listofkeys = iter(pass_maps[0]) - while True: - var = next(listofkeys) - if var!="dstep": break - - # Multiple time steps were found - avg = np.zeros(pass_maps[0][var].shape) - for i in range(ntimes): - avg = np.add(avg, pass_maps[i][var]) - return np.divide(avg, np.array([ntimes])) - -# Helper function for drawing on existing panel -def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - - rho = extmaps[reqs[0]] - beta = extmaps[reqs[2]] - # take magnitude of B - B = np.linalg.norm(extmaps[reqs[1]],axis=-1) - - # Colours to use - color_cavitons = '#924900' - color_SHFAs = '#B66DFF' - color_BS = '#FFFF6D' - - # mask cavitons - cavitons = np.ma.masked_greater_equal(B,level_B_caviton) - cavitons.mask[rho > level_n_caviton] = True - cavitons.fill_value = 0. - cavitons[cavitons.mask == False] = 1. - - # mask SHFAs - SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) - SHFAs.mask[rho > level_n_caviton] = True - SHFAs.mask[beta < level_beta_SHFA] = True - SHFAs.fill_value = 0. - SHFAs[SHFAs.mask == False] = 1. - - # draw contours - contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], - linewidths=1.2, colors=color_BS) - contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) - contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) - -''' - - DISCLAIMER - - Add to the end of the list always so the output file names remain the same - - - -''' - - - - -#This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake -agnostic_call = [ - - -# Input and output methods, nooverwrite -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", - -# cellids, coordinates -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", - - - -# Thickness, scale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", - -# msec musec titles -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - - - - -# title, axes, noborders -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - - - -# Overplots and flux lines -"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", - -# Vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", - -# Zoom and units -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - - -# slicethick (Mostly for vdf,vdf_prof,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", -# cellsize (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", -# fmin, fmax, setThreshold (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", -# Biglabels(vdf,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", -# cbulk, center, bvector(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", - -# wflux(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", -# directions(about same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", - - - -# colormaps -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", - -#colorbar -#not yet in in master see PR #359 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", - -#AMR, fsaved -#Does not work currently, fix for the AMR contour is in PR #364 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", -] - - -#This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls -nonrestartcalls=[] -v5nonrestartcalls=[] -restartcalls=[] -v5restartcalls=[] -nonrestartcalls.extend(agnostic_call) -v5nonrestartcalls.extend(agnostic_call) -restartcalls.extend(agnostic_call) -v5restartcalls.extend(agnostic_call) - -v5restartcalls.extend([ - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" - -]) - -restartcalls.extend([ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" - -]) - -nonrestartcalls.extend([ - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", - -# Symlog and vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - -# Externals and expressions -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", - -# Everything at once -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", - - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", - -# More data reducers -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"]) - - - - - - - -v5nonrestartcalls.extend([ -# Variables, operators, colormaps, usesci, lin, vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", - - -# Externals and expressions -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", - - -# Everything at once -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", - - -# More data reducers -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" - -]) - - -v5multipopcalls=[ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" -] - - -multipopcalls=[ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] - -manualcalls=[ - "pt.plot.colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')", - #plot_vdf manual calls - "pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)" - -] #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop # For handier debugging, uncomment these to overwrite call lists and include only relevant calls @@ -860,71 +121,8 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): # v5nonrestartcalls = [] # v5multipopcalls = [] -def call_replace(call,func,skipped_args): - #This is kind of scuffed maybe - - call=call.replace('REPLACEFUNC',func) - - #Get the arguments of the call - args = re.search(r'\((.+)\)',call).group(1) - args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] - named_parameters=[arg.split("=")[0] for arg in args] - #Get parameters of the func - function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args - #Remove args that are not present as parameters for the func - args_out=[] - #check that all required func args are set - if required_args and func in required_args.keys(): - for required_tuple in required_args[func]: - required_params=required_tuple[0] - default_params=required_tuple[1] - check=False - for param in required_params: - if any((all(r in named_parameters for r in param),(param in named_parameters))): - check=True - break - if not check: - #print("REQUIRED",call,named_parameters,required_params) - - #Add parameters if there are default_params - if default_params: - for param in default_params: - if param not in named_parameters: - args_out.append(param) - # print("ADDED",param,call) - else: - #print("NOT ADDED",call) - return None - #add execption for tuple? - for arg in args: - if arg: - if skipped_args and func in skipped_args.keys(): - skipped_args_dict=skipped_args[func] - call_args=arg.split("=") - if call_args[0] in skipped_args_dict.keys(): - if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: - continue - elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): - continue - if arg.split("=")[0] in function_pars: - args_out.append(arg) - #else: - # logging.warning(f"Argument {arg} removed from call {call}") - - if not args_out: - return None - if func=="plot_vdf": - print(args_out) - args_out=filter(None,args_out) - call=call[:call.rfind("(")+1]+",".join(args_out)+")" -# print("BEFORE",call) - return call - - - -#construct calls calls = [] callrunids = [] callrunindex = [] @@ -947,37 +145,39 @@ def call_replace(call,func,skipped_args): if not functions: continue - skipped_args=run['skipped_args'] - callindex = 0 - if run['manualcall']: - for call in manualcalls: - funcids.append(-1) - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 + for j,func in enumerate(functions): + + #try to import the list of calls corresponding to the function to be tested. Skip if not found + try: + exec(f'import testpackage_{func}') + except: + raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the same folder") + + + #Get the list of calls from the imported file, set list to empty list if list not foud in the file + for call_list in ["restartcalls","nonrestartcalls","multipopcalls","v5restartcalls","v5nonrestartcalls","v5multipopcalls"]: + try: + exec(f'{call_list}=testpackage_{func}.{call_list}') + except: + exec(f'{call_list}=[]') + if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: - call=call_replace(call,func,skipped_args) - if not call: - continue if not filename is None: if vlasiator5: call = call.replace("var='vg_v'","var='vg_restart_v'") else: call = call.replace("var='V'","var='restart_V'") - - if call not in calls: - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) # non-restart files @@ -986,12 +186,11 @@ def call_replace(call,func,skipped_args): calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls for call in calls_in: - call=call_replace(call,func,skipped_args) - if not call: - continue # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue + if f"expression=testpackage_{func}" not in call and "expression=" in call: + call=call.replace("expression=",f"expression=testpackage_{func}.") # skip time integration if only one file available if "pass_times" in call and singletime: continue @@ -1000,19 +199,17 @@ def call_replace(call,func,skipped_args): continue elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue - if call not in calls: - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) #multipop calls calls_in=v5multipopcalls if vlasiator5 else multipopcalls for pop in run['pops']: if pop != 'avgs': for call in calls_in: - call=call_replace(call,func,skipped_args) if not call: continue @@ -1028,12 +225,14 @@ def call_replace(call,func,skipped_args): elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue call = call.replace('REPLACEPOP',pop) - if call not in calls: - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) + + nteststot = len(callrunids) @@ -1081,7 +280,7 @@ def call_replace(call,func,skipped_args): level_B_caviton = runs[runid]['cavitonparams'][2] level_beta_SHFA = runs[runid]['cavitonparams'][3] - verifydir=os.path.join("testpackage_run",verifydir) +# verifydir=os.path.join(verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) # Source data files @@ -1119,7 +318,7 @@ def call_replace(call,func,skipped_args): f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: exec(call) - #print(call) + verifydir#print(call) #quit() except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) From 8405063e6e660edd3cef17e4b6f6e40568713414 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 17 Nov 2025 16:59:44 +0200 Subject: [PATCH 175/341] added vlasiator5 variable since the custom expressions use that in plot_colormap, bit of a duct tape fix --- testpackage/testpackage_commons.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 54e11530..7d0e61b1 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -165,6 +165,9 @@ except: exec(f'{call_list}=[]') + if vlasiator5: + exec(f'testpackage_{func}.vlasiator5=True') + if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: From b227c5082306598fede2c51849ad5c2611e052c9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 17 Nov 2025 17:28:03 +0200 Subject: [PATCH 176/341] changed BCQ run parameters --- testpackage/testpackage_commons.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 7d0e61b1..b68c6f44 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -50,13 +50,12 @@ 'singletime': False, 'pops': ['avgs'], 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], - 'manualcall':False, - 'time': 1600, + 'time': 2000, 'skipped_args':None, 'filename': None, 'vlasiator5':False, 'nosubpops':False, - 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) @@ -192,8 +191,13 @@ # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue + + #change the extrnal and expression calls to correct format if f"expression=testpackage_{func}" not in call and "expression=" in call: call=call.replace("expression=",f"expression=testpackage_{func}.") + if f"external=testpackage_{func}" not in call and "external=" in call: + call=call.replace("external=",f"external=testpackage_{func}.") + # skip time integration if only one file available if "pass_times" in call and singletime: continue @@ -277,11 +281,13 @@ filename = runs[runid]['filename'] vlasiator5 = runs[runid]['vlasiator5'] singletime = runs[runid]['singletime'] - - level_bow_shock = runs[runid]['cavitonparams'][0] - level_n_caviton = runs[runid]['cavitonparams'][1] - level_B_caviton = runs[runid]['cavitonparams'][2] - level_beta_SHFA = runs[runid]['cavitonparams'][3] + + #set custom expression variables for plot_colormap + testpackage_plot_colormap.level_bow_shock = runs[runid]['cavitonparams'][0] + testpackage_plot_colormap.level_n_caviton = runs[runid]['cavitonparams'][1] + testpackage_plot_colormap.level_B_caviton = runs[runid]['cavitonparams'][2] + testpackage_plot_colormap.level_beta_SHFA = runs[runid]['cavitonparams'][3] + # verifydir=os.path.join(verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) @@ -321,7 +327,7 @@ f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: exec(call) - verifydir#print(call) + #print(call) #quit() except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) From 4ee03298ba225aa9c0fcc6987fd72f667a0d9ef7 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 17 Nov 2025 17:29:52 +0200 Subject: [PATCH 177/341] Added template maker, converted plot_colormap to use the commons(may rename that), added preliminary list of calls for other functions as well. --- testpackage/testpackage_plot_colormap.py | 696 ++++++++++++++++++ .../testpackage_plot_colormap3dslice.py | 361 +++++++++ testpackage/testpackage_plot_ionosphere.py | 241 ++++++ testpackage/testpackage_plot_isosurface.py | 82 +++ testpackage/testpackage_plot_vdf.py | 128 ++++ testpackage/testpackage_plot_vdf_profiles.py | 73 ++ testpackage/testpackage_plot_vdfdiff.py | 107 +++ testpackage/testpackage_template_maker.py | 696 ++++++++++++++++++ 8 files changed, 2384 insertions(+) create mode 100644 testpackage/testpackage_plot_colormap.py create mode 100644 testpackage/testpackage_plot_colormap3dslice.py create mode 100644 testpackage/testpackage_plot_ionosphere.py create mode 100644 testpackage/testpackage_plot_isosurface.py create mode 100644 testpackage/testpackage_plot_vdf.py create mode 100644 testpackage/testpackage_plot_vdf_profiles.py create mode 100644 testpackage/testpackage_plot_vdfdiff.py create mode 100644 testpackage/testpackage_template_maker.py diff --git a/testpackage/testpackage_plot_colormap.py b/testpackage/testpackage_plot_colormap.py new file mode 100644 index 00000000..e6ff122a --- /dev/null +++ b/testpackage/testpackage_plot_colormap.py @@ -0,0 +1,696 @@ + +import numpy as np +vlasiator5=None + + + +# Custom expression function +def exprMA_cust(exprmaps, requestvariables=False): + if vlasiator5 is True: + reqs = ['vg_va'] + else: + reqs = ['va'] + if requestvariables==True: + return reqs + # exprmaps is a dictionary of numpy arrays + # Each array has 2 dimensions [xsize, ysize] + # or 3 dimensions [xsize, ysize, components] + # here the function returns the M_A with a preset bulk velocity + custombulkspeed=1500000. # m/s + va = exprmaps[reqs[0]][:,:] + MA = np.ma.divide(custombulkspeed,va) + return MA + +# Second example of a more involved custom expression function +def expr_cav_cust(pass_maps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # This custom expression returns a map with values of + # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against + # time-averaged background values. This version doesn't do intelligent checks for the + # format of the incoming data. + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + + # Multiple time steps were found + ntimes = len(pass_maps) + dsteps = [x['dstep'] for x in pass_maps] + curri = dsteps.index(0) + thesemaps = pass_maps[curri] + + thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) + thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) + thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) + thisBmag = np.linalg.norm(thisB, axis=-1) + + avgrho = np.zeros(np.array(thisrho.shape)) + avgBmag = np.zeros(np.array(thisrho.shape)) + # avgbeta = np.zeros(np.array(thisrho.shape)) + + for i in range(ntimes): + if i==curri: # Exclude current frame from background value averaging + continue + nowmaps = pass_maps[i] + print(nowmaps['dstep']) + avgrho = np.add(avgrho, nowmaps[reqs[0]]) + avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) + avgBmag = np.add(avgBmag, avgBcalc) + # avgbeta = np.add(avgbeta, nowmaps[2]) + + avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) + avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) + #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) + + rhoratio = np.ma.divide(thisrho, avgrho) + Bmagratio = np.ma.divide(thisBmag, avgBmag) + #betaratio = np.divide(thisbeta, avgbeta) + + rhoratioreq = 0.9 + bmagratioreq = 0.9 + betashfareq = level_beta_SHFA + + # Calculations using masked arrays proved problematic so a less-than elegant method is used here. + empty = np.zeros(np.array(thisrho.shape))+0.0 + half = empty + 0.5 + one = empty + 1.0 + + caviton=np.zeros(empty.shape,dtype='float64') + np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) + print("sum of SHFA ",shfa.sum()) + + combo=np.zeros(empty.shape,dtype='float64') + np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) + print("sum of combo ",combo.sum()) + combo2=np.zeros(empty.shape,dtype='float64') + combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) + print("sum of combo2 ",combo2.sum()) + combo3 = combo+combo2 + print("sum of combo3 ",combo3.sum()) + + # Mask out anything that is inside the bow shock + combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) + print("sum of combo3 upstream ",combo3.sum()) + + return combo3 + + +# Second example of a more involved custom expression function +def timesmooth(pass_maps): + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # consists of a single [ysize,xsize] array to smooth over time + + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + ntimes = len(pass_maps) + print("this many time steps ",ntimes) + # Select first valid variable + listofkeys = iter(pass_maps[0]) + while True: + var = next(listofkeys) + if var!="dstep": break + + # Multiple time steps were found + avg = np.zeros(pass_maps[0][var].shape) + for i in range(ntimes): + avg = np.add(avg, pass_maps[i][var]) + return np.divide(avg, np.array([ntimes])) + +# Helper function for drawing on existing panel +def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + + rho = extmaps[reqs[0]] + beta = extmaps[reqs[2]] + # take magnitude of B + B = np.linalg.norm(extmaps[reqs[1]],axis=-1) + + # Colours to use + color_cavitons = '#924900' + color_SHFAs = '#B66DFF' + color_BS = '#FFFF6D' + + # mask cavitons + cavitons = np.ma.masked_greater_equal(B,level_B_caviton) + cavitons.mask[rho > level_n_caviton] = True + cavitons.fill_value = 0. + cavitons[cavitons.mask == False] = 1. + + # mask SHFAs + SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) + SHFAs.mask[rho > level_n_caviton] = True + SHFAs.mask[beta < level_beta_SHFA] = True + SHFAs.fill_value = 0. + SHFAs[SHFAs.mask == False] = 1. + + # draw contours + contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], + linewidths=1.2, colors=color_BS) + contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) + contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) + +restartcalls = [ + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='x', colormap='PuOr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='z', colormap='PuOr',symlog=0, usesci=0)"] + +nonrestartcalls = [ + # Input and output methods, nooverwrite +"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", + +# Thickness, scale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", + +# msec musec titles +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + +# title, axes, noborders +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + +# Variables, operators, colormaps, usesci, lin, vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', colormap='nipy_spectral')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', colormap='nipy_spectral', vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='x', colormap='bwr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='z', colormap='bwr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='x', colormap='PuOr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='z', colormap='PuOr',symlog=0, usesci=0)", +# Overplots and flux lines +"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", + +# Vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", + +# Symlog and vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", + +# Zoom and units +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + +# Externals and expressions +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", + +# Everything at once +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", + + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", + +# More data reducers +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] + + +multipopcalls = [ +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] + +v5restartcalls = [ +# Input and output methods, nooverwrite +"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", + +# Thickness, scale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=5.0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", + +# msec musec titles +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + +# title, axes, noborders +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + +# Variables, operators, colormaps, usesci, lin, vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)"] + +v5nonrestartcalls = [ +# Overplots and flux lines +"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", + +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', colormap='hot_desaturated')", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', colormap='hot_desaturated', vscale=1e3)", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='x', colormap='RdBu',symlog=0, usesci=0)", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='y', colormap='RdBu',symlog=0)", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='z', colormap='RdBu',symlog=0, usesci=0)", + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho_nonthermal', colormap='jet')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta',lin=1, usesci=0, colormap='viridis',vmax=50)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_Mms',lin=1,usesci=0, vmin=0, colormap='magma')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_va',lin=1,usesci=0, colormap='magma_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vms',lin=1, colormap='plasma_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vs',lin=1, colormap='viridis_r')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_maxdt_acceleration', vscale=1e6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_maxdt_acceleration', vscale=1e3)", + +# Vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature', colormap='plasma', vscale=1e-6,lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure', vscale=1e9)", + +# Symlog and vscale +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-12)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", + +# Zoom and units +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + +# Externals and expressions +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", + +# Everything at once +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='magma')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20,vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400,vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20,vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400,vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", + +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", + +# More data reducers +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeam',lin=1)", +# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeamRatio')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_gyrotropy')"] + +v5multipopcalls = [ +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')"] diff --git a/testpackage/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_plot_colormap3dslice.py new file mode 100644 index 00000000..f631b73a --- /dev/null +++ b/testpackage/testpackage_plot_colormap3dslice.py @@ -0,0 +1,361 @@ +nonrestartcalls=["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_colormap3dslice(filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0,highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0,highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,highres=3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='msec')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='musec')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,wmarkb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NE')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NW')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SE')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SW')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,Earth=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,fsaved=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,fsaved=1,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,step=REPLACETIME)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e3,vmax=7.e6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e-3,vmax=7.e0,vscale=1e-6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e6,vmax=7.e9,vscale=1e3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,0,5])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,1,0])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[-1,0,0])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[1,1,1])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='jet')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='plasma')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='magma')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,fsaved='red')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,fluxrope=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,fluxrope=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated',vscale=1e3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='x',colormap='RdBu',symlog=0,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='y',colormap='RdBu',symlog=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='z',colormap='RdBu',symlog=0,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='RhoBackstream',colormap='jet')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta',lin=1,usesci=0,colormap='viridis',vmax=50)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='MA',lin=1,usesci=0,vmin=2,vmax=40,colormap='inferno_r')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Mms',lin=1,usesci=0,vmin=0,colormap='magma')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='va',lin=1,usesci=0,colormap='magma_r')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vms',lin=1,colormap='plasma_r')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vs',lin=1,colormap='viridis_r')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e6)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature',colormap='plasma',vscale=1e-6,lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure',vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-12)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-3,vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['rho','B','beta'])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['va'],vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,boxre=[0,30,-15,15],vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,lin=1,colormap='bwr',usesci=0,boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['rho'],boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['beta'])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,boxre=[0,30,-15,15],expression=exprMA_cust,vmin=1,vmax=20,lin=1,usesci=0,fsaved=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectorcolormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectorcolormap='magma')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectordensity=20)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectordensity=400)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectordensity=20,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectordensity=400,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20,vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400,vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20,boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400,boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20,vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400,vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=20,boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='E',vectordensity=400,boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinecolor='black')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinecolor='gray')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinedensity=0.5,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='B',streamlinedensity=2,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=2,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=0.5,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='V',streamlinedensity=2,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VBackstream',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VNonBackstream',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallel',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicular',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelBackstream',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularBackstream',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelNonBackstream',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularNonBackstream',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeam',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeamRatio')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')"] + +restartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] + +multipopcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VParallel',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VPerpendicular',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularNonBackstream')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaParallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Thermalvelocity',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Blocks')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/gyrotropy')"] + +v5restartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_restart_v')"] + +v5nonrestartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral',vscale=1e9)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='x',colormap='bwr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='z',colormap='bwr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1,vscale=1e-3)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='x',colormap='PuOr')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='y',colormap='PuOr',symlog=0,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='z',colormap='PuOr',symlog=0,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['vg_va'],vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_rho'],boxre=[0,30,-15,15])", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_beta'])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectordensity=400,boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectordensity=20,boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectorcolormap='viridis')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectordensity=400)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectordensity=20,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectorsize=1,vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinecolor='black')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinecolor='gray')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinedensity=0.5,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_b_vol',streamlinedensity=2,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=2,streamlinethick=2)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=0.5,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,streamlines='vg_v',streamlinedensity=2,boxre=[-10,10,5,50])", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rho')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_nonthermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_nonthermal',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_thermal',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] + +v5multipopcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_parallel',op='magnitude',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pressure')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_temperature')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_blocks')", +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_gyrotropy')"] + diff --git a/testpackage/testpackage_plot_ionosphere.py b/testpackage/testpackage_plot_ionosphere.py new file mode 100644 index 00000000..f3f0d331 --- /dev/null +++ b/testpackage/testpackage_plot_ionosphere.py @@ -0,0 +1,241 @@ +nonrestartcalls=["pt.plot.plot_ionosphere(filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_ionosphere(vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_ionosphere(filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=0.5)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=0.5)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='msec')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='musec')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmarkb=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NE')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NW')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SE')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SW')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',nocb=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',internalcb=1)", +"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,step=REPLACETIME)", +"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e3,vmax=7.e6)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e-3,vmax=7.e0,vscale=1e-6)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e6,vmax=7.e9,vscale=1e3)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='jet')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='viridis')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='plasma')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='magma')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated',vscale=1e3)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='x',colormap='RdBu',symlog=0,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='y',colormap='RdBu',symlog=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='z',colormap='RdBu',symlog=0,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='RhoBackstream',colormap='jet')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta',lin=1,usesci=0,colormap='viridis',vmax=50)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='MA',lin=1,usesci=0,vmin=2,vmax=40,colormap='inferno_r')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Mms',lin=1,usesci=0,vmin=0,colormap='magma')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='va',lin=1,usesci=0,colormap='magma_r')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vms',lin=1,colormap='plasma_r')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vs',lin=1,colormap='viridis_r')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e6)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e3)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature',colormap='plasma',vscale=1e-6,lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure',vscale=1e9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-12)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-3,vscale=1e9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VBackstream',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VNonBackstream',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallel',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicular',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelBackstream',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularBackstream',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelNonBackstream',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularNonBackstream',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdyn',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdynx',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeam',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeamRatio')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')"] + +restartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] + +multipopcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VParallel',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VPerpendicular',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pressure')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdyn',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdynx',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Temperature')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularNonBackstream')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverPar',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/beta')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaParallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Thermalvelocity',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Blocks')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/gyrotropy')"] + +v5restartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_restart_v')"] + +v5nonrestartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral',vscale=1e9)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='x',colormap='bwr')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='z',colormap='bwr')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1,vscale=1e-3)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='x',colormap='PuOr')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='y',colormap='PuOr',symlog=0,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='z',colormap='PuOr',symlog=0,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rho')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_nonthermal',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_thermal',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_nonthermal',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_thermal',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pressure')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdyn',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdynx',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_temperature')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)"] + +v5multipopcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_parallel',op='magnitude',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pressure')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_temperature')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_blocks')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_gyrotropy')"] + diff --git a/testpackage/testpackage_plot_isosurface.py b/testpackage/testpackage_plot_isosurface.py new file mode 100644 index 00000000..90717b9c --- /dev/null +++ b/testpackage/testpackage_plot_isosurface.py @@ -0,0 +1,82 @@ +nonrestartcalls=["pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,nooverwrite=1)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,thick=0.5)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,scale=0.5)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,highres=True)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0,highres=True)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0,highres=True)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,highres=3)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='msec')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='musec')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NE')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NW')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SE')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SW')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='',nocb=1)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,title='',highres=True)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[-10,10,5,50])", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,step=REPLACETIME)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e3,vmax=7.e6)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e-3,vmax=7.e0,vscale=1e-6)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e6,vmax=7.e9,vscale=1e3)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='jet')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='viridis')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='plasma')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='magma')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated',vscale=1e3)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='RdBu',symlog=0,usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='RdBu',symlog=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,usesci=0,colormap='viridis',vmax=50)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,usesci=0,vmin=2,vmax=40,colormap='inferno_r')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,usesci=0,vmin=0,colormap='magma')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,usesci=0,colormap='magma_r')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,colormap='plasma_r')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,colormap='viridis_r')", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vscale=1e6)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vscale=1e3)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='plasma',vscale=1e-6,lin=1)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vscale=1e9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=1e-9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=1e-12)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr',symlog=1e-3,vscale=1e9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[0,30,-15,15])", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,boxre=[0,30,-15,15],vmin=1,vmax=20,lin=1,usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,lin=1,colormap='bwr',usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,lin=1,colormap='bwr',usesci=0,boxre=[0,30,-15,15])", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,boxre=[0,30,-15,15])", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=0.1,vmax=10)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0.5,vmax=1.5,usesci=0)"] + +restartcalls=[] + +multipopcalls=[] + +v5restartcalls=[] + +v5nonrestartcalls=["pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral',vscale=1e9)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1,vscale=1e-3)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr',symlog=0,usesci=0)"] + +v5multipopcalls=[] + diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_plot_vdf.py new file mode 100644 index 00000000..be0ba93b --- /dev/null +++ b/testpackage/testpackage_plot_vdf.py @@ -0,0 +1,128 @@ + +restartcalls = [ +# Input and output methods, nooverwrite +"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", + +# cellids, coordinates +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", + + +# Thickness, scale +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", + +# Tick interval +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", + +# msec musec titles +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", + +# B vector +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", + +# Zoom and units +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", + +# Watermarks +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", + +# Biglabels +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", + +# title, axes, noborders +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", + +# slicethick +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", + +# cellsize +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", + +# fmin, fmax, setThreshold +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", + +# colormaps +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", + +# cbulk, center, bvector +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + +# wflux +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", + +# directions +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +] + +multipopcalls = [ +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] diff --git a/testpackage/testpackage_plot_vdf_profiles.py b/testpackage/testpackage_plot_vdf_profiles.py new file mode 100644 index 00000000..6a460426 --- /dev/null +++ b/testpackage/testpackage_plot_vdf_profiles.py @@ -0,0 +1,73 @@ +nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,cellids=REPLACECELLID)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,thick=0.5)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=10)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,title='msec')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,title='musec')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,wmarkb=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NE')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NW')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SE')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SW')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,title='')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,step=REPLACETIME)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e3,vmax=7.e6)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e-3,vmax=7.e0)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e6,vmax=7.e9)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,axisunit=3)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,axisunit=6)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,axisunit=0)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,fmin=1.e-14,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,fmin=1.e-14,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,setThreshold=1.e-20,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,setThreshold=1.e-15,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,setThreshold=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,cbulk=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,center=[-7e5,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,center=[2e5,2e5,2e5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,xy=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,0,5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,xz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,1,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,yz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[-1,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,bpara=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,bperp=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[1,1,1],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmax=50)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=2,vmax=40)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=1,vmax=20,lin=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,lin=1)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=0.1,vmax=10)", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0.5,vmax=1.5)"] + +restartcalls=[] + +multipopcalls=["pt.plot.plot_vdf_profiles(vlsvobj=f,run=verifydir+REPLACEINDEX,pop='REPLACEPOP',coordre=REPLACECOORDRE)"] + +v5restartcalls=[] + +v5nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='x')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='y')", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='z')"] + +v5multipopcalls=[] + diff --git a/testpackage/testpackage_plot_vdfdiff.py b/testpackage/testpackage_plot_vdfdiff.py new file mode 100644 index 00000000..d4ab07af --- /dev/null +++ b/testpackage/testpackage_plot_vdfdiff.py @@ -0,0 +1,107 @@ +nonrestartcalls=["pt.plot.plot_vdfdiff(outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX)", +"pt.plot.plot_vdfdiff(outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_vdfdiff(outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", +"pt.plot.plot_vdfdiff(filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellids=REPLACECELLID)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,thick=0.5)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,thick=2.0)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,scale=0.5)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,scale=2.0)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=10)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='msec')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='musec')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmarkb=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='NE')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='NW')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='SE')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='SW')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noborder=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,step=REPLACETIME)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=3)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=6)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=0)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=4,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=1e3,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=0.5,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=4,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmin=1.e-14,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmin=1.e-14,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=1.e-20,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=1.e-15,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='A',coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='B',biglabloc=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='C',biglabloc=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='D',biglabloc=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='E',biglabloc=3,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,cbulk=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,center=[-7e5,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,center=[2e5,2e5,2e5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wflux=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xy=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xy=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[0,0,5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xz=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[0,1,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,yz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,yz=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[-1,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bpara=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bpara=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bperp=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bperp=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[1,1,1],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='jet')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='viridis')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='plasma')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='magma')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='warhol')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='bwr')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='PuOr')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='RdBu')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='inferno_r')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='magma_r')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='plasma_r')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='viridis_r')"] + +restartcalls=[] + +multipopcalls=["pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,pop='REPLACEPOP',coordre=REPLACECOORDRE)"] + +v5restartcalls=[] + +v5nonrestartcalls=["pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='x')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='y')", +"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='z')"] + +v5multipopcalls=[] + diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py new file mode 100644 index 00000000..0ec11231 --- /dev/null +++ b/testpackage/testpackage_template_maker.py @@ -0,0 +1,696 @@ +import analysator as pt +import sys, os +import numpy as np +import traceback +import inspect +import logging +import re +import argparse + +#add manualcals filtering or something since rightnow it tries to do it for 3D data? does it work? + +argp=argparse.ArgumentParser( + prog='Analysator Testpackage', + description='Outputs test plots' +) + + +argp.add_argument('funcs',type=str,help="function/list of functions to test, if none give does all.",nargs='*') +cmd_args=argp.parse_args() +funcs_to_use=cmd_args.funcs +if "pass" in funcs_to_use: + quit() + + + +#required args for functions, lists are handled as OR statements, tuples within lists as AND +#add a way to add required args automatically + +#list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults + +#maybe add overide to this in runs append + +#filedir issues test with the one below and see if fixed, alos other errors + +required_args ={ + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] + +} + + + +#This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake +agnostic_call = [ + + +# Input and output methods, nooverwrite +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", + +# cellids, coordinates +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", + + + +# Thickness, scale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + +# Tick interval +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", + +# msec musec titles +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + +# Watermarks +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + + + + +# title, axes, noborders +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + + + +# Overplots and flux lines +"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", + +# Vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", + + +# Zoom and units +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + + +# slicethick (Mostly for vdf,vdf_prof,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", +# cellsize (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", +# fmin, fmax, setThreshold (same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", +# Biglabels(vdf,vdfdiff) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", +# cbulk, center, bvector(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + +# wflux(same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +# directions(about same) +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", + + + +# colormaps +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", + +#colorbar +#not yet in in master see PR #359 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + +#AMR, fsaved +#Does not work currently, fix for the AMR contour is in PR #364 +#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", +] + + +#This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls +nonrestartcalls=[] +v5nonrestartcalls=[] +restartcalls=[] +v5restartcalls=[] +nonrestartcalls.extend(agnostic_call) +v5nonrestartcalls.extend(agnostic_call) +restartcalls.extend(agnostic_call) +v5restartcalls.extend(agnostic_call) + +v5restartcalls.extend([ + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" + +]) + +restartcalls.extend([ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" + +]) + +nonrestartcalls.extend([ + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", + +# Symlog and vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", + +# Externals and expressions +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", + +# Everything at once +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", + + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", + +# More data reducers +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"]) + + + + + + + +v5nonrestartcalls.extend([ +# Variables, operators, colormaps, usesci, lin, vscale +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", + + +# Externals and expressions +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", + + +# Everything at once +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + +# Streamlines, vectors +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", + +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", + + +# More data reducers +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" + +]) + + +v5multipopcalls=[ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" +] + + +multipopcalls=[ +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", +"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] + + +# For handier debugging, uncomment these to overwrite call lists and include only relevant calls +# restartcalls = [] +# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", +# ] +# multipopcalls = [] +# v5restartcalls = [] +# v5nonrestartcalls = [] +# v5multipopcalls = [] + +def call_replace(call,func,skipped_args): + #This is kind of scuffed maybe + + call=call.replace('REPLACEFUNC',func) + + #Get the arguments of the call + args = re.search(r'\((.+)\)',call).group(1) + args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] + named_parameters=[arg.split("=")[0] for arg in args] + #Get parameters of the func + function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args + #Remove args that are not present as parameters for the func + args_out=[] + #check that all required func args are set + if required_args and func in required_args.keys(): + for required_tuple in required_args[func]: + required_params=required_tuple[0] + default_params=required_tuple[1] + check=False + for param in required_params: + if any((all(r in named_parameters for r in param),(param in named_parameters))): + check=True + break + if not check: + #print("REQUIRED",call,named_parameters,required_params) + + #Add parameters if there are default_params + if default_params: + for param in default_params: + if param not in named_parameters: + args_out.append(param) + # print("ADDED",param,call) + else: + #print("NOT ADDED",call) + return None + + + #add execption for tuple? + for arg in args: + if arg: + if skipped_args and func in skipped_args.keys(): + skipped_args_dict=skipped_args[func] + call_args=arg.split("=") + if call_args[0] in skipped_args_dict.keys(): + if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: + continue + elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): + continue + if arg.split("=")[0] in function_pars: + args_out.append(arg) + #else: + # logging.warning(f"Argument {arg} removed from call {call}") + + if not args_out: + return None +# if func=="plot_vdf": +# print(args_out) + args_out=filter(None,args_out) + call=call[:call.rfind("(")+1]+",".join(args_out)+")" +# print("BEFORE",call) + return call + + + + + +calls = [] + + + +functions = funcs_to_use +if not functions: + quit() + +skipped_args=[] + + + +for j,func in enumerate(functions): + copy_of_lists=[nonrestartcalls.copy(),restartcalls.copy(),multipopcalls.copy(),v5restartcalls.copy(),v5nonrestartcalls.copy(),v5multipopcalls.copy()] + for calls_in in copy_of_lists: + temp_list=[] + v5restart_replace=False + restart_replace=False + if calls_in == v5restartcalls: + v5restart_replace=True + elif calls_in == restartcalls: + restart_replace=True + + for call in calls_in: + call=call_replace(call,func,skipped_args) + if not call: + continue + + if v5restart_replace: + call = call.replace("var='vg_v'","var='vg_restart_v'") + elif restart_replace: + call = call.replace("var='V'","var='restart_V'") + + if call not in calls: + calls.append(call) + temp_list.append(call) + + calls_in[:]=temp_list + + + + with open(f"testpackage_{func}.py","w") as f: + f.write("nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[0]])+"]\n\n") + f.write("restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[1]])+"]\n\n") + f.write("multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[2]])+"]\n\n") + + #v5 + f.write("v5restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[3]])+"]\n\n") + f.write("v5nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[4]])+"]\n\n") + f.write("v5multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[5]])+"]\n\n") + + From a86cf0e818132d520ddd33a201e688cdf1088c6d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 13:16:55 +0200 Subject: [PATCH 178/341] added runs and added uses for call_replace and made it importable from template_maker --- testpackage/testpackage_commons.py | 75 +- testpackage/testpackage_template_maker.py | 1189 +++++++++++---------- 2 files changed, 653 insertions(+), 611 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index b68c6f44..62b6164c 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -6,8 +6,8 @@ import logging import re import argparse +from testpackage_template_maker import call_replace -#add manualcals filtering or something since rightnow it tries to do it for 3D data? does it work? argp=argparse.ArgumentParser( prog='Analysator Testpackage', @@ -25,8 +25,35 @@ datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] - - +''' +runs.append( { 'name': 'ABC', + 'verifydir': '/ABC/', + 'fileLocation': datalocation+'/2D/ABC/bulk/', + 'fluxLocation': datalocation+'/2D/ABC/flux/', + 'skipped_args':None, + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'pops': ['avgs'], + 'time': 1000, + 'singletime': False, + 'filename': None, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) +''' +runs.append( { 'name': 'BED', + 'verifydir': '/BED/', + 'fluxLocation': None, + 'fileLocation': datalocation+'/2D/BED/bulk/', + 'pops': ['avgs'], + 'time': 2000, + 'singletime':True, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'skipped_args':None, + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'filename': None , + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] + }) ''' runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', @@ -41,7 +68,6 @@ 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) -''' runs.append( { 'name': 'BCQ', 'verifydir': '/BCQ/', @@ -59,11 +85,10 @@ } ) -''' runs.append( { 'name': 'BCQr', 'verifydir': '/BCQr/', 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/restart/', + 'fileLocation': datalocation+'/2D/BCQ/restart/', 'pops': ['avgs'], 'fluxLocation': None, 'singletime': True, # neighboring bulk files not available @@ -74,9 +99,7 @@ 'nosubpops': False, # thermal / non-thermal 'filename': 'restart.0001361.vlsv', 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -''' - -''' + runs.append( { 'name': 'BGA', 'verifydir': '/BGA/', 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', @@ -108,6 +131,22 @@ 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) ''' +runs.append( { 'name': 'BFDr', + 'verifydir': '/BFDr/', + 'funcs': ['plot_colormap','plot_vdf'], + 'fileLocation': datalocation+'/2D/BFD/restart/', + 'pops': ['avgs'], + 'fluxLocation': None, + 'singletime': True, # neighboring bulk files not available + 'time': 1126, + 'manualcall':False, + 'skipped_args':{'plot_vdf':{'normal':'','step':'','filedir':''}}, + 'nosubpops': False, # thermal / non-thermal + 'vlasiator5': False, + 'filename': 'restart.0001126.vlsv', + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) + + #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop @@ -139,6 +178,7 @@ if not funcs_to_use: functions = run['funcs'] + else: functions = list(set(run['funcs']) & set(funcs_to_use)) if not functions: @@ -164,17 +204,21 @@ except: exec(f'{call_list}=[]') + skipped_args=run['skipped_args'] + + if vlasiator5: exec(f'testpackage_{func}.vlasiator5=True') if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: - if not filename is None: - if vlasiator5: - call = call.replace("var='vg_v'","var='vg_restart_v'") - else: - call = call.replace("var='V'","var='restart_V'") + if skipped_args: + call=call_replace(call,func,skipped_args) + if vlasiator5: + call = call.replace("var='vg_v'","var='vg_restart_v'") + else: + call = call.replace("var='V'","var='restart_V'") callrunids.append(i) calls.append(call) callrunindex.append(callindex) @@ -217,9 +261,6 @@ for pop in run['pops']: if pop != 'avgs': for call in calls_in: - call=call_replace(call,func,skipped_args) - if not call: - continue # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: continue diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 0ec11231..59080170 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -9,563 +9,6 @@ #add manualcals filtering or something since rightnow it tries to do it for 3D data? does it work? -argp=argparse.ArgumentParser( - prog='Analysator Testpackage', - description='Outputs test plots' -) - - -argp.add_argument('funcs',type=str,help="function/list of functions to test, if none give does all.",nargs='*') -cmd_args=argp.parse_args() -funcs_to_use=cmd_args.funcs -if "pass" in funcs_to_use: - quit() - - - -#required args for functions, lists are handled as OR statements, tuples within lists as AND -#add a way to add required args automatically - -#list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults - -#maybe add overide to this in runs append - -#filedir issues test with the one below and see if fixed, alos other errors - -required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], - "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], - "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] - -} - - - -#This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake -agnostic_call = [ - - -# Input and output methods, nooverwrite -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", - -# cellids, coordinates -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", - - - -# Thickness, scale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", - -# msec musec titles -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - - - - -# title, axes, noborders -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - - - -# Overplots and flux lines -"pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", - -# Vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", - - -# Zoom and units -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - - -# slicethick (Mostly for vdf,vdf_prof,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", -# cellsize (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", -# fmin, fmax, setThreshold (same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", -# Biglabels(vdf,vdfdiff) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", -# cbulk, center, bvector(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", - -# wflux(same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", -# directions(about same) -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", - - - -# colormaps -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", - -#colorbar -#not yet in in master see PR #359 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", - -#AMR, fsaved -#Does not work currently, fix for the AMR contour is in PR #364 -#"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", -] - - -#This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls -nonrestartcalls=[] -v5nonrestartcalls=[] -restartcalls=[] -v5restartcalls=[] -nonrestartcalls.extend(agnostic_call) -v5nonrestartcalls.extend(agnostic_call) -restartcalls.extend(agnostic_call) -v5restartcalls.extend(agnostic_call) - -v5restartcalls.extend([ - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" - -]) - -restartcalls.extend([ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" - -]) - -nonrestartcalls.extend([ - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", - -# Symlog and vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - -# Externals and expressions -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", - -# Everything at once -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", - - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", - -# More data reducers -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"]) - - - - - - - -v5nonrestartcalls.extend([ -# Variables, operators, colormaps, usesci, lin, vscale -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", - - -# Externals and expressions -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", - - -# Everything at once -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", - -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", - - -# More data reducers -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" - -]) - - -v5multipopcalls=[ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" -] - - -multipopcalls=[ -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", -"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] - # For handier debugging, uncomment these to overwrite call lists and include only relevant calls # restartcalls = [] @@ -575,7 +18,7 @@ # v5restartcalls = [] # v5nonrestartcalls = [] # v5multipopcalls = [] - +required_args=False def call_replace(call,func,skipped_args): #This is kind of scuffed maybe @@ -639,58 +82,616 @@ def call_replace(call,func,skipped_args): return call +if __name__=='__main__': - -calls = [] + argp=argparse.ArgumentParser( + prog='Analysator Testpackage', + description='Outputs test plots' + ) + argp.add_argument('funcs',type=str,help="function/list of functions to test, if none give does all.",nargs='*') + cmd_args=argp.parse_args() + funcs_to_use=cmd_args.funcs + if "pass" in funcs_to_use: + quit() -functions = funcs_to_use -if not functions: - quit() -skipped_args=[] + #required args for functions, lists are handled as OR statements, tuples within lists as AND + #add a way to add required args automatically + #list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults -for j,func in enumerate(functions): - copy_of_lists=[nonrestartcalls.copy(),restartcalls.copy(),multipopcalls.copy(),v5restartcalls.copy(),v5nonrestartcalls.copy(),v5multipopcalls.copy()] - for calls_in in copy_of_lists: - temp_list=[] - v5restart_replace=False - restart_replace=False - if calls_in == v5restartcalls: - v5restart_replace=True - elif calls_in == restartcalls: - restart_replace=True + #maybe add overide to this in runs append - for call in calls_in: - call=call_replace(call,func,skipped_args) - if not call: - continue + #filedir issues test with the one below and see if fixed, alos other errors - if v5restart_replace: - call = call.replace("var='vg_v'","var='vg_restart_v'") - elif restart_replace: - call = call.replace("var='V'","var='restart_V'") + required_args ={ + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] + + } - if call not in calls: - calls.append(call) - temp_list.append(call) - calls_in[:]=temp_list + #This can be v4 or v5, these both get added into nonrestartcalls and v5nonrestartcalls, here for cleanliness sake + agnostic_call = [ - with open(f"testpackage_{func}.py","w") as f: - f.write("nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[0]])+"]\n\n") - f.write("restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[1]])+"]\n\n") - f.write("multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[2]])+"]\n\n") + # Input and output methods, nooverwrite + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX)", + "pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", + "pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", - #v5 - f.write("v5restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[3]])+"]\n\n") - f.write("v5nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[4]])+"]\n\n") - f.write("v5multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[5]])+"]\n\n") + # cellids, coordinates + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", + + + + # Thickness, scale + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", + + # Tick interval + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6)", + + # msec musec titles + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", + + # Watermarks + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", + + + + + # title, axes, noborders + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", + + + + # Overplots and flux lines + "pt.plot.REPLACEFUNC(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", + + # Vscale + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", + + + # Zoom and units + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", + + + # slicethick (Mostly for vdf,vdf_prof,vdfdiff) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", + # cellsize (same) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", + # fmin, fmax, setThreshold (same) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", + # Biglabels(vdf,vdfdiff) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", + # cbulk, center, bvector(same) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + + # wflux(same) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", + # directions(about same) + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", + + + + # colormaps + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", + + #colorbar + #not yet in in master see PR #359 + #"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + + #AMR, fsaved + #Does not work currently, fix for the AMR contour is in PR #364 + #"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", + ] + + + #This is here so the agnostic calls are first and the order doesnt change if you add something to nonrestartcalls + nonrestartcalls=[] + v5nonrestartcalls=[] + restartcalls=[] + v5restartcalls=[] + nonrestartcalls.extend(agnostic_call) + v5nonrestartcalls.extend(agnostic_call) + restartcalls.extend(agnostic_call) + v5restartcalls.extend(agnostic_call) + + v5restartcalls.extend([ + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')" + + ]) + + restartcalls.extend([ + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V')" + + ]) + + nonrestartcalls.extend([ + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", + + # Symlog and vscale + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", + + # Externals and expressions + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", + + # Everything at once + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + + # Streamlines, vectors + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", + + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", + + # More data reducers + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"]) + + + + + + + + v5nonrestartcalls.extend([ + # Variables, operators, colormaps, usesci, lin, vscale + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", + + + # Externals and expressions + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", + + + # Everything at once + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + + # Streamlines, vectors + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='z',vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='x',vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='y',vectordensity=200)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectorsize=1,normal='z',vectordensity=200)", + + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", + + + # More data reducers + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", + "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" + + ]) + + + v5multipopcalls=[ + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')" + ] + + + multipopcalls=[ + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] + + + calls = [] + + + + functions = funcs_to_use + if not functions: + quit() + + skipped_args=[] + + + + for j,func in enumerate(functions): + copy_of_lists=[nonrestartcalls.copy(),restartcalls.copy(),multipopcalls.copy(),v5restartcalls.copy(),v5nonrestartcalls.copy(),v5multipopcalls.copy()] + for calls_in in copy_of_lists: + temp_list=[] + v5restart_replace=False + restart_replace=False + if calls_in == v5restartcalls: + v5restart_replace=True + elif calls_in == restartcalls: + restart_replace=True + + for call in calls_in: + call=call_replace(call,func,skipped_args) + if not call: + continue + + if v5restart_replace: + call = call.replace("var='vg_v'","var='vg_restart_v'") + elif restart_replace: + call = call.replace("var='V'","var='restart_V'") + + if call not in calls: + calls.append(call) + temp_list.append(call) + + calls_in[:]=temp_list + + + + with open(f"testpackage_{func}.py","w") as f: + f.write("nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[0]])+"]\n\n") + f.write("restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[1]])+"]\n\n") + f.write("multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[2]])+"]\n\n") + + #v5 + f.write("v5restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[3]])+"]\n\n") + f.write("v5nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[4]])+"]\n\n") + f.write("v5multipopcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[5]])+"]\n\n") From b0c5a5e7123dede5dfa48167cd6bb57c8e8c9f36 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 13:55:40 +0200 Subject: [PATCH 179/341] added required args back and trying to make it work again --- testpackage/testpackage_commons.py | 13 +++++++++++-- testpackage/testpackage_template_maker.py | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 62b6164c..f7ca9dac 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -140,7 +140,7 @@ 'singletime': True, # neighboring bulk files not available 'time': 1126, 'manualcall':False, - 'skipped_args':{'plot_vdf':{'normal':'','step':'','filedir':''}}, + 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, 'nosubpops': False, # thermal / non-thermal 'vlasiator5': False, 'filename': 'restart.0001126.vlsv', @@ -160,6 +160,13 @@ # v5multipopcalls = [] +required_args ={ + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] + +} + calls = [] callrunids = [] @@ -214,7 +221,9 @@ calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: if skipped_args: - call=call_replace(call,func,skipped_args) + call=call_replace(call,func,skipped_args,required_args) + if call is None: + continue if vlasiator5: call = call.replace("var='vg_v'","var='vg_restart_v'") else: diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 59080170..0a9b930b 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -19,7 +19,7 @@ # v5nonrestartcalls = [] # v5multipopcalls = [] required_args=False -def call_replace(call,func,skipped_args): +def call_replace(call,func,skipped_args,required_args=required_args): #This is kind of scuffed maybe call=call.replace('REPLACEFUNC',func) @@ -33,16 +33,19 @@ def call_replace(call,func,skipped_args): #Remove args that are not present as parameters for the func args_out=[] #check that all required func args are set + if required_args and func in required_args.keys(): for required_tuple in required_args[func]: required_params=required_tuple[0] default_params=required_tuple[1] + check=False for param in required_params: if any((all(r in named_parameters for r in param),(param in named_parameters))): check=True break if not check: + #print("REQUIRED",call,named_parameters,required_params) #Add parameters if there are default_params From 84d944182b31dd4480eabe9515ac926ec9827703 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 24 Nov 2025 14:18:23 +0200 Subject: [PATCH 180/341] fixed required args so it takes into account skipped params --- testpackage/testpackage_template_maker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 0a9b930b..0628dc35 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -41,7 +41,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): check=False for param in required_params: - if any((all(r in named_parameters for r in param),(param in named_parameters))): + if any((all(r in named_parameters for r in param),(param in named_parameters))) and not any(r in skipped_args[func].keys() for r in param): check=True break if not check: From b6b0b02aa91baba57e0701bcbcb9a2ac55e34c43 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 15:30:58 +0200 Subject: [PATCH 181/341] uncommented runs and fixed argument call things so it now calls work properly --- testpackage/testpackage_commons.py | 64 +++++++++++++++--------- testpackage/testpackage_plot_colormap.py | 2 - 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index f7ca9dac..1077dd0a 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -25,21 +25,21 @@ datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] -''' + runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'skipped_args':None, + 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'pops': ['avgs'], - 'time': 1000, + 'time': 100, 'singletime': False, 'filename': None, 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) -''' + runs.append( { 'name': 'BED', 'verifydir': '/BED/', 'fluxLocation': None, @@ -54,7 +54,7 @@ 'filename': None , 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] }) -''' + runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', @@ -62,6 +62,7 @@ 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], 'pops': ['avgs'], 'time': 1000, + 'skipped_args':None, 'singletime': False, 'filename': None, #restart file 'manualcall':False, @@ -92,8 +93,8 @@ 'pops': ['avgs'], 'fluxLocation': None, 'singletime': True, # neighboring bulk files not available - 'time': 0, - 'skipped_args':None, + 'time': 1361, + 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, 'manualcall':False, 'vlasiator5': False, 'nosubpops': False, # thermal / non-thermal @@ -130,7 +131,8 @@ 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -''' + + runs.append( { 'name': 'BFDr', 'verifydir': '/BFDr/', 'funcs': ['plot_colormap','plot_vdf'], @@ -147,7 +149,6 @@ 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) - #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop # For handier debugging, uncomment these to overwrite call lists and include only relevant calls @@ -161,7 +162,7 @@ required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] @@ -183,6 +184,7 @@ nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] + if not funcs_to_use: functions = run['funcs'] @@ -220,19 +222,18 @@ if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: - if skipped_args: - call=call_replace(call,func,skipped_args,required_args) - if call is None: - continue if vlasiator5: call = call.replace("var='vg_v'","var='vg_restart_v'") else: call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + if skipped_args: + call=call_replace(call,func,skipped_args,required_args) + if call is not None: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) # non-restart files @@ -291,6 +292,7 @@ + nteststot = len(callrunids) # How many jobs? @@ -321,7 +323,17 @@ runname = runs[runid]['name'] - func = runs[runid]['funcs'][funcid] + #func = runs[runid]['funcs'][funcid] + + if not funcs_to_use: + func = runs[runid]['funcs'][funcid] + + else: + func = list(set(runs[runid]['funcs']) & set(funcs_to_use))[funcid] + print(func,runs[runid]['funcs'],funcs_to_use,runs[runid]['verifydir']) + if not func: + continue + verifydir = func+runs[runid]['verifydir'] fileLocation = runs[runid]['fileLocation'] @@ -333,10 +345,11 @@ singletime = runs[runid]['singletime'] #set custom expression variables for plot_colormap - testpackage_plot_colormap.level_bow_shock = runs[runid]['cavitonparams'][0] - testpackage_plot_colormap.level_n_caviton = runs[runid]['cavitonparams'][1] - testpackage_plot_colormap.level_B_caviton = runs[runid]['cavitonparams'][2] - testpackage_plot_colormap.level_beta_SHFA = runs[runid]['cavitonparams'][3] + if 'plot_colormap' == func: + testpackage_plot_colormap.level_bow_shock = runs[runid]['cavitonparams'][0] + testpackage_plot_colormap.level_n_caviton = runs[runid]['cavitonparams'][1] + testpackage_plot_colormap.level_B_caviton = runs[runid]['cavitonparams'][2] + testpackage_plot_colormap.level_beta_SHFA = runs[runid]['cavitonparams'][3] # verifydir=os.path.join(verifydir) @@ -356,7 +369,8 @@ fluxname = "flux."+str(time).rjust(7,'0')+".bin" - if run=="ABC": + if runs[runid]['name']=="ABC" and func=='plot_vdf': + fileLocation=fileLocation.replace('bulk','distributions') bulkname = "distributions."+str(time).rjust(7,'0')+".vlsv" diff --git a/testpackage/testpackage_plot_colormap.py b/testpackage/testpackage_plot_colormap.py index e6ff122a..ffce6d12 100644 --- a/testpackage/testpackage_plot_colormap.py +++ b/testpackage/testpackage_plot_colormap.py @@ -1,7 +1,5 @@ import numpy as np -vlasiator5=None - # Custom expression function From 77524c6808989968992b2e3b0c689c63a214350a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 15:31:21 +0200 Subject: [PATCH 182/341] added nonrestart calls for plot_vdf --- testpackage/testpackage_plot_vdf.py | 124 ++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_plot_vdf.py index be0ba93b..f59c6ffc 100644 --- a/testpackage/testpackage_plot_vdf.py +++ b/testpackage/testpackage_plot_vdf.py @@ -107,6 +107,130 @@ # wflux "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", +# directions +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +] +nonrestartcalls = [ +# Input and output methods, nooverwrite +"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", + +# cellids, coordinates +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", + + +# Thickness, scale +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", + +# Tick interval +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", + +# msec musec titles +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", + +# B vector +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", + +# Zoom and units +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", + +# Watermarks +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", + +# Biglabels +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", + +# title, axes, noborders +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", + +# slicethick +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", + +# cellsize +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", + +# fmin, fmax, setThreshold +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", + +# colormaps +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", + +# cbulk, center, bvector +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", + +# wflux +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", + # directions "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", From b6e13c9538fbf81e26055fa281c4edc81048b892 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 15:55:40 +0200 Subject: [PATCH 183/341] removed normal skip arg for now as it is borked in testpackage_vdf also --- testpackage/testpackage_commons.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 1077dd0a..0344aa0f 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -30,7 +30,7 @@ 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, + 'skipped_args':{'plot_vdf':{'step':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'pops': ['avgs'], 'time': 100, @@ -72,13 +72,13 @@ runs.append( { 'name': 'BCQ', 'verifydir': '/BCQ/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/bulk/', + 'fileLocation': datalocation+'/2D/BCQ/bulk/', 'fluxLocation': None, 'singletime': False, 'pops': ['avgs'], 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'time': 2000, - 'skipped_args':None, + 'skipped_args':None, 'filename': None, 'vlasiator5':False, 'nosubpops':False, @@ -94,7 +94,7 @@ 'fluxLocation': None, 'singletime': True, # neighboring bulk files not available 'time': 1361, - 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, + 'skipped_args':{'plot_vdf':{'step':''}}, 'manualcall':False, 'vlasiator5': False, 'nosubpops': False, # thermal / non-thermal @@ -122,7 +122,7 @@ 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', 'fluxprefix': 'bulk.', 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], - 'skipped_args':{'plot_vdf':{'normal':''}}, + 'skipped_args':None, 'pops': ['proton','helium'], 'time': 2000, 'singletime': False, @@ -142,7 +142,7 @@ 'singletime': True, # neighboring bulk files not available 'time': 1126, 'manualcall':False, - 'skipped_args':{'plot_vdf':{'normal':'','step':''}}, + 'skipped_args':{'plot_vdf':{'step':''}}, 'nosubpops': False, # thermal / non-thermal 'vlasiator5': False, 'filename': 'restart.0001126.vlsv', From 7193b36366f328a310158033211e50d7264c3b6d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 24 Nov 2025 16:01:42 +0200 Subject: [PATCH 184/341] removed colormap from some calls as they are not incuded in the original plot_colormap (maybe added later) --- testpackage/testpackage_commons.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 0344aa0f..4c20c016 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -50,7 +50,7 @@ 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, 'skipped_args':None, - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'funcs': ['plot_vdf','plot_vdf_profiles'], 'filename': None , 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] }) @@ -88,7 +88,7 @@ runs.append( { 'name': 'BCQr', 'verifydir': '/BCQr/', - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'funcs': ['plot_vdf','plot_vdf_profiles'], 'fileLocation': datalocation+'/2D/BCQ/restart/', 'pops': ['avgs'], 'fluxLocation': None, @@ -135,7 +135,7 @@ runs.append( { 'name': 'BFDr', 'verifydir': '/BFDr/', - 'funcs': ['plot_colormap','plot_vdf'], + 'funcs': ['plot_vdf'], 'fileLocation': datalocation+'/2D/BFD/restart/', 'pops': ['avgs'], 'fluxLocation': None, From 5d3d611b44e91c3eae56bcecd4fdbae1f9b7777f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 25 Nov 2025 11:03:56 +0200 Subject: [PATCH 185/341] fixing vlasiator5 tag and added comment for reminder for later --- testpackage/testpackage_commons.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4c20c016..fb060125 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -33,7 +33,7 @@ 'skipped_args':{'plot_vdf':{'step':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'pops': ['avgs'], - 'time': 100, + 'time': 1000, #gets the plot_vdf distirbution file wrong, need to rethink this for vdf 'singletime': False, 'filename': None, 'nosubpops': False, # backstreaming / non-backstreaming @@ -216,8 +216,7 @@ skipped_args=run['skipped_args'] - if vlasiator5: - exec(f'testpackage_{func}.vlasiator5=True') + if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls @@ -351,6 +350,10 @@ testpackage_plot_colormap.level_B_caviton = runs[runid]['cavitonparams'][2] testpackage_plot_colormap.level_beta_SHFA = runs[runid]['cavitonparams'][3] + if vlasiator5: + exec(f'testpackage_{func}.vlasiator5=True') + else: + exec(f'testpackage_{func}.vlasiator5=False') # verifydir=os.path.join(verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) From a6b836cb82a8a69768d02d2f994451639b02a38d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 25 Nov 2025 11:23:22 +0200 Subject: [PATCH 186/341] added normalx to calls with normal so it actually works --- testpackage/testpackage_plot_vdf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_plot_vdf.py index f59c6ffc..fbc6dc9d 100644 --- a/testpackage/testpackage_plot_vdf.py +++ b/testpackage/testpackage_plot_vdf.py @@ -110,18 +110,18 @@ # directions "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5],normalx=[0,5,0], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0],normalx=[0,0,1], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0],normalx=[0,1,0], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)", ] nonrestartcalls = [ # Input and output methods, nooverwrite @@ -234,18 +234,18 @@ # directions "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5],normalx=[0,5,0], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0],normalx=[0,0,1], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0],normalx=[0,1,0], coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)" ] multipopcalls = [ From 7af025377a4bd60ab2684b3c4650b59c6e29f4af Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 25 Nov 2025 11:23:44 +0200 Subject: [PATCH 187/341] added exception for ABC for plot_vdf --- testpackage/testpackage_commons.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index fb060125..03cf6870 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -33,7 +33,7 @@ 'skipped_args':{'plot_vdf':{'step':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'pops': ['avgs'], - 'time': 1000, #gets the plot_vdf distirbution file wrong, need to rethink this for vdf + 'time': 1000, 'singletime': False, 'filename': None, 'nosubpops': False, # backstreaming / non-backstreaming @@ -374,7 +374,7 @@ if runs[runid]['name']=="ABC" and func=='plot_vdf': fileLocation=fileLocation.replace('bulk','distributions') - bulkname = "distributions."+str(time).rjust(7,'0')+".vlsv" + bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" #annoyance since timestep 1000 does not seem to exist we are going with 100 then call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") From 67ba4074dc84bc0abf11c945663e73188964e604 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 25 Nov 2025 15:27:48 +0200 Subject: [PATCH 188/341] removed pointless delimiter from list --- testpackage/testpackage_plot_vdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_plot_vdf.py index fbc6dc9d..c1828b46 100644 --- a/testpackage/testpackage_plot_vdf.py +++ b/testpackage/testpackage_plot_vdf.py @@ -121,7 +121,7 @@ "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)" ] nonrestartcalls = [ # Input and output methods, nooverwrite From 9a773cf2382a42640bde74277e891bf378599e35 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 14:11:56 +0200 Subject: [PATCH 189/341] added comment to point out one duplicate call for the future (removing it would break the compatiblity with previous ones so left it alone) --- testpackage/testpackage_plot_vdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_plot_vdf.py index c1828b46..3aed616a 100644 --- a/testpackage/testpackage_plot_vdf.py +++ b/testpackage/testpackage_plot_vdf.py @@ -134,7 +134,7 @@ # cellids, coordinates "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)",#Duplicate call "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", From bc36ff466e52e92efe08ed13e80ea018262bfc52 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 14:12:35 +0200 Subject: [PATCH 190/341] restructured plot_colormap calls --- testpackage/testpackage_plot_colormap.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_plot_colormap.py b/testpackage/testpackage_plot_colormap.py index ffce6d12..0afdc27a 100644 --- a/testpackage/testpackage_plot_colormap.py +++ b/testpackage/testpackage_plot_colormap.py @@ -443,6 +443,13 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] v5restartcalls = [ +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)"] + +v5nonrestartcalls = [ # Input and output methods, nooverwrite "pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", @@ -498,9 +505,8 @@ def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)"] +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", -v5nonrestartcalls = [ # Overplots and flux lines "pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", From cebf54f2628066c934ed93d3415aa749dc1c038b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 14:16:15 +0200 Subject: [PATCH 191/341] added legacy mode to make the plot output same as the older testpackages (not counting for some changes like fixes (this one does normal= vdf calls correctly)) --- testpackage/testpackage_commons.py | 125 ++++++++++++++++------------- 1 file changed, 67 insertions(+), 58 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 03cf6870..c614e115 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -25,6 +25,9 @@ datalocation = "/wrk-vakka/group/spacephysics/vlasiator" runs = [] +#Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do +legacy_mode=True + runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', @@ -85,7 +88,6 @@ 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) - runs.append( { 'name': 'BCQr', 'verifydir': '/BCQr/', 'funcs': ['plot_vdf','plot_vdf_profiles'], @@ -116,21 +118,6 @@ 'nosubpops': True, # thermal / non-thermal 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -runs.append( { 'name': 'BFD', - 'verifydir': '/BFD/', - 'fileLocation': datalocation+'/2D/BFD/bulk/', - 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', - 'fluxprefix': 'bulk.', - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], - 'skipped_args':None, - 'pops': ['proton','helium'], - 'time': 2000, - 'singletime': False, - 'filename': None, - 'manualcall':False, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) runs.append( { 'name': 'BFDr', @@ -148,6 +135,21 @@ 'filename': 'restart.0001126.vlsv', 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) +runs.append( { 'name': 'BFD', + 'verifydir': '/BFD/', + 'fileLocation': datalocation+'/2D/BFD/bulk/', + 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', + 'fluxprefix': 'bulk.', + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'skipped_args':None, + 'pops': ['proton','helium'], + 'time': 2000, + 'singletime': False, + 'filename': None, + 'manualcall':False, + 'nosubpops': False, # backstreaming / non-backstreaming + 'vlasiator5': False, + 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) #keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop @@ -173,7 +175,6 @@ callrunids = [] callrunindex = [] funcids=[] -offset=0 for i,run in enumerate(runs): # bulk and restart files @@ -184,21 +185,19 @@ nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - + if not funcs_to_use: functions = run['funcs'] else: - functions = list(set(run['funcs']) & set(funcs_to_use)) + functions = sorted(list(set(run['funcs']) & set(funcs_to_use))) if not functions: continue - callindex = 0 - - for j,func in enumerate(functions): - + callindex = 0 + #try to import the list of calls corresponding to the function to be tested. Skip if not found try: exec(f'import testpackage_{func}') @@ -216,8 +215,6 @@ skipped_args=run['skipped_args'] - - if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls for call in calls_in: @@ -225,7 +222,7 @@ call = call.replace("var='vg_v'","var='vg_restart_v'") else: call = call.replace("var='V'","var='restart_V'") - if skipped_args: + if skipped_args and not legacy_mode: call=call_replace(call,func,skipped_args,required_args) if call is not None: callrunids.append(i) @@ -242,7 +239,7 @@ for call in calls_in: # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: + if ("fluxdir" in call or "fluxfile" in call) and fluxLocation is None: continue #change the extrnal and expression calls to correct format @@ -259,11 +256,16 @@ continue elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) + if skipped_args and not legacy_mode: + call=call_replace(call,func,skipped_args,required_args) + if call is not None: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) + + #multipop calls calls_in=v5multipopcalls if vlasiator5 else multipopcalls @@ -282,13 +284,14 @@ elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue call = call.replace('REPLACEPOP',pop) - - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - funcids.append(j) - + if skipped_args and not legacy_mode: + call=call_replace(call,func,skipped_args,required_args) + if call is not None: + callrunids.append(i) + calls.append(call) + callrunindex.append(callindex) + callindex += 1 + funcids.append(j) @@ -316,20 +319,18 @@ # Calculate which run jrun = callrunindex[j] runid = callrunids[j] + runname = runs[runid]['name'] + call = calls[j] funcid=funcids[j] - runname = runs[runid]['name'] - - #func = runs[runid]['funcs'][funcid] if not funcs_to_use: func = runs[runid]['funcs'][funcid] - else: - func = list(set(runs[runid]['funcs']) & set(funcs_to_use))[funcid] - print(func,runs[runid]['funcs'],funcs_to_use,runs[runid]['verifydir']) + else: + func = sorted(list(set(runs[runid]['funcs']) & set(funcs_to_use)))[funcid] if not func: continue @@ -355,9 +356,24 @@ else: exec(f'testpackage_{func}.vlasiator5=False') -# verifydir=os.path.join(verifydir) outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) + + #Annoyances due to previous testpackages having different times used for plot_vdf and plot_colormap + if legacy_mode: + if func=='plot_vdf': + if runs[runid]['name']=='ABC': + time=100 + elif runs[runid]['name']=="BCQ": + time=1600 + elif runs[runid]['name']=="BFD": + time=1000 + elif runs[runid]['name']=="BFDr": + time=0 + if not filename is None and "step=" in call: + continue + + # Source data files if filename is None: if '2D' not in fileLocation: @@ -371,12 +387,13 @@ else: fluxname = "flux."+str(time).rjust(7,'0')+".bin" - if runs[runid]['name']=="ABC" and func=='plot_vdf': fileLocation=fileLocation.replace('bulk','distributions') - bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" #annoyance since timestep 1000 does not seem to exist we are going with 100 then + bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" + if "step=" in call and legacy_mode: + continue + - call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") call = call.replace('REPLACETIME',"'"+str(time)+"'") @@ -394,18 +411,10 @@ f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: exec(call) - #print(call) - #quit() + except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) traceback.print_exc() print("END TRACE for call",j,"\n----------------------------") -#add way to specify which function to test -#add a way to add expections to variables etc easily. (DONE) -#currenlty does multiple calls (Fixed with list but still needs better implementation as we waste bit of time going through multiple things) -#add manual calls (DONE) -#why spend time going through all calls on all threads? -#v5 vdf?? (post 2019 are v5) - From 628e681fcb2a02ccbd18d3ab6d89c787d4816172 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 17:30:08 +0200 Subject: [PATCH 192/341] fixing things for vdf_profiles --- testpackage/testpackage_commons.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index c614e115..b400b647 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -26,14 +26,14 @@ runs = [] #Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do -legacy_mode=True +legacy_mode=False runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'skipped_args':{'plot_vdf':{'step':''}}, + 'skipped_args':{'plot_vdf':{'step':''},'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'pops': ['avgs'], 'time': 1000, @@ -52,7 +52,7 @@ 'singletime':True, 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, - 'skipped_args':None, + 'skipped_args':{'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}}, 'funcs': ['plot_vdf','plot_vdf_profiles'], 'filename': None , 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] @@ -81,7 +81,7 @@ 'pops': ['avgs'], 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], 'time': 2000, - 'skipped_args':None, + 'skipped_args':{'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}}, 'filename': None, 'vlasiator5':False, 'nosubpops':False, @@ -165,8 +165,8 @@ required_args ={ "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], - "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], - "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] + "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], + "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step"),'vlsvobj','filename'],None)] } @@ -387,9 +387,10 @@ else: fluxname = "flux."+str(time).rjust(7,'0')+".bin" - if runs[runid]['name']=="ABC" and func=='plot_vdf': + if runs[runid]['name']=="ABC" and 'plot_vdf' in func: fileLocation=fileLocation.replace('bulk','distributions') bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" + time=100 if "step=" in call and legacy_mode: continue @@ -413,7 +414,7 @@ exec(call) except Exception as e: - print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) + print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) traceback.print_exc() print("END TRACE for call",j,"\n----------------------------") From 1b36f23c7dd0a097257ea47a910fa354a8bc8b91 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 17:31:04 +0200 Subject: [PATCH 193/341] fixing testpackage_plot_ionosphere --- testpackage/testpackage_plot_ionosphere.py | 315 ++++++--------------- 1 file changed, 80 insertions(+), 235 deletions(-) diff --git a/testpackage/testpackage_plot_ionosphere.py b/testpackage/testpackage_plot_ionosphere.py index f3f0d331..78be4eb7 100644 --- a/testpackage/testpackage_plot_ionosphere.py +++ b/testpackage/testpackage_plot_ionosphere.py @@ -1,241 +1,86 @@ -nonrestartcalls=["pt.plot.plot_ionosphere(filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX)", -"pt.plot.plot_ionosphere(vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", -"pt.plot.plot_ionosphere(filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=0.5)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,thick=2.0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=0.5)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,scale=2.0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='msec')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='musec')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmarkb=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NE')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='NW')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SE')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,wmark='SW')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',cbtitle='')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',nocb=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,title='',internalcb=1)", -"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,step=REPLACETIME)", -"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e3,vmax=7.e6)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e-3,vmax=7.e0,vscale=1e-6)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=7.e6,vmax=7.e9,vscale=1e3)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='jet')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='viridis')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='plasma')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='magma')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='bwr')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',colormap='hot_desaturated',vscale=1e3)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='x',colormap='RdBu',symlog=0,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='y',colormap='RdBu',symlog=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='E',op='z',colormap='RdBu',symlog=0,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='RhoBackstream',colormap='jet')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta',lin=1,usesci=0,colormap='viridis',vmax=50)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='MA',lin=1,usesci=0,vmin=2,vmax=40,colormap='inferno_r')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Mms',lin=1,usesci=0,vmin=0,colormap='magma')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='va',lin=1,usesci=0,colormap='magma_r')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vms',lin=1,colormap='plasma_r')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vs',lin=1,colormap='viridis_r')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e6)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='max_v_dt',vscale=1e3)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature',colormap='plasma',vscale=1e-6,lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure',vscale=1e9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-12)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=0,vscale=1e9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1,vscale=1e9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-3,vscale=1e9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=1,vmax=20,lin=1,usesci=0)", -"pt.plot.plot_ionosphere(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VBackstream',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VNonBackstream',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallel',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicular',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelBackstream',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularBackstream',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VParallelNonBackstream',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='VPerpendicularNonBackstream',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pressure')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PParallelNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpendicularNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='PPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdyn',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Pdynx',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Temperature')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TParallelNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpendicularNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='TPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='beta')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='betaPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeam',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeamRatio')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')"] -restartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] +v5restartcalls=[] -multipopcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VParallel',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/VPerpendicular',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pressure')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PParallelNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpendicularNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/PPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdyn',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Pdynx',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Temperature')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TParallelNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpendicularNonBackstream')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/TPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverPar',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpOverParNonBackstream',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/beta')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaParallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/betaPerpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Thermalvelocity',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/Blocks')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/gyrotropy')"] +v5nonrestartcalls=[ +#outputs, nooverwrite +"pt.plot.plot_ionosphere(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_ionosphere(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", +"pt.plot.plot_ionosphere(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", +#colormaps -v5restartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_restart_v')"] +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", -v5nonrestartcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',colormap='nipy_spectral',vscale=1e9)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='x',colormap='bwr')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_b_vol',op='z',colormap='bwr')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',colormap='warhol',lin=1,vscale=1e-3)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='x',colormap='PuOr')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='y',colormap='PuOr',symlog=0,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='z',colormap='PuOr',symlog=0,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rho')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_nonthermal',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_thermal',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_nonthermal',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_nonthermal',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_parallel_thermal',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v_perpendicular_thermal',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pressure')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_parallel_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_perpendicular_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdyn',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_pdynx',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_temperature')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_parallel_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_perpendicular_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)"] +#colorbar +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, nocb=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, internalcb=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, symlog=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, symlog=0)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, lin=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, log=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, cbtitle='cbtitle')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, usesci=0)", -v5multipopcalls=["pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_parallel',op='magnitude',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_perpendicular',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pressure')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_parallel_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_perpendicular_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_p_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdyn',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_pdynx',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_temperature')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_nonthermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_parallel_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_perpendicular_thermal')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_t_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_nonthermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_anisotropy_thermal',vmin=0.1,vmax=10)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_parallel')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_beta_perpendicular')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_thermalvelocity',lin=1)", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_blocks')", -"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_gyrotropy')"] +# Thickness, scale +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=5.0)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol',lin=1, vscale=1e-3)", + + +# Watermarks,title +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, title='title_test')", + +#vmin,vmax,Symmetric +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, symmetric=True,vmin=2,vmax=40)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vmin=2,vmax=40)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vmin=0)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vscale=1e9)", +#operators +#"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,var='ig_electrontemp',op='x')", +#"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,var='ig_electrontemp',op='y')", +#"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,var='ig_electrontemp',op='z')", + +#variables +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_fac')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_fac',viewdir=-1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_fac',viewdir=10)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_fac',absolute=1)", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_cellarea')", +#"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_deltaphi')", (Causes failure) +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_electrontemp')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_latitude')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_openclosed')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_potential')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_precipitation')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_rhon')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_sigmah')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_sigmap')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_sigmaparallel')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_source')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_residual')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_p')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_pp')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_z')", +"pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_zz')", + +] + +v5multipopcalls=[ +] From ea9f3db1e95fc4c9b4562611e01f7a72b9ba49b5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 17:31:29 +0200 Subject: [PATCH 194/341] added if statement for the case there are no skipped args --- testpackage/testpackage_template_maker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 0628dc35..b14c8937 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -41,9 +41,10 @@ def call_replace(call,func,skipped_args,required_args=required_args): check=False for param in required_params: - if any((all(r in named_parameters for r in param),(param in named_parameters))) and not any(r in skipped_args[func].keys() for r in param): - check=True - break + if any((all(r in named_parameters for r in param),(param in named_parameters))): + if not func in skipped_args or not any(r in skipped_args[func].keys() for r in param): + check=True + break if not check: #print("REQUIRED",call,named_parameters,required_params) From 5df1ee2949d6e0691aac3f8983f8900b95315aa5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 17:32:12 +0200 Subject: [PATCH 195/341] fixed normal plots and extended v5calls with non v5 calls since they work in this case --- testpackage/testpackage_plot_vdf_profiles.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_plot_vdf_profiles.py b/testpackage/testpackage_plot_vdf_profiles.py index 6a460426..ee0acc58 100644 --- a/testpackage/testpackage_plot_vdf_profiles.py +++ b/testpackage/testpackage_plot_vdf_profiles.py @@ -65,9 +65,11 @@ v5restartcalls=[] -v5nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='x')", -"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='y')", -"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal='z')"] +v5nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[1,0,0])", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,1,0])", +"pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX,normal=[0,0,1])"] + +v5nonrestartcalls.extend(nonrestartcalls) v5multipopcalls=[] From 38f4fc8e9a6850f13bb945bcab4867eab35d2cde Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 18:47:34 +0200 Subject: [PATCH 196/341] Added FID run and made custom_expressions work differently so less code duplication is needed --- testpackage/testpackage_commons.py | 40 ++-- testpackage/testpackage_custom_expr.py | 183 +++++++++++++++++ testpackage/testpackage_plot_colormap.py | 184 +----------------- .../testpackage_plot_colormap3dslice.py | 7 +- 4 files changed, 219 insertions(+), 195 deletions(-) create mode 100644 testpackage/testpackage_custom_expr.py diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index b400b647..a1b2610a 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -28,7 +28,6 @@ #Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do legacy_mode=False - runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', @@ -58,6 +57,21 @@ 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] }) +runs.append( { 'name': 'FID', + 'verifydir': '/FID/', + 'fileLocation': datalocation+'/3D/FID/bulk1/', + 'fluxLocation': None, + 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], + 'pops': ['avgs'], + 'time': 1000, + 'skipped_args':{'plot_ionosphere':{"var":["ig_z","ig_p","ig_source","ig_residual"]}}, #ig_zz and ig_pp is also skipped on purpose + 'singletime': False, + 'filename': None, #restart file + 'manualcall':False, + 'nosubpops': True, # backstreaming / non-backstreaming + 'vlasiator5': True, + 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) + runs.append( { 'name': 'FHA', 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', @@ -185,7 +199,9 @@ nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - +# if run['name']!='FID': +# continue + if not funcs_to_use: functions = run['funcs'] @@ -244,9 +260,9 @@ #change the extrnal and expression calls to correct format if f"expression=testpackage_{func}" not in call and "expression=" in call: - call=call.replace("expression=",f"expression=testpackage_{func}.") + call=call.replace("expression=",f"expression=testpackage_{func}.cexp.") if f"external=testpackage_{func}" not in call and "external=" in call: - call=call.replace("external=",f"external=testpackage_{func}.") + call=call.replace("external=",f"external=testpackage_{func}.cexp.") # skip time integration if only one file available if "pass_times" in call and singletime: @@ -345,17 +361,19 @@ singletime = runs[runid]['singletime'] #set custom expression variables for plot_colormap - if 'plot_colormap' == func: - testpackage_plot_colormap.level_bow_shock = runs[runid]['cavitonparams'][0] - testpackage_plot_colormap.level_n_caviton = runs[runid]['cavitonparams'][1] - testpackage_plot_colormap.level_B_caviton = runs[runid]['cavitonparams'][2] - testpackage_plot_colormap.level_beta_SHFA = runs[runid]['cavitonparams'][3] + if 'plot_colormap' in func: + exec(f"testpackage_{func}.cexp.level_bow_shock = runs[runid]['cavitonparams'][0]") + exec(f"testpackage_{func}.cexp.level_n_caviton = runs[runid]['cavitonparams'][1]") + exec(f"testpackage_{func}.cexp.level_B_caviton = runs[runid]['cavitonparams'][2]") + exec(f"testpackage_{func}.cexp.level_beta_SHFA = runs[runid]['cavitonparams'][3]") + #Custom expression vlasiator5 toggle if vlasiator5: - exec(f'testpackage_{func}.vlasiator5=True') + exec(f'testpackage_{func}.cexp.vlasiator5=True') else: - exec(f'testpackage_{func}.vlasiator5=False') + exec(f'testpackage_{func}.cexp.vlasiator5=False') + outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) diff --git a/testpackage/testpackage_custom_expr.py b/testpackage/testpackage_custom_expr.py new file mode 100644 index 00000000..0834f4d7 --- /dev/null +++ b/testpackage/testpackage_custom_expr.py @@ -0,0 +1,183 @@ +import numpy as np + + + +# Custom expression function +def exprMA_cust(exprmaps, requestvariables=False): + if vlasiator5 is True: + reqs = ['vg_va'] + else: + reqs = ['va'] + if requestvariables==True: + return reqs + # exprmaps is a dictionary of numpy arrays + # Each array has 2 dimensions [xsize, ysize] + # or 3 dimensions [xsize, ysize, components] + # here the function returns the M_A with a preset bulk velocity + custombulkspeed=1500000. # m/s + va = exprmaps[reqs[0]][:,:] + MA = np.ma.divide(custombulkspeed,va) + return MA + +# Second example of a more involved custom expression function +def expr_cav_cust(pass_maps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # This custom expression returns a map with values of + # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against + # time-averaged background values. This version doesn't do intelligent checks for the + # format of the incoming data. + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + + # Multiple time steps were found + ntimes = len(pass_maps) + dsteps = [x['dstep'] for x in pass_maps] + curri = dsteps.index(0) + thesemaps = pass_maps[curri] + + thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) + thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) + thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) + thisBmag = np.linalg.norm(thisB, axis=-1) + + avgrho = np.zeros(np.array(thisrho.shape)) + avgBmag = np.zeros(np.array(thisrho.shape)) + # avgbeta = np.zeros(np.array(thisrho.shape)) + + for i in range(ntimes): + if i==curri: # Exclude current frame from background value averaging + continue + nowmaps = pass_maps[i] + print(nowmaps['dstep']) + avgrho = np.add(avgrho, nowmaps[reqs[0]]) + avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) + avgBmag = np.add(avgBmag, avgBcalc) + # avgbeta = np.add(avgbeta, nowmaps[2]) + + avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) + avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) + #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) + + rhoratio = np.ma.divide(thisrho, avgrho) + Bmagratio = np.ma.divide(thisBmag, avgBmag) + #betaratio = np.divide(thisbeta, avgbeta) + + rhoratioreq = 0.9 + bmagratioreq = 0.9 + betashfareq = level_beta_SHFA + + # Calculations using masked arrays proved problematic so a less-than elegant method is used here. + empty = np.zeros(np.array(thisrho.shape))+0.0 + half = empty + 0.5 + one = empty + 1.0 + + caviton=np.zeros(empty.shape,dtype='float64') + np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) + print("sum of SHFA ",shfa.sum()) + + combo=np.zeros(empty.shape,dtype='float64') + np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) + print("sum of combo ",combo.sum()) + combo2=np.zeros(empty.shape,dtype='float64') + combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) + print("sum of combo2 ",combo2.sum()) + combo3 = combo+combo2 + print("sum of combo3 ",combo3.sum()) + + # Mask out anything that is inside the bow shock + combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) + print("sum of combo3 upstream ",combo3.sum()) + + return combo3 + + +# Second example of a more involved custom expression function +def timesmooth(pass_maps): + # pass_maps is a dictionary of numpy arrays + # Each array has 2 dimensions [ysize, xsize] + # or 3 dimensions [ysize, xsize, components] + + # for time averaging, it's a list of dictionaries + # Each dictionary contains an entry called 'dstep' + # Which contains the relative time step position, i.e. + # a value of 0 indicates no time offset. + + # consists of a single [ysize,xsize] array to smooth over time + + if type(pass_maps) is not list: + # Not a list of time steps, calculating this value does not make sense. + print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") + quit() + ntimes = len(pass_maps) + print("this many time steps ",ntimes) + # Select first valid variable + listofkeys = iter(pass_maps[0]) + while True: + var = next(listofkeys) + if var!="dstep": break + + # Multiple time steps were found + avg = np.zeros(pass_maps[0][var].shape) + for i in range(ntimes): + avg = np.add(avg, pass_maps[i][var]) + return np.divide(avg, np.array([ntimes])) + +# Helper function for drawing on existing panel +def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): + if vlasiator5 is True: + reqs= ['vg_rho','vg_b_vol','vg_beta'] + else: + reqs= ['rho', 'B', 'beta'] + if requestvariables==True: + return reqs + + rho = extmaps[reqs[0]] + beta = extmaps[reqs[2]] + # take magnitude of B + B = np.linalg.norm(extmaps[reqs[1]],axis=-1) + + # Colours to use + color_cavitons = '#924900' + color_SHFAs = '#B66DFF' + color_BS = '#FFFF6D' + + # mask cavitons + cavitons = np.ma.masked_greater_equal(B,level_B_caviton) + cavitons.mask[rho > level_n_caviton] = True + cavitons.fill_value = 0. + cavitons[cavitons.mask == False] = 1. + + # mask SHFAs + SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) + SHFAs.mask[rho > level_n_caviton] = True + SHFAs.mask[beta < level_beta_SHFA] = True + SHFAs.fill_value = 0. + SHFAs[SHFAs.mask == False] = 1. + + # draw contours + contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], + linewidths=1.2, colors=color_BS) + contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) + contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) diff --git a/testpackage/testpackage_plot_colormap.py b/testpackage/testpackage_plot_colormap.py index 0afdc27a..73d52cdb 100644 --- a/testpackage/testpackage_plot_colormap.py +++ b/testpackage/testpackage_plot_colormap.py @@ -1,186 +1,4 @@ - -import numpy as np - - -# Custom expression function -def exprMA_cust(exprmaps, requestvariables=False): - if vlasiator5 is True: - reqs = ['vg_va'] - else: - reqs = ['va'] - if requestvariables==True: - return reqs - # exprmaps is a dictionary of numpy arrays - # Each array has 2 dimensions [xsize, ysize] - # or 3 dimensions [xsize, ysize, components] - # here the function returns the M_A with a preset bulk velocity - custombulkspeed=1500000. # m/s - va = exprmaps[reqs[0]][:,:] - MA = np.ma.divide(custombulkspeed,va) - return MA - -# Second example of a more involved custom expression function -def expr_cav_cust(pass_maps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # This custom expression returns a map with values of - # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against - # time-averaged background values. This version doesn't do intelligent checks for the - # format of the incoming data. - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - - # Multiple time steps were found - ntimes = len(pass_maps) - dsteps = [x['dstep'] for x in pass_maps] - curri = dsteps.index(0) - thesemaps = pass_maps[curri] - - thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) - thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) - thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) - thisBmag = np.linalg.norm(thisB, axis=-1) - - avgrho = np.zeros(np.array(thisrho.shape)) - avgBmag = np.zeros(np.array(thisrho.shape)) - # avgbeta = np.zeros(np.array(thisrho.shape)) - - for i in range(ntimes): - if i==curri: # Exclude current frame from background value averaging - continue - nowmaps = pass_maps[i] - print(nowmaps['dstep']) - avgrho = np.add(avgrho, nowmaps[reqs[0]]) - avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) - avgBmag = np.add(avgBmag, avgBcalc) - # avgbeta = np.add(avgbeta, nowmaps[2]) - - avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) - avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) - #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) - - rhoratio = np.ma.divide(thisrho, avgrho) - Bmagratio = np.ma.divide(thisBmag, avgBmag) - #betaratio = np.divide(thisbeta, avgbeta) - - rhoratioreq = 0.9 - bmagratioreq = 0.9 - betashfareq = level_beta_SHFA - - # Calculations using masked arrays proved problematic so a less-than elegant method is used here. - empty = np.zeros(np.array(thisrho.shape))+0.0 - half = empty + 0.5 - one = empty + 1.0 - - caviton=np.zeros(empty.shape,dtype='float64') - np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) - print("sum of SHFA ",shfa.sum()) - - combo=np.zeros(empty.shape,dtype='float64') - np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) - print("sum of combo ",combo.sum()) - combo2=np.zeros(empty.shape,dtype='float64') - combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) - print("sum of combo2 ",combo2.sum()) - combo3 = combo+combo2 - print("sum of combo3 ",combo3.sum()) - - # Mask out anything that is inside the bow shock - combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) - print("sum of combo3 upstream ",combo3.sum()) - - return combo3 - - -# Second example of a more involved custom expression function -def timesmooth(pass_maps): - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # consists of a single [ysize,xsize] array to smooth over time - - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - print("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") - quit() - ntimes = len(pass_maps) - print("this many time steps ",ntimes) - # Select first valid variable - listofkeys = iter(pass_maps[0]) - while True: - var = next(listofkeys) - if var!="dstep": break - - # Multiple time steps were found - avg = np.zeros(pass_maps[0][var].shape) - for i in range(ntimes): - avg = np.add(avg, pass_maps[i][var]) - return np.divide(avg, np.array([ntimes])) - -# Helper function for drawing on existing panel -def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - - rho = extmaps[reqs[0]] - beta = extmaps[reqs[2]] - # take magnitude of B - B = np.linalg.norm(extmaps[reqs[1]],axis=-1) - - # Colours to use - color_cavitons = '#924900' - color_SHFAs = '#B66DFF' - color_BS = '#FFFF6D' - - # mask cavitons - cavitons = np.ma.masked_greater_equal(B,level_B_caviton) - cavitons.mask[rho > level_n_caviton] = True - cavitons.fill_value = 0. - cavitons[cavitons.mask == False] = 1. - - # mask SHFAs - SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) - SHFAs.mask[rho > level_n_caviton] = True - SHFAs.mask[beta < level_beta_SHFA] = True - SHFAs.fill_value = 0. - SHFAs[SHFAs.mask == False] = 1. - - # draw contours - contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], - linewidths=1.2, colors=color_BS) - contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) - contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) +import testpackage_custom_expr as cexp restartcalls = [ diff --git a/testpackage/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_plot_colormap3dslice.py index f631b73a..406c2850 100644 --- a/testpackage/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_plot_colormap3dslice.py @@ -1,3 +1,8 @@ + +import testpackage_custom_expr as cexp + + + nonrestartcalls=["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap3dslice(vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", @@ -239,7 +244,7 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='z',colormap='PuOr',symlog=0,usesci=0)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['vg_rho','vg_b_vol','vg_beta'])", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['vg_va'],vmin=1,vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_rho'],boxre=[0,30,-15,15])", "pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_beta'])", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,vectordensity=200)", From 8e64231c1f2ff838011c842475305ed8d1e72926 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 26 Nov 2025 18:53:29 +0200 Subject: [PATCH 197/341] moved vlasiator5 custom expression variable setting inside the if statement so only colormap and colormap3dslice use it for now. --- testpackage/testpackage_commons.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index a1b2610a..36ae2685 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -367,11 +367,11 @@ exec(f"testpackage_{func}.cexp.level_B_caviton = runs[runid]['cavitonparams'][2]") exec(f"testpackage_{func}.cexp.level_beta_SHFA = runs[runid]['cavitonparams'][3]") - #Custom expression vlasiator5 toggle - if vlasiator5: - exec(f'testpackage_{func}.cexp.vlasiator5=True') - else: - exec(f'testpackage_{func}.cexp.vlasiator5=False') + #Custom expression vlasiator5 toggle + if vlasiator5: + exec(f'testpackage_{func}.cexp.vlasiator5=True') + else: + exec(f'testpackage_{func}.cexp.vlasiator5=False') outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) From acb8645ccf4a29fdf6c93de593ff927c4f47a238 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 10:54:09 +0200 Subject: [PATCH 198/341] fixed so plot_vdfdiff takes vlsvobjs correctly and made filedir passing with steps work correctly --- analysator/pyPlots/plot_vdfdiff.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/analysator/pyPlots/plot_vdfdiff.py b/analysator/pyPlots/plot_vdfdiff.py index 8bee331c..c95fb04e 100644 --- a/analysator/pyPlots/plot_vdfdiff.py +++ b/analysator/pyPlots/plot_vdfdiff.py @@ -46,7 +46,7 @@ def plot_vdfdiff(filename1=None, filename2=None, vlsvobj1=None, vlsvobj2=None, - filedir=None, step=None, + filedir=None, step=None,step_diff=None, cellids=None, cellids2=None, pop="proton", coordinates=None, coordre=None, @@ -80,6 +80,7 @@ def plot_vdfdiff(filename1=None, filename2=None, :kword vlsvobj2: Optionally provide a python vlsvfile object instead :kword filedir: Optionally provide directory where files are located and use step for bulk file name :kword step: output step index, used for constructing output (and possibly input) filename + :kword step_diff: the second step index to use for a file in case filedir is used :kword outputdir: path to directory where output files are created (default: $HOME/Plots/ or override with PTOUTPUTDIR) If directory does not exist, it will be created. If the string does not end in a forward slash, the final parti will be used as a perfix for the files. @@ -187,11 +188,22 @@ def plot_vdfdiff(filename1=None, filename2=None, # Input file or object if filename1 is not None: vlsvReader1=pt.vlsvfile.VlsvReader(filename1) + elif vlsvobj1 is not None: + vlsvReader1=vlsvobj1 + elif ((filedir is not None) and (step is not None)): + filename = glob.glob(filedir+'bulk*'+str(step).rjust(7,'0')+'.vlsv')[0] + vlsvReader1=pt.vlsvfile.VlsvReader(filename) else: logging.info("Error, needs a .vlsv file name") return + if filename2 is not None: vlsvReader2=pt.vlsvfile.VlsvReader(filename2) + elif vlsvobj2 is not None: + vlsvReader2=vlsvobj2 + elif ((filedir is not None) and (step is not None)): + filename = glob.glob(filedir+'bulk*'+str(step_diff).rjust(7,'0')+'.vlsv')[0] + vlsvReader2=pt.vlsvfile.VlsvReader(filename) else: logging.info("Error, needs a .vlsv file name") return @@ -238,7 +250,7 @@ def plot_vdfdiff(filename1=None, filename2=None, if draw is None and axes is None: # step, used for file name if step is not None: - stepstr = '_'+str(step).rjust(7,'0') + stepstr = '_'+str(step).rjust(7,'0')+'_'+str(step_diff).rjust(7,'0') else: if timeval != None: stepstr = '_t'+str(int(timeval)) From 7e0b8ec197fb33e2e60a7a823d45759810057277 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 11:50:30 +0200 Subject: [PATCH 199/341] cleaned up call_replace and changed so required args work bit differently --- testpackage/testpackage_template_maker.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index b14c8937..5c6de078 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -18,6 +18,7 @@ # v5restartcalls = [] # v5nonrestartcalls = [] # v5multipopcalls = [] + required_args=False def call_replace(call,func,skipped_args,required_args=required_args): #This is kind of scuffed maybe @@ -32,8 +33,8 @@ def call_replace(call,func,skipped_args,required_args=required_args): function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args #Remove args that are not present as parameters for the func args_out=[] - #check that all required func args are set + #check that all required func args are set if required_args and func in required_args.keys(): for required_tuple in required_args[func]: required_params=required_tuple[0] @@ -41,26 +42,23 @@ def call_replace(call,func,skipped_args,required_args=required_args): check=False for param in required_params: - if any((all(r in named_parameters for r in param),(param in named_parameters))): - if not func in skipped_args or not any(r in skipped_args[func].keys() for r in param): + if type(param)==tuple and param[0] not in named_parameters: + check=True + elif any((all(r in named_parameters for r in param),(param in named_parameters))): + if not skipped_args or func not in skipped_args or not any(r in skipped_args[func].keys() for r in param): check=True break if not check: - - #print("REQUIRED",call,named_parameters,required_params) - #Add parameters if there are default_params if default_params: for param in default_params: if param not in named_parameters: args_out.append(param) - # print("ADDED",param,call) else: - #print("NOT ADDED",call) return None - #add execption for tuple? + #skip args if there are skipped args and append if called arg in function_pars for arg in args: if arg: if skipped_args and func in skipped_args.keys(): @@ -69,7 +67,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): if call_args[0] in skipped_args_dict.keys(): if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: continue - elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): + elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} continue if arg.split("=")[0] in function_pars: args_out.append(arg) @@ -78,11 +76,9 @@ def call_replace(call,func,skipped_args,required_args=required_args): if not args_out: return None -# if func=="plot_vdf": -# print(args_out) args_out=filter(None,args_out) call=call[:call.rfind("(")+1]+",".join(args_out)+")" -# print("BEFORE",call) + return call From 98c1f8efd4c19f614710b91f585e545cb52dc336 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 11:52:26 +0200 Subject: [PATCH 200/341] testpackage vdfdiff changes to make it work --- testpackage/testpackage_plot_vdfdiff.py | 195 ++++++++++++------------ 1 file changed, 97 insertions(+), 98 deletions(-) diff --git a/testpackage/testpackage_plot_vdfdiff.py b/testpackage/testpackage_plot_vdfdiff.py index d4ab07af..7e906124 100644 --- a/testpackage/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_plot_vdfdiff.py @@ -1,107 +1,106 @@ -nonrestartcalls=["pt.plot.plot_vdfdiff(outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX)", -"pt.plot.plot_vdfdiff(outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", -"pt.plot.plot_vdfdiff(outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", -"pt.plot.plot_vdfdiff(filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellids=REPLACECELLID)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordinates=REPLACECOORDINATES)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellids=REPLACEMULTIPLECELLID)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,thick=0.5)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,thick=2.0)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,scale=0.5)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,scale=2.0)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=10)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='msec')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='musec')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmarkb=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='NE')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='NW')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='SE')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wmark='SW')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noborder=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,step=REPLACETIME)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=3)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=6)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,axisunit=0)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=0,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=2,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=4,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,slicethick=1e3,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=0.5,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=2,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,cellsize=4,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmin=1.e-14,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmax=1.e-12,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,fmin=1.e-14,fmax=1.e-12,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=1.e-20,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=1.e-15,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,setThreshold=0,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='A',coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='B',biglabloc=0,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='C',biglabloc=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='D',biglabloc=2,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,biglabel='E',biglabloc=3,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,cbulk=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,center=[-7e5,0,0],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bvector=1,center=[2e5,2e5,2e5],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,wflux=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xy=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xy=1,coordswap=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[0,0,5],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xz=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,xz=1,coordswap=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[0,1,0],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,yz=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,yz=1,coordswap=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[-1,0,0],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bpara=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bpara=1,coordswap=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bperp=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,bperp=1,coordswap=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal=[1,1,1],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='nipy_spectral')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='jet')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='hot_desaturated')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='viridis')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='plasma')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='magma')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='warhol')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='bwr')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='PuOr')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='RdBu')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='inferno_r')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='magma_r')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='plasma_r')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,colormap='viridis_r')"] +nonrestartcalls=["pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputdir=outputLocation+'/'+REPLACEINDEX+'_',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(filedir=fileLocation,step=REPLACETIME,step_diff=REPLACETIME2,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(filename1=fileLocation+bulkname,filename2=fileLocation+bulkname_vdfdiff,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellids=REPLACECELLID)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordinates=REPLACECOORDINATES)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellids=REPLACEMULTIPLECELLID)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordinates=REPLACEMULTIPLECOORDINATES)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,thick=0.5,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,thick=2.0,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,scale=0.5,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,scale=2.,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=10,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='msec',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='musec',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wmarkb=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wmark='NE',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wmark='NW',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wmark='SE',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wmark='SW',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title=r'$\mathcal{Title}$ and so forth $\odot$',cbtitle=r'$\mathcal{Color}$',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noborder=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noxlabels=1,noborder=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noborder=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,nocb=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,step=REPLACETIME,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,axisunit=3,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,axisunit=6,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,axisunit=0,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,slicethick=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,slicethick=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,slicethick=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,slicethick=4,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,slicethick=1e3,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellsize=0.5,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellsize=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellsize=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,cellsize=4,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,fmin=1.e-14,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,fmin=1.e-14,fmax=1.e-12,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,setThreshold=1.e-20,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,setThreshold=1.e-15,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,setThreshold=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='A',coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='B',biglabloc=0,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='C',biglabloc=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='D',biglabloc=2,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='E',biglabloc=3,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,cbulk=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,center=[-7e5,0,0],center2=[0,0,-6e5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,center=[2e5,2e5,2e5],center2=[0,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wflux=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xy=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xy=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,normal=[0,0,5],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xz=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,normal=[0,1,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,yz=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,yz=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,normal=[-1,0,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bpara=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bpara=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bperp=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bperp=1,coordswap=1,coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,normal=[1,1,1],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='nipy_spectral',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='jet',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='hot_desaturated',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='hot_desaturated_r',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='viridis',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='plasma',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='magma',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='warhol',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='bwr',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='PuOr',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='RdBu',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='inferno_r',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='magma_r',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='plasma_r',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='viridis_r',coordre=REPLACEMULTIPLECOORDRE)"] restartcalls=[] -multipopcalls=["pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,pop='REPLACEPOP',coordre=REPLACECOORDRE)"] +multipopcalls=["pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,pop='REPLACEPOP',coordre=REPLACECOORDRE)"] v5restartcalls=[] -v5nonrestartcalls=["pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='x')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='y')", -"pt.plot.plot_vdfdiff(run=verifydir+REPLACEINDEX,normal='z')"] +v5nonrestartcalls=[] v5multipopcalls=[] From 9aa3eac38beb5f33452ec7546047ecccc6fbe1ef Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 12:00:36 +0200 Subject: [PATCH 201/341] added vdfdiff exceptions and runs --- testpackage/testpackage_commons.py | 54 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 36ae2685..ad9df889 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -8,7 +8,19 @@ import argparse from testpackage_template_maker import call_replace +def source_file_name(filename,fileLocation,time): + if filename is None: + if '2D' not in fileLocation: + bulkname = "bulk1."+str(time).rjust(7,'0')+".vlsv" + + else: + bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" + else: + bulkname=filename + return bulkname + + argp=argparse.ArgumentParser( prog='Analysator Testpackage', description='Outputs test plots' @@ -32,8 +44,9 @@ 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'skipped_args':{'plot_vdf':{'step':''},'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}}, - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'skipped_args':{'plot_vdf':{'step':''},'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}, + 'plot_vdfdiff':{'filedir':'','bpara':'','bperp':''}}, + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles','plot_vdfdiff'], 'pops': ['avgs'], 'time': 1000, 'singletime': False, @@ -93,7 +106,7 @@ 'fluxLocation': None, 'singletime': False, 'pops': ['avgs'], - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles','plot_vdfdiff'], 'time': 2000, 'skipped_args':{'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}}, 'filename': None, @@ -165,26 +178,15 @@ 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -#keys: v5bulk,v5restart,bulk,restart,v5multipop,multipop - -# For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# restartcalls = [] -# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -# ] -# multipopcalls = [] -# v5restartcalls = [] -# v5nonrestartcalls = [] -# v5multipopcalls = [] - - +#First arg in tuple is the one that needs to be there, second etc can be there without the first required_args ={ "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], + "plot_vdfdiff":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step"),'vlsvobj','filename'],None)] } - calls = [] callrunids = [] callrunindex = [] @@ -330,7 +332,8 @@ end = end + remainder -# Perform call + +# Perform calls for j in range(start,end): # Calculate which run jrun = callrunindex[j] @@ -393,13 +396,8 @@ # Source data files - if filename is None: - if '2D' not in fileLocation: - bulkname = "bulk1."+str(time).rjust(7,'0')+".vlsv" - else: - bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" - else: - bulkname = filename + bulkname = source_file_name(filename,fileLocation,time) + if 'fluxprefix' in runs[runid]: fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" else: @@ -412,6 +410,13 @@ if "step=" in call and legacy_mode: continue + if func == 'plot_vdfdiff': + time_offset=10 + bulkname_vdfdiff = source_file_name(filename,fileLocation,time-time_offset) + call = call.replace('REPLACETIME2',"'"+str(time-time_offset)+"'") + bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') + g = pt.vlsvfile.VlsvReader(fileLocation+bulkname_vdfdiff) + call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") @@ -428,6 +433,7 @@ # Many different plots print(j, runid, jrun, call,fileLocation+bulkname) f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) + try: exec(call) From 2a6c82c5b02d76b74b18958e74a68fb206f62e06 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 13:17:40 +0200 Subject: [PATCH 202/341] took out normal calls as they might not work correctly and fixed non ABC calls for vdfdiff --- testpackage/testpackage_commons.py | 3 ++- testpackage/testpackage_plot_vdfdiff.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index ad9df889..20fe3586 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -414,7 +414,8 @@ def source_file_name(filename,fileLocation,time): time_offset=10 bulkname_vdfdiff = source_file_name(filename,fileLocation,time-time_offset) call = call.replace('REPLACETIME2',"'"+str(time-time_offset)+"'") - bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') + if runs[runid]['name']=="ABC": + bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') g = pt.vlsvfile.VlsvReader(fileLocation+bulkname_vdfdiff) diff --git a/testpackage/testpackage_plot_vdfdiff.py b/testpackage/testpackage_plot_vdfdiff.py index 7e906124..5e2a9672 100644 --- a/testpackage/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_plot_vdfdiff.py @@ -61,8 +61,6 @@ "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,biglabel='E',biglabloc=3,coordre=REPLACECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,coordre=REPLACECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,cbulk=1,coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,center=[-7e5,0,0],center2=[0,0,-6e5],coordre=REPLACECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,bvector=1,center=[2e5,2e5,2e5],center2=[0,0,0],coordre=REPLACECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,wflux=1,coordre=REPLACECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xy=1,coordre=REPLACECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,xy=1,coordswap=1,coordre=REPLACECOORDRE)", From d807d3153c4d9bee9539bbf886e7e7ad8377614a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 13:51:02 +0200 Subject: [PATCH 203/341] changed tickinterval calls that took too long --- testpackage/testpackage_plot_vdfdiff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_plot_vdfdiff.py b/testpackage/testpackage_plot_vdfdiff.py index 5e2a9672..2eeb85b3 100644 --- a/testpackage/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_plot_vdfdiff.py @@ -14,8 +14,8 @@ "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,thick=2.0,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,scale=0.5,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,scale=2.,coordre=REPLACEMULTIPLECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=10,coordre=REPLACEMULTIPLECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=1,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=10,axisunit=5,coordre=REPLACEMULTIPLECOORDRE)", #tickinterval calls without axisunit takes far too long +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=5,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=0.5,axisunit=6,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,tickinterval=1,axisunit=6,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,title='msec',coordre=REPLACEMULTIPLECOORDRE)", From 059ba0574686242b3836f75b82167b75e9c65798 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 27 Nov 2025 14:31:37 +0200 Subject: [PATCH 204/341] added more vdf calls in runs --- testpackage/testpackage_commons.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 20fe3586..84601669 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -89,7 +89,7 @@ def source_file_name(filename,fileLocation,time): 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', 'fluxLocation': None, - 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], + 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface','plot_vdf','plot_vdfdiff','plot_vdf_profiles'], 'pops': ['avgs'], 'time': 1000, 'skipped_args':None, @@ -134,9 +134,9 @@ def source_file_name(filename,fileLocation,time): 'verifydir': '/BGA/', 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', 'fluxLocation': None, - 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles'], + 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles','plot_vdfdiff'], 'pops': ['proton'], - 'skipped_args':{'plot_vdf':{'normal':''}}, + 'skipped_args':None, 'time': 380, 'manualcall':False, 'singletime': True, # neighboring bulk files not available From 4c7e6bbfecf6038e533024d9afbfeea266792b04 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 1 Dec 2025 11:05:28 +0200 Subject: [PATCH 205/341] Moved the testpackage definitions to their own folder for the sake of cleanliness --- testpackage/testpackage_commons.py | 4 ++-- .../testpackage_plot_colormap.py | 0 .../testpackage_plot_colormap3dslice.py | 0 .../testpackage_plot_ionosphere.py | 0 .../testpackage_plot_isosurface.py | 0 .../{ => testpackage_definitions}/testpackage_plot_vdf.py | 0 .../testpackage_plot_vdf_profiles.py | 0 .../{ => testpackage_definitions}/testpackage_plot_vdfdiff.py | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename testpackage/{ => testpackage_definitions}/testpackage_plot_colormap.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_colormap3dslice.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_ionosphere.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_isosurface.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_vdf.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_vdf_profiles.py (100%) rename testpackage/{ => testpackage_definitions}/testpackage_plot_vdfdiff.py (100%) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 84601669..8b30f3ca 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -218,9 +218,9 @@ def source_file_name(filename,fileLocation,time): #try to import the list of calls corresponding to the function to be tested. Skip if not found try: - exec(f'import testpackage_{func}') + exec(f'import testpackage_definitions.testpackage_{func} as testpackage_{func}') except: - raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the same folder") + raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the correct folder") #Get the list of calls from the imported file, set list to empty list if list not foud in the file diff --git a/testpackage/testpackage_plot_colormap.py b/testpackage/testpackage_definitions/testpackage_plot_colormap.py similarity index 100% rename from testpackage/testpackage_plot_colormap.py rename to testpackage/testpackage_definitions/testpackage_plot_colormap.py diff --git a/testpackage/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py similarity index 100% rename from testpackage/testpackage_plot_colormap3dslice.py rename to testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py diff --git a/testpackage/testpackage_plot_ionosphere.py b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py similarity index 100% rename from testpackage/testpackage_plot_ionosphere.py rename to testpackage/testpackage_definitions/testpackage_plot_ionosphere.py diff --git a/testpackage/testpackage_plot_isosurface.py b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py similarity index 100% rename from testpackage/testpackage_plot_isosurface.py rename to testpackage/testpackage_definitions/testpackage_plot_isosurface.py diff --git a/testpackage/testpackage_plot_vdf.py b/testpackage/testpackage_definitions/testpackage_plot_vdf.py similarity index 100% rename from testpackage/testpackage_plot_vdf.py rename to testpackage/testpackage_definitions/testpackage_plot_vdf.py diff --git a/testpackage/testpackage_plot_vdf_profiles.py b/testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py similarity index 100% rename from testpackage/testpackage_plot_vdf_profiles.py rename to testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py diff --git a/testpackage/testpackage_plot_vdfdiff.py b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py similarity index 100% rename from testpackage/testpackage_plot_vdfdiff.py rename to testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py From c19b7c82c7135dc2b8d6b262e4e9bcc56876f265 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 2 Dec 2025 10:47:30 +0200 Subject: [PATCH 206/341] added cv2 image_compare implementation incase ever needed --- testpackage/testpackage_compare.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index eaf0e7ca..c627947d 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -56,6 +56,27 @@ def compare_images(a,b,output_file="NULL:"): return False + +#could be used to replace compare_images with a cv2 based implementation +def compare_images_cv2(a,b): + import cv2 + im1=cv2.imread(a).astype(np.float16) + im2=cv2.imread(b).astype(np.float16) + #originally uint8 so we might underflow with the substraction if not casted as float, 16 should be good enough + if im1.shape != im2.shape: + ''' + something should be added to handle this better, have a threshold in general or something. + the substraction yields an error, so one could pad it with + smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) + ''' + return False + diff = np.sqrt(np.mean((im1-im2)**2)) + if diff !=0: + return False + return True + + + def compare_images_in_folders(a,b,output_folder='NULL:'): cmd = f'diff -r {a} {b}' proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) From ffd29a09d1da1c66700d4d36f739b2c8c4ab2da1 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 11:19:10 +0200 Subject: [PATCH 207/341] added sourcing of CI_env in produce plots --- .github/workflows/test_compare_images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 28364491..745a9ec2 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -53,6 +53,7 @@ jobs: cat testpackage_run.txt module purge module load Python/3.10.4-GCCcore-11.3.0 + . CI_env/bin/activate python ./testpackage/testpackage_get_job_error.py testpackage_run.txt - name: Comparing plotted data From 02d76e10b2d2aa3f189b08e530ed8b4b6907ef79 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 13:55:52 +0200 Subject: [PATCH 208/341] added cluster specifier carrington to sbatch --- testpackage/run_testpackage_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index fdb468c3..bc03f297 100644 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -1,7 +1,7 @@ #!/bin/bash -l #SBATCH -t 00:30:00 #SBATCH -J analysator_testpackage -#SBATCH -p short +#SBATCH -M carrington #SBATCH -n 1 #SBATCH --array=1-4 #SBATCH --no-requeue From 2c2d113699c01a30f4b4cbd12ce879e5bf239192 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:12:19 +0200 Subject: [PATCH 209/341] changed get_diff dictionary to be broader and made it run all tests if 6 or more fies have changed --- testpackage/testpackage_get_diff.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 30ef6975..b8aee6d9 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -22,13 +22,14 @@ "colormaps.py":None, "calculations":None, "vlsv":None, -"testpackage_commons.py":None, +"testpackage_":None, "MayaVi":None, -"compare_images.yml":None +"compare_images.yml":None, +"miscellaneous":None, } #Override if there are many changes as run all tests -if len(git_diff)>30: +if len(git_diff)>10: quit() output=[] From 6f255adcdb0ca91f8108724b21ce24b2a2fc3dbe Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:43:41 +0200 Subject: [PATCH 210/341] changed the get_diff to actually now trigger all if 6 or more --- testpackage/testpackage_get_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index b8aee6d9..090cb31a 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -29,7 +29,7 @@ } #Override if there are many changes as run all tests -if len(git_diff)>10: +if len(git_diff)>6: quit() output=[] From 8b676feba0be5d60905780d9086c51505cdde88d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:44:18 +0200 Subject: [PATCH 211/341] added a way to skip certain parameter from all calls in a run --- testpackage/testpackage_commons.py | 5 +++-- testpackage/testpackage_template_maker.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 8b30f3ca..49a3cdd0 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -77,7 +77,7 @@ def source_file_name(filename,fileLocation,time): 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], 'pops': ['avgs'], 'time': 1000, - 'skipped_args':{'plot_ionosphere':{"var":["ig_z","ig_p","ig_source","ig_residual"]}}, #ig_zz and ig_pp is also skipped on purpose + 'skipped_args':{'plot_ionosphere':{"var":["ig_z","ig_p","ig_source","ig_residual"]},'ALL':{'expression':''}}, #ig_zz and ig_pp is also skipped on purpose 'singletime': False, 'filename': None, #restart file 'manualcall':False, @@ -436,7 +436,8 @@ def source_file_name(filename,fileLocation,time): f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - exec(call) + #exec(call) + print(call) except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 5c6de078..4b828f89 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -61,10 +61,15 @@ def call_replace(call,func,skipped_args,required_args=required_args): #skip args if there are skipped args and append if called arg in function_pars for arg in args: if arg: - if skipped_args and func in skipped_args.keys(): - skipped_args_dict=skipped_args[func] + if skipped_args: + if func in skipped_args.keys(): + skipped_args_dict=skipped_args[func] + elif 'ALL' in skipped_args.keys(): + skipped_args_dict=skipped_args['ALL'] + else: + skipped_args_dict=False call_args=arg.split("=") - if call_args[0] in skipped_args_dict.keys(): + if skipped_args_dict and call_args[0] in skipped_args_dict.keys(): if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: continue elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} From 334ae1b614d62bfe76f83e99cc1aa785ece1ef0a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:44:55 +0200 Subject: [PATCH 212/341] fixed the sbatch parameters so things should now use carrington or ukko for the workflow --- testpackage/run_testpackage_workflow.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index bc03f297..51108051 100644 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -1,7 +1,8 @@ #!/bin/bash -l #SBATCH -t 00:30:00 #SBATCH -J analysator_testpackage -#SBATCH -M carrington +#SBATCH --constraint="carrington|ukko" +#SBATCH -p short #SBATCH -n 1 #SBATCH --array=1-4 #SBATCH --no-requeue From d33516e02d7ca249f43adfd37fbfbea1ea6460e1 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:47:31 +0200 Subject: [PATCH 213/341] accidentally left in a debug line --- testpackage/testpackage_commons.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 49a3cdd0..38ca563a 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -436,8 +436,7 @@ def source_file_name(filename,fileLocation,time): f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - #exec(call) - print(call) + exec(call) except Exception as e: print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) From 5f42e417a97a1bf115ec65e4b5eabb60973c7795 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 14:56:31 +0200 Subject: [PATCH 214/341] fixed the python not found error by loading python earlier --- .github/workflows/test_compare_images.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 745a9ec2..03dc5357 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -45,14 +45,15 @@ jobs: id: run_cl run: | export TMPDIR=$RUNNER_TEMP + module purge + module load Python/3.10.4-GCCcore-11.3.0 + export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT cat testpackage_run.txt - module purge - module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate python ./testpackage/testpackage_get_job_error.py testpackage_run.txt From eacb76d5fecb9733d1bba8b983c9acb1dd06da19 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:08:13 +0200 Subject: [PATCH 215/341] changed fetch-depth of checkout so the git diff should work --- .github/workflows/test_compare_images.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 03dc5357..bbda474a 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -30,6 +30,8 @@ jobs: extras: ["all"] steps: - uses: actions/checkout@v4 + with: + fetch-depth: 100 - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies From 05dc5d1c96eda54688d62284a1ab9812ca2684bb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:10:52 +0200 Subject: [PATCH 216/341] still failed, set the fetch-depth to 0, dunno if it slows down too much --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index bbda474a..64cc7456 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -31,7 +31,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 100 + fetch-depth: 0 - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies From 516def8aa0ef3d81bdb2a9dd468faba6e42ca948 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:36:57 +0200 Subject: [PATCH 217/341] added full test for master and dev pushes and removed push event from the selective one --- .github/workflows/test_compare_images.yml | 2 +- .../workflows/test_compare_images_full.yml | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test_compare_images_full.yml diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 64cc7456..e5dad4ab 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -5,7 +5,7 @@ name: Turso compare colourmap images on: push: - branches: [ master, dev, image_compare] + branches: [image_compare] pull_request: branches: [ master, dev, image_compare] schedule: diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml new file mode 100644 index 00000000..4d682b9c --- /dev/null +++ b/.github/workflows/test_compare_images_full.yml @@ -0,0 +1,69 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Turso compare colourmap images + +on: + push: + branches: [ master, dev, image_compare] + schedule: + - cron: '0 8 * * MON' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + + +jobs: + + turso_system: + if: github.repository_owner == 'fmihpc' + runs-on: carrington + timeout-minutes: 60 + strategy: + fail-fast: false + max-parallel: 2 + matrix: + extras: ["all"] + steps: + - uses: actions/checkout@v4 + with: + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install dependencies + run: | + export TMPDIR=$RUNNER_TEMP + export UV_LINK_MODE=copy + module purge + module load Python/3.10.4-GCCcore-11.3.0 + uv venv CI_env + . CI_env/bin/activate + uv pip install --editable ../analysator[${{ matrix.extras }}] + - name: Produce plots + id: run_cl + run: | + export TMPDIR=$RUNNER_TEMP + module purge + module load Python/3.10.4-GCCcore-11.3.0 + + sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh + + cat testpackage_run.txt + . CI_env/bin/activate + python ./testpackage/testpackage_get_job_error.py testpackage_run.txt + + - name: Comparing plotted data + run: | + export TMPDIR=$RUNNER_TEMP + module load Python/3.10.4-GCCcore-11.3.0 + module load ImageMagick/7.1.0-37-GCCcore-11.3.0 + . CI_env/bin/activate + ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + + - name: scancel dangling job upon cancellation + if: cancelled() + run: | + scancel ${{ steps.run_cl.outputs.SLURM_JOB_ID }} + + From fe26b8d31d7a60b34cff94c4ac2156b940456fb0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:39:17 +0200 Subject: [PATCH 218/341] added echo for the diffresult in workflow --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index e5dad4ab..0310767c 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -52,7 +52,7 @@ jobs: export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT - + echo "$DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT cat testpackage_run.txt From 19ec6c9e54cf628d8a1c84792552e1e5fabda27d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:52:06 +0200 Subject: [PATCH 219/341] fixed folder structure in run_compare --- testpackage/run_compare.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index ba5cfe7f..de7e849c 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -16,7 +16,7 @@ do echo "Comparing for $i" #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/$i/" - folder_2="${PWD}/produced_plots/testpackage_run/$i/" + folder_2="${PWD}/produced_plots/$i/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" done @@ -24,6 +24,6 @@ if $check; then echo "Comparing all" folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/" - folder_2="${PWD}/produced_plots/testpackage_run/" + folder_2="${PWD}/produced_plots/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" fi From 249159e423a2fdf874f01ba9fb19b247f35d97b0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 3 Dec 2025 15:56:19 +0200 Subject: [PATCH 220/341] fixed folder structure(again) in compare.sh --- testpackage/run_compare.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index de7e849c..25fda560 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -15,7 +15,7 @@ do check=false echo "Comparing for $i" #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/$i/" + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" folder_2="${PWD}/produced_plots/$i/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" done @@ -23,7 +23,7 @@ done if $check; then echo "Comparing all" - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/testpackage_run/" + folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/" folder_2="${PWD}/produced_plots/" python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" fi From cc84f242aaf01f664bddedf6d7a8019179e29cb2 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 10:41:50 +0200 Subject: [PATCH 221/341] gave the work flow more memory since it seemed to run out on full run --- testpackage/run_testpackage_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 51108051..91d73e23 100644 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -6,7 +6,7 @@ #SBATCH -n 1 #SBATCH --array=1-4 #SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 +#SBATCH --mem-per-cpu=32000 #THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS From 559b8f8875a2dbb2adc6fbdb3aab2bf932864776 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 11:26:40 +0200 Subject: [PATCH 222/341] changed the time limit to 45 min and gave more array jobs --- testpackage/run_testpackage_workflow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 91d73e23..01433f50 100644 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -1,10 +1,10 @@ #!/bin/bash -l -#SBATCH -t 00:30:00 +#SBATCH -t 00:45:00 #SBATCH -J analysator_testpackage #SBATCH --constraint="carrington|ukko" #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=1-4 +#SBATCH --array=1-10 #SBATCH --no-requeue #SBATCH --mem-per-cpu=32000 From 974da4cac18e63c7c3443e60623a960576fc71d7 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 14:06:42 +0200 Subject: [PATCH 223/341] moved to using cv2 instead of image magick and added opencv-python into all in pyproject.toml --- pyproject.toml | 1 + testpackage/testpackage_compare.py | 90 ++++++++++-------------------- 2 files changed, 32 insertions(+), 59 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ceeb7f0d..df141a15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ vtk = [ ] all = [ "analysator[vtk]", + "opencv-python" ] bvtk = [ "vtk==9.2.6", diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index c627947d..1a3d335b 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -3,63 +3,12 @@ import os import sys from argparse import ArgumentParser - - - - - -#Parse arguments -parser = ArgumentParser(prog="Image compare" - ,description="Compares images in two folders/images, and outputs the different ones to a specified output folder. Note that folders must have the same structure and filenames, otherwise these files are treated as unique." - ) - -parser.add_argument("folder_a",help="First folder/image to compare") -parser.add_argument("folder_b",help="Second folder/image to compare") -parser.add_argument("output_folder",help="Output folder for different images, if not specified, no output is saved",default="NULL:",nargs='?') - -args= parser.parse_args() -a,b,output_folder = args.folder_a,args.folder_b,args.output_folder - -#Create output folder if it doesn't exist -if not os.path.exists(output_folder) and output_folder!='NULL:': - proc = subprocess.Popen(f'mkdir {output_folder}'.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) - out,err = proc.communicate() - - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) - - -def compare_images(a,b,output_file="NULL:"): - - cmd = f"magick compare -metric RMSE {a} {b} {output_file}" - proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - - out,err = proc.communicate() - - exitcode=proc.returncode - - #If errors, raise an exception (This has to be odne like this as compare sends output to stderr) - if exitcode!=0 and exitcode != 1: - out = str(out,'utf-8') - raise RuntimeError(out) - - out = str(out,'utf-8') - out=out.strip('\n') - out = out.split(" ") - - #Returns true if images' RMSE = 0, i.e are identical - if out[0]=='0': - return True - - return False - +import cv2 #could be used to replace compare_images with a cv2 based implementation -def compare_images_cv2(a,b): - import cv2 +def compare_images(a,b): + im1=cv2.imread(a).astype(np.float16) im2=cv2.imread(b).astype(np.float16) #originally uint8 so we might underflow with the substraction if not casted as float, 16 should be good enough @@ -108,11 +57,11 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): #Feed the different files to compare_images for file in different_files: - if output_folder!= "NULL:": - filename = file.split("/")[-1].rstrip(".png") #is it always png? - output_folder=output_folder+f"/difference_output_{filename}.png" + #if output_folder!= "NULL:": + # filename = file.split("/")[-1].rstrip(".png") #is it always png? + # output_folder=output_folder+f"/difference_output_{filename}.png" - if(not compare_images(file,file.replace(a,b),output_folder)): + if(not compare_images(file,file.replace(a,b))): different=True print("Images differ:",file,file.replace(a,b)) @@ -136,5 +85,28 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") raise SystemError("Images Differ") +if __name__=='__main__': + + #Parse arguments + parser = ArgumentParser(prog="Image compare" + ,description="Compares images in two folders/images, and outputs the different ones to a specified output folder. Note that folders must have the same structure and filenames, otherwise these files are treated as unique." + ) + + parser.add_argument("folder_a",help="First folder/image to compare") + parser.add_argument("folder_b",help="Second folder/image to compare") + parser.add_argument("output_folder",help="Output folder for different images, if not specified, no output is saved",default="NULL:",nargs='?') + + args= parser.parse_args() + a,b,output_folder = args.folder_a,args.folder_b,args.output_folder + + #Create output folder if it doesn't exist + if not os.path.exists(output_folder) and output_folder!='NULL:': + proc = subprocess.Popen(f'mkdir {output_folder}'.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) + out,err = proc.communicate() + + #If errors, raise an exception + if err: + err = str(err,'utf-8') + raise RuntimeError(err) -compare_images_in_folders(a,b,output_folder) + compare_images_in_folders(a,b,output_folder) From 40138cbf36da49fcb360dcecd541ad6318da0719 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 14:47:03 +0200 Subject: [PATCH 224/341] added numpy import to testpackage_compare.py --- testpackage/testpackage_compare.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 1a3d335b..da9ed045 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -4,6 +4,7 @@ import sys from argparse import ArgumentParser import cv2 +import numpy as np #could be used to replace compare_images with a cv2 based implementation From f1dfb92d9777d9b4a4294f3fefc399e7866924ef Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 16:22:59 +0200 Subject: [PATCH 225/341] gave workflows 120 minutes to complete as 60 is not enough for full compare --- .github/workflows/test_compare_images.yml | 2 +- .github/workflows/test_compare_images_full.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 0310767c..89cae8a3 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -22,7 +22,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: carrington - timeout-minutes: 60 + timeout-minutes: 120 strategy: fail-fast: false max-parallel: 2 diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 4d682b9c..44bf9adf 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -20,7 +20,7 @@ jobs: turso_system: if: github.repository_owner == 'fmihpc' runs-on: carrington - timeout-minutes: 60 + timeout-minutes: 120 strategy: fail-fast: false max-parallel: 2 From 48cc33f9427034144d2b701ba600b5924773f506 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 4 Dec 2025 16:38:08 +0200 Subject: [PATCH 226/341] added warning for new files produced --- testpackage/testpackage_compare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index da9ed045..539690a6 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -5,7 +5,7 @@ from argparse import ArgumentParser import cv2 import numpy as np - +import logging #could be used to replace compare_images with a cv2 based implementation def compare_images(a,b): @@ -76,7 +76,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if len(unique_files)!=0: - raise SystemError("Found new file(s) produced by the code!") + print("::warning Found new file(s) produced by the code!") if len(missing_files)!=0: raise SystemError("Found file(s) **not** produced by the code!") From de9881a57c4dc63c7fe932e4f5c5a1096dda54d8 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 5 Dec 2025 19:40:08 +0200 Subject: [PATCH 227/341] made editable default in create_env and made it use [all] since testpackage kind of needs that now --- testpackage/create_env.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 5c2c5b07..8e13a5c4 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -39,7 +39,7 @@ def create_venv(path,install_analysator=True,editable=False): virt_env.post_setup(context) if install_analysator: editable='--editable' if editable else None - system_call(f'{path}/bin/pip install {editable} ../',live_output=True) + system_call(f'{path}/bin/pip install {editable} ../[all]',live_output=True) print(f'Virtual environment created at {path}') return None @@ -89,7 +89,7 @@ def create_venv_script(path,venv_path): parser=argparse.ArgumentParser(description='Create virtual environment for testpackage.') parser.add_argument('--no-analysator',action='store_true',help='Do not install analysator.',default=False) - parser.add_argument('--editable','-e',action='store_true',help='Install analysator as editable',default=False) + parser.add_argument('--editable','-e',action='store_true',help='Install analysator as editable',default=True) args=parser.parse_args() venv_name= 'venv_testpackage' From ce6adfef45803140cff247e4a85578d6cde88e26 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 11:01:43 +0200 Subject: [PATCH 228/341] changed how outputdir calls are made since how it works has changed --- .../testpackage_definitions/testpackage_plot_colormap.py | 4 ++-- .../testpackage_plot_colormap3dslice.py | 2 +- .../testpackage_definitions/testpackage_plot_ionosphere.py | 2 +- .../testpackage_definitions/testpackage_plot_isosurface.py | 2 +- testpackage/testpackage_definitions/testpackage_plot_vdf.py | 4 ++-- .../testpackage_definitions/testpackage_plot_vdf_profiles.py | 2 +- .../testpackage_definitions/testpackage_plot_vdfdiff.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap.py b/testpackage/testpackage_definitions/testpackage_plot_colormap.py index 73d52cdb..afd58c1c 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap.py @@ -10,7 +10,7 @@ nonrestartcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation,run=REPLACEINDEX)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", "pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", @@ -269,7 +269,7 @@ v5nonrestartcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation,run=REPLACEINDEX)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index 406c2850..60c9af13 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -3,7 +3,7 @@ -nonrestartcalls=["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +nonrestartcalls=["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, outputdir=outputLocation,run=REPLACEINDEX)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX)", "pt.plot.plot_colormap3dslice(vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py index 78be4eb7..424e1ad7 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py +++ b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py @@ -3,7 +3,7 @@ v5nonrestartcalls=[ #outputs, nooverwrite -"pt.plot.plot_ionosphere(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +"pt.plot.plot_ionosphere(filename=fileLocation+bulkname, outputdir=outputLocation,run=REPLACEINDEX)", "pt.plot.plot_ionosphere(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", "pt.plot.plot_ionosphere(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", "pt.plot.plot_ionosphere(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py index 90717b9c..2d9e9197 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py +++ b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py @@ -1,4 +1,4 @@ -nonrestartcalls=["pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +nonrestartcalls=["pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,outputdir=outputLocation , run=REPLACEINDEX)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,nooverwrite=1)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filedir=fileLocation,step=REPLACETIME,run=verifydir+REPLACEINDEX)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdf.py b/testpackage/testpackage_definitions/testpackage_plot_vdf.py index 3aed616a..2d9aa5b4 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdf.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdf.py @@ -1,7 +1,7 @@ restartcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation , run=REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", @@ -125,7 +125,7 @@ ] nonrestartcalls = [ # Input and output methods, nooverwrite -"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation , run=REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py b/testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py index ee0acc58..32d1218a 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdf_profiles.py @@ -1,4 +1,4 @@ -nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,outputdir=outputLocation+'/'+REPLACEINDEX+'_')", +nonrestartcalls=["pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,filename=fileLocation+bulkname,outputdir=outputLocation , run=REPLACEINDEX)", "pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,run=verifydir+REPLACEINDEX)", "pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1)", "pt.plot.plot_vdf_profiles(coordre=REPLACECOORDRE,vlsvobj=f,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py index 2eeb85b3..82d8b002 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py @@ -1,4 +1,4 @@ -nonrestartcalls=["pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputdir=outputLocation+'/'+REPLACEINDEX+'_',coordre=REPLACEMULTIPLECOORDRE)", +nonrestartcalls=["pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputdir=outputLocation , run=REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png',nooverwrite=1,coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png',nooverwrite=1,coordre=REPLACEMULTIPLECOORDRE)", From 5e5cce8b3851427fa68d55ab6178495d6c4e0384 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 11:01:58 +0200 Subject: [PATCH 229/341] skipped args to FHA runs for expressions --- testpackage/testpackage_commons.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 38ca563a..2b18a34d 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -92,7 +92,7 @@ def source_file_name(filename,fileLocation,time): 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface','plot_vdf','plot_vdfdiff','plot_vdf_profiles'], 'pops': ['avgs'], 'time': 1000, - 'skipped_args':None, + 'skipped_args':{'ALL':{'expression':''}}, 'singletime': False, 'filename': None, #restart file 'manualcall':False, @@ -242,7 +242,7 @@ def source_file_name(filename,fileLocation,time): call = call.replace("var='V'","var='restart_V'") if skipped_args and not legacy_mode: call=call_replace(call,func,skipped_args,required_args) - if call is not None: + if call is not None: callrunids.append(i) calls.append(call) callrunindex.append(callindex) From 992a16185d91964621ce35774a106463c18e4e3b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 11:08:28 +0200 Subject: [PATCH 230/341] parallelizing compare --- testpackage/run_compare.sh | 20 ++++++- testpackage/testpackage_compare.py | 89 +++++++++++++++++++++++------- 2 files changed, 86 insertions(+), 23 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 25fda560..c623cad5 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -1,4 +1,18 @@ #!/bin/bash -l +#SBATCH -t 00:30:00 +#SBATCH -J analysator_testpackage_compare +#SBATCH --constraint="ukko|carrington" +#SBATCH -p short +#SBATCH -n 1 +#SBATCH --array=1-10 +#SBATCH --no-requeue +#SBATCH --mem-per-cpu=16000 + + +#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS +jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) +index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) + verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" @@ -9,7 +23,7 @@ fi check=true -#Note that this is skipped if on arguments are passed +#Note that this is skipped if no arguments are passed for i in $@ do check=false @@ -17,7 +31,7 @@ do #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" folder_2="${PWD}/produced_plots/$i/" - python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" + python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" done if $check; @@ -25,5 +39,5 @@ then echo "Comparing all" folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/" folder_2="${PWD}/produced_plots/" - python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} && echo "No differences found in produced images" + python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" fi diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 539690a6..9e3fc085 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -6,6 +6,7 @@ import cv2 import numpy as np import logging +import os.path #could be used to replace compare_images with a cv2 based implementation def compare_images(a,b): @@ -27,7 +28,17 @@ def compare_images(a,b): -def compare_images_in_folders(a,b,output_folder='NULL:'): +def compare_images_in_folders(a,b,jobcount,jobcurr): + + + #folders=get_directories(a,depth=2) + #folders2=get_directories(b,depth=2) + +# if len(folders)!=len(folders2): +# raise SystemError("Folders do not have the same structure!") + + #do the comparisons + cmd = f'diff -r {a} {b}' proc = subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) out,err = proc.communicate() @@ -56,12 +67,23 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): missing_files.append(line[2].rstrip(":")+'/'+line[3]) - #Feed the different files to compare_images - for file in different_files: - #if output_folder!= "NULL:": - # filename = file.split("/")[-1].rstrip(".png") #is it always png? - # output_folder=output_folder+f"/difference_output_{filename}.png" + nteststot = len(different_files) + increment = int(nteststot/jobcount) + remainder = nteststot - jobcount * increment + start=jobcurr * increment + end=start + increment + # Remainder frames are divvied out evenly among tasks + if jobcurr < remainder: + start = start + jobcurr + end = end + jobcurr + 1 + else: + start = start + remainder + end = end + remainder + + + #Feed the different files to compare_images + for file in different_files[start:end]: if(not compare_images(file,file.replace(a,b))): different=True print("Images differ:",file,file.replace(a,b)) @@ -76,7 +98,7 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): if len(unique_files)!=0: - print("::warning Found new file(s) produced by the code!") + print("::warning::Found new file(s) produced by the code!") if len(missing_files)!=0: raise SystemError("Found file(s) **not** produced by the code!") @@ -86,6 +108,37 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): print(f"::error title=Plot(s) differ::Produced plots not in agreement with the verfication set {a}") raise SystemError("Images Differ") + +#only prints what is at the target depth (might be clunky as i was tired when writing it) +def get_directories(directory,depth): + out_dirs=[] + dirs=[] + if depth==0: + return [directory] + for i in range(depth): + + if i==0: + directory= [directory] + subdirs_current_depth=os.listdir(directory[0]) + for subdir in subdirs_current_depth: + dirs.append(os.path.join(directory[0],subdir)) + directory=dirs + else: + directory=[] + + for dircs in dirs: + subdirs_current_depth=os.listdir(dircs) + for subdir in subdirs_current_depth: + directory.append(os.path.join(dircs,subdir)) + length_current_depth=len(directory) + dirs=directory + + if i==depth-1: + out_dirs=directory + + return out_dirs + + if __name__=='__main__': #Parse arguments @@ -95,19 +148,15 @@ def compare_images_in_folders(a,b,output_folder='NULL:'): parser.add_argument("folder_a",help="First folder/image to compare") parser.add_argument("folder_b",help="Second folder/image to compare") - parser.add_argument("output_folder",help="Output folder for different images, if not specified, no output is saved",default="NULL:",nargs='?') - + + parser.add_argument("jobcount",help="Number of parallel jobs to use",default=1,nargs='?',type=int) + parser.add_argument("jobindex",help="Index of the job to run",default=0,nargs='?',type=int) + + args= parser.parse_args() - a,b,output_folder = args.folder_a,args.folder_b,args.output_folder - - #Create output folder if it doesn't exist - if not os.path.exists(output_folder) and output_folder!='NULL:': - proc = subprocess.Popen(f'mkdir {output_folder}'.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) - out,err = proc.communicate() + a,b = args.folder_a,args.folder_b - #If errors, raise an exception - if err: - err = str(err,'utf-8') - raise RuntimeError(err) + jobcount=args.jobcount + jobindex=args.jobindex - compare_images_in_folders(a,b,output_folder) + compare_images_in_folders(a,b,jobcount,jobindex) \ No newline at end of file From 1270b8baa0a82b1de977fd50b24ddeddc377dcad Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 14:55:07 +0200 Subject: [PATCH 231/341] removed the legacy mode as too many things have changed to make it worth getting to work --- testpackage/testpackage_commons.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 38ca563a..b713d6d6 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -38,7 +38,6 @@ def source_file_name(filename,fileLocation,time): runs = [] #Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do -legacy_mode=False runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', @@ -240,7 +239,7 @@ def source_file_name(filename,fileLocation,time): call = call.replace("var='vg_v'","var='vg_restart_v'") else: call = call.replace("var='V'","var='restart_V'") - if skipped_args and not legacy_mode: + if skipped_args: call=call_replace(call,func,skipped_args,required_args) if call is not None: callrunids.append(i) @@ -274,7 +273,7 @@ def source_file_name(filename,fileLocation,time): continue elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue - if skipped_args and not legacy_mode: + if skipped_args: call=call_replace(call,func,skipped_args,required_args) if call is not None: callrunids.append(i) @@ -302,7 +301,7 @@ def source_file_name(filename,fileLocation,time): elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: continue call = call.replace('REPLACEPOP',pop) - if skipped_args and not legacy_mode: + if skipped_args: call=call_replace(call,func,skipped_args,required_args) if call is not None: callrunids.append(i) @@ -380,21 +379,6 @@ def source_file_name(filename,fileLocation,time): outputLocation=os.path.join(pt.plot.defaultoutputdir,verifydir) - #Annoyances due to previous testpackages having different times used for plot_vdf and plot_colormap - if legacy_mode: - if func=='plot_vdf': - if runs[runid]['name']=='ABC': - time=100 - elif runs[runid]['name']=="BCQ": - time=1600 - elif runs[runid]['name']=="BFD": - time=1000 - elif runs[runid]['name']=="BFDr": - time=0 - if not filename is None and "step=" in call: - continue - - # Source data files bulkname = source_file_name(filename,fileLocation,time) @@ -407,8 +391,6 @@ def source_file_name(filename,fileLocation,time): fileLocation=fileLocation.replace('bulk','distributions') bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" time=100 - if "step=" in call and legacy_mode: - continue if func == 'plot_vdfdiff': time_offset=10 From 7468db9c8204f733c7c81e53eca7314be70e77b5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 15:03:38 +0200 Subject: [PATCH 232/341] removed vdf_profiles from FHA --- testpackage/testpackage_commons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index f15d840d..282d54e7 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -88,7 +88,7 @@ def source_file_name(filename,fileLocation,time): 'verifydir': '/FHA/', 'fileLocation': datalocation+'/3D/FHA/bulk1/', 'fluxLocation': None, - 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface','plot_vdf','plot_vdfdiff','plot_vdf_profiles'], + 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface','plot_vdf','plot_vdfdiff'], 'pops': ['avgs'], 'time': 1000, 'skipped_args':{'ALL':{'expression':''}}, From 6dd91047532b746e8380c30605cb5a6f5fa84f4e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 16:08:08 +0200 Subject: [PATCH 233/341] more arrays to the testpackage --- testpackage/run_testpackage_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 testpackage/run_testpackage_workflow.sh diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh old mode 100644 new mode 100755 index 01433f50..971c6c63 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -4,7 +4,7 @@ #SBATCH --constraint="carrington|ukko" #SBATCH -p short #SBATCH -n 1 -#SBATCH --array=1-10 +#SBATCH --array=1-20 #SBATCH --no-requeue #SBATCH --mem-per-cpu=32000 From 1cb36937249dc9830fc9c3e061d9b627a57fc139 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 16:08:24 +0200 Subject: [PATCH 234/341] fixed compare not using sbatch --- .github/workflows/test_compare_images.yml | 4 ++-- .github/workflows/test_compare_images_full.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 89cae8a3..e0dea990 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -65,8 +65,8 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} - + sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + cat testpackage_compare.txt - name: scancel dangling job upon cancellation if: cancelled() run: | diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 44bf9adf..428803ad 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -59,7 +59,8 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate - ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + cat testpackage_compare.txt - name: scancel dangling job upon cancellation if: cancelled() From b18d7a0b26f1cc23ff920d5c7f1a307b45017f2b Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 16:15:42 +0200 Subject: [PATCH 235/341] removed unused imagemagick module --- .github/workflows/test_compare_images.yml | 1 - .github/workflows/test_compare_images_full.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index e0dea990..4ffc40d6 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -63,7 +63,6 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 - module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 428803ad..f82d826b 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -57,7 +57,6 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 - module load ImageMagick/7.1.0-37-GCCcore-11.3.0 . CI_env/bin/activate sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt From a4626b85b5a12bd133661ef6429e73468106bd51 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 8 Dec 2025 16:23:38 +0200 Subject: [PATCH 236/341] added ci_env source, module load for libgl which is dependancy for cv2 and module purge --- testpackage/run_compare.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index c623cad5..a19608dd 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -13,6 +13,10 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) +source CI_env/bin/activate +module purge +module load libglvnd/1.7.0-GCCcore-13.3.0 +module list verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" From 8507ffb998d54eb927f82c96c947b5334ec79751 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 10:43:17 +0200 Subject: [PATCH 237/341] added wait for the sbatch, otherwise things don't work --- .github/workflows/test_compare_images.yml | 2 +- .github/workflows/test_compare_images_full.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 4ffc40d6..1b8e6c69 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -64,7 +64,7 @@ jobs: export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate - sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt - name: scancel dangling job upon cancellation if: cancelled() diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index f82d826b..dc699b38 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -58,7 +58,7 @@ jobs: export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate - sbatch -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt - name: scancel dangling job upon cancellation From 103103831795ed48ab15cb5a5cbcb76b9e9b94bc Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 11:17:19 +0200 Subject: [PATCH 238/341] cleaned up the modules in the sbatch scripts --- testpackage/run_compare.sh | 3 ++- testpackage/run_testpackage_workflow.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index a19608dd..870a4686 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -13,8 +13,9 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) -source CI_env/bin/activate + module purge +source CI_env/bin/activate module load libglvnd/1.7.0-GCCcore-13.3.0 module list diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 971c6c63..8768762b 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -19,8 +19,8 @@ hostname module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -module load Python/3.10.4-GCCcore-11.3.0 -module load ImageMagick/7.1.0-37-GCCcore-11.3.0 +#module load Python/3.10.4-GCCcore-11.3.0 +#module load ImageMagick/7.1.0-37-GCCcore-11.3.0 echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT From 0f5fac145a674f8245ca511befab149c68b01f19 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 11:21:47 +0200 Subject: [PATCH 239/341] nevermind previous commit borke it :-D added module load python and source because that seems to be required and i forgor --- testpackage/run_compare.sh | 1 + testpackage/run_testpackage_workflow.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 870a4686..98eb1d57 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -15,6 +15,7 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) module purge +module load Python/3.10.4-GCCcore-11.3.0 source CI_env/bin/activate module load libglvnd/1.7.0-GCCcore-13.3.0 module list diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 8768762b..ff2495d1 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -19,7 +19,7 @@ hostname module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -#module load Python/3.10.4-GCCcore-11.3.0 +module load Python/3.10.4-GCCcore-11.3.0 #module load ImageMagick/7.1.0-37-GCCcore-11.3.0 echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT From ee7abf761efb1960e25b286f760784396c01bc2e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 13:08:18 +0200 Subject: [PATCH 240/341] cleaned up compare batch script and added the get_job_error to compare since the compare step is no parallelized with slurm arrays, additionally added EXIT_CODE_FROM_JOB 1 to testpackage_commons so the call errors get raised as errors properly in the github workflow. --- .github/workflows/test_compare_images.yml | 1 + .github/workflows/test_compare_images_full.yml | 2 +- testpackage/run_compare.sh | 6 ++++-- testpackage/testpackage_commons.py | 5 +++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 1b8e6c69..5e04dd98 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -66,6 +66,7 @@ jobs: . CI_env/bin/activate sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt + python ./testpackage/testpackage_get_job_error.py testpackage_compare.txt - name: scancel dangling job upon cancellation if: cancelled() run: | diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index dc699b38..9ef765ff 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -60,7 +60,7 @@ jobs: . CI_env/bin/activate sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} cat testpackage_compare.txt - + python ./testpackage/testpackage_get_job_error.py testpackage_compare.txt - name: scancel dangling job upon cancellation if: cancelled() run: | diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 98eb1d57..84ea3feb 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -37,7 +37,8 @@ do #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" folder_2="${PWD}/produced_plots/$i/" - python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" + python3 ./testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" + echo "EXIT_CODE_FROM_JOB $?" done if $check; @@ -45,5 +46,6 @@ then echo "Comparing all" folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/" folder_2="${PWD}/produced_plots/" - python3 ../analysator/testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" + python3 ./testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" + echo "EXIT_CODE_FROM_JOB $?" fi diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 282d54e7..e2cdbe3e 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -425,4 +425,9 @@ def source_file_name(filename,fileLocation,time): traceback.print_exc() print("END TRACE for call",j,"\n----------------------------") + #This is here so get_job_error can get the error from the call. + # note that we could also raise the error but then execution of subsequent calls would stop + print("EXIT_CODE_FROM_JOB 1") + + From 59fa03eef57bcdf0b5aae5bfd0d7af041f5c61e8 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 13:47:26 +0200 Subject: [PATCH 241/341] added skip for nooverwrite since that will always produce error since it is intented (maybe a bad fix in the long run? How do we concile with tests that are meant to fail?) --- testpackage/testpackage_commons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index e2cdbe3e..ad9b4186 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -427,7 +427,8 @@ def source_file_name(filename,fileLocation,time): print("END TRACE for call",j,"\n----------------------------") #This is here so get_job_error can get the error from the call. # note that we could also raise the error but then execution of subsequent calls would stop - print("EXIT_CODE_FROM_JOB 1") + if not "nooverwrite" in call: + print("EXIT_CODE_FROM_JOB 1") From 187a28e9e249c2a27ad9f3e2e9688840a4bb74a0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 9 Dec 2025 16:17:48 +0200 Subject: [PATCH 242/341] fixed full workflow "with:" --- .github/workflows/test_compare_images_full.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 9ef765ff..3aa6e9f7 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -28,7 +28,6 @@ jobs: extras: ["all"] steps: - uses: actions/checkout@v4 - with: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies @@ -58,7 +57,7 @@ jobs: export TMPDIR=$RUNNER_TEMP module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate - sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh ${{ steps.run_cl.outputs.DIFFRESULT }} + sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh cat testpackage_compare.txt python ./testpackage/testpackage_get_job_error.py testpackage_compare.txt - name: scancel dangling job upon cancellation From e89d8738870c5777d0de86ea2a01f3b7e54b9f30 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 12:10:31 +0200 Subject: [PATCH 243/341] changed to kappa for verf_set location --- testpackage/run_compare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 84ea3feb..c2fd1551 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -20,7 +20,8 @@ source CI_env/bin/activate module load libglvnd/1.7.0-GCCcore-13.3.0 module list -verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" +#verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" +verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" #if pass we do not check for anything if echo $@ | grep -q -P "\spass$|\spass\s"; then From 1af6e777e8a12ac938610d6e982fb84614951a7e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 12:11:05 +0200 Subject: [PATCH 244/341] found a faster way to compare the images, though no RMSE, this should produce same results as before. Left the old variant as comment incase it does not. --- testpackage/testpackage_compare.py | 64 ++++++++---------------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 9e3fc085..fa67c36c 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -9,34 +9,32 @@ import os.path #could be used to replace compare_images with a cv2 based implementation + def compare_images(a,b): - im1=cv2.imread(a).astype(np.float16) - im2=cv2.imread(b).astype(np.float16) - #originally uint8 so we might underflow with the substraction if not casted as float, 16 should be good enough + im1=cv2.imread(a) + im2=cv2.imread(b) + return im1.shape == im2.shape and not(np.bitwise_xor(im1,im2).any()) + + + #below can be used to get the RMSE, which is about 2-3x as slow the images must be read astype(np.float16) first for accurate RMSE + ''' + #originally uint8 so we might underflow with the substraction if not casted as float, float16 should be good enough if im1.shape != im2.shape: - ''' - something should be added to handle this better, have a threshold in general or something. - the substraction yields an error, so one could pad it with - smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) - ''' + + #something should be added to handle this better, have a threshold in general or something. + #the substraction yields an error, so one could pad it with + #smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) + return False diff = np.sqrt(np.mean((im1-im2)**2)) if diff !=0: return False return True - - + ''' def compare_images_in_folders(a,b,jobcount,jobcurr): - - #folders=get_directories(a,depth=2) - #folders2=get_directories(b,depth=2) - -# if len(folders)!=len(folders2): -# raise SystemError("Folders do not have the same structure!") - #do the comparisons cmd = f'diff -r {a} {b}' @@ -109,35 +107,6 @@ def compare_images_in_folders(a,b,jobcount,jobcurr): raise SystemError("Images Differ") -#only prints what is at the target depth (might be clunky as i was tired when writing it) -def get_directories(directory,depth): - out_dirs=[] - dirs=[] - if depth==0: - return [directory] - for i in range(depth): - - if i==0: - directory= [directory] - subdirs_current_depth=os.listdir(directory[0]) - for subdir in subdirs_current_depth: - dirs.append(os.path.join(directory[0],subdir)) - directory=dirs - else: - directory=[] - - for dircs in dirs: - subdirs_current_depth=os.listdir(dircs) - for subdir in subdirs_current_depth: - directory.append(os.path.join(dircs,subdir)) - length_current_depth=len(directory) - dirs=directory - - if i==depth-1: - out_dirs=directory - - return out_dirs - if __name__=='__main__': @@ -159,4 +128,5 @@ def get_directories(directory,depth): jobcount=args.jobcount jobindex=args.jobindex - compare_images_in_folders(a,b,jobcount,jobindex) \ No newline at end of file + compare_images_in_folders(a,b,jobcount,jobindex) + \ No newline at end of file From 0d207908ac75dfb11de2fe90558ad608453c85ea Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 12:13:59 +0200 Subject: [PATCH 245/341] changed the datalocation to wrk-kappa in testpackage --- testpackage/testpackage_commons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index ad9b4186..c366c12f 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -34,7 +34,8 @@ def source_file_name(filename,fileLocation,time): if "pass" in funcs_to_use: quit() -datalocation = "/wrk-vakka/group/spacephysics/vlasiator" +#datalocation = "/wrk-vakka/group/spacephysics/vlasiator" +datalocation = "/wrk-kappa/group/spacephysics/analysator/CI/analysator-test-data/vlasiator" runs = [] #Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do From 9729712a56e544a859f8331165e04ad2575b8560 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 13:42:46 +0200 Subject: [PATCH 246/341] added a type check in call_replace and removed custom expression calls from template --- testpackage/testpackage_template_maker.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 4b828f89..dd330f9e 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -51,6 +51,8 @@ def call_replace(call,func,skipped_args,required_args=required_args): if not check: #Add parameters if there are default_params if default_params: + if type(default_params)==str: + default_params=[default_params] for param in default_params: if param not in named_parameters: args_out.append(param) @@ -335,19 +337,18 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - + + ''' # Externals and expressions "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", + # Everything at once "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", + ''' # Streamlines, vectors "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", @@ -463,7 +464,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", - + ''' # Externals and expressions "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", @@ -477,7 +478,8 @@ def call_replace(call,func,skipped_args,required_args=required_args): # Everything at once "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - + ''' + # Streamlines, vectors "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", From fe87b17d1dba38d3660bac13d9d4a77356ed0095 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 13:46:41 +0200 Subject: [PATCH 247/341] added timeout 5 minutes for uv and dependencies installation steps for the local runner jobs. --- .github/workflows/generate_reference_plots.yml | 2 ++ .github/workflows/test_compare_images.yml | 2 ++ .github/workflows/test_compare_images_full.yml | 2 ++ .github/workflows/test_python_turso.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 84fb5cf6..ff0cd157 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -22,7 +22,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 + timeout-minutes: 5 - name: Install dependencies + timeout-minutes: 5 run: | export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 5e04dd98..a1f5a545 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -34,7 +34,9 @@ jobs: fetch-depth: 0 - name: Install uv uses: astral-sh/setup-uv@v6 + timeout-minutes: 5 - name: Install dependencies + timeout-minutes: 5 run: | export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 3aa6e9f7..b2ae2c9e 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -30,7 +30,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 + timeout-minutes: 5 - name: Install dependencies + timeout-minutes: 5 run: | export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index 779bacbf..cc1489b7 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -25,7 +25,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 + timeout-minutes: 5 - name: Install dependencies + timeout-minutes: 5 run: | export TMPDIR=$RUNNER_TEMP uv venv CI_env From 836f1f85a6e98ec930e4b02827272e150e8057fc Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 14:38:07 +0200 Subject: [PATCH 248/341] more workflow timeouts, this time for actions/checkout step --- .github/workflows/generate_reference_plots.yml | 1 + .github/workflows/test_compare_images.yml | 1 + .github/workflows/test_compare_images_full.yml | 1 + .github/workflows/test_python_turso.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index ff0cd157..3d1dcf2c 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -20,6 +20,7 @@ jobs: extras: ["all"] steps: - uses: actions/checkout@v4 + timeout-minutes: 5 - name: Install uv uses: astral-sh/setup-uv@v6 timeout-minutes: 5 diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index a1f5a545..b39a2537 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -30,6 +30,7 @@ jobs: extras: ["all"] steps: - uses: actions/checkout@v4 + timeout-minutes: 5 with: fetch-depth: 0 - name: Install uv diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index b2ae2c9e..b49b8bf8 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -28,6 +28,7 @@ jobs: extras: ["all"] steps: - uses: actions/checkout@v4 + timeout-minutes: 5 - name: Install uv uses: astral-sh/setup-uv@v6 timeout-minutes: 5 diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index cc1489b7..de943928 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -23,6 +23,7 @@ jobs: extras: ["none", "all", "bvtk"] steps: - uses: actions/checkout@v4 + timeout-minutes: 5 - name: Install uv uses: astral-sh/setup-uv@v6 timeout-minutes: 5 From 25d0f4996f3fe542bfc9abd8a4883b9316db6da0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 10 Dec 2025 18:44:38 +0200 Subject: [PATCH 249/341] changed so generate workflow goes to kappa --- .github/workflows/generate_reference_plots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 3d1dcf2c..95a7f171 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -41,7 +41,7 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate - DATAPATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" + DATAPATH="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets/$(git rev-parse HEAD)" mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH From d52f5055ac294fe534b5af13b6482f8dbaa80bcd Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 11:44:53 +0200 Subject: [PATCH 250/341] Removed weekly run from the test that uses git diff --- .github/workflows/test_compare_images.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index b39a2537..b74f9c72 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -8,8 +8,6 @@ on: branches: [image_compare] pull_request: branches: [ master, dev, image_compare] - schedule: - - cron: '0 8 * * MON' workflow_dispatch: concurrency: From b6a1231d6549693aa7319513a368bfd1844406b9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 11:46:33 +0200 Subject: [PATCH 251/341] Changed the workflow names to be more accurate --- .github/workflows/test_compare_images.yml | 2 +- .github/workflows/test_compare_images_full.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index b74f9c72..1890a456 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Turso compare colourmap images +name: Turso compare selectively images on: push: diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index b49b8bf8..bc03efe3 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Turso compare colourmap images +name: Turso compare all images on: push: From 07fda723dce876bdf68461a2403fae76a61d6492 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 14:29:04 +0200 Subject: [PATCH 252/341] removed expression calls from 3dslice --- .../testpackage_plot_colormap3dslice.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index 60c9af13..66c84b40 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -92,13 +92,13 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='B',op='y',colormap='bwr',symlog=1e-3,vscale=1e9)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['rho','B','beta'])", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['va'],vmin=1,vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,boxre=[0,30,-15,15],vmin=1,vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,lin=1,colormap='bwr',usesci=0,boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['rho'],boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['beta'])", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,boxre=[0,30,-15,15],expression=exprMA_cust,vmin=1,vmax=20,lin=1,usesci=0,fsaved=1)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['va'],vmin=1,vmax=20,lin=1,usesci=0)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,boxre=[0,30,-15,15],vmin=1,vmax=20,lin=1,usesci=0)", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,lin=1,colormap='bwr',usesci=0,boxre=[0,30,-15,15])", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['rho'],boxre=[0,30,-15,15])", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['beta'])", +#"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,boxre=[0,30,-15,15],expression=exprMA_cust,vmin=1,vmax=20,lin=1,usesci=0,fsaved=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectorcolormap='viridis')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='B',vectorcolormap='magma')", @@ -242,11 +242,11 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='x',colormap='PuOr')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='y',colormap='PuOr',symlog=0,usesci=0)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_v',op='z',colormap='PuOr',symlog=0,usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['vg_rho','vg_b_vol','vg_beta'])", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['vg_va'],vmin=1,vmax=20,lin=1,usesci=0)", +#"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,external=extcontour,pass_vars=['vg_rho','vg_b_vol','vg_beta'])", +#"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,expression=exprMA_cust,pass_vars=['vg_va'],vmin=1,vmax=20,lin=1,usesci=0)", #"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=expr_cav_cust,pass_times=3,pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_rho'],boxre=[0,30,-15,15])", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_beta'])", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_rho'],boxre=[0,30,-15,15])", +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[7,0],pass_vars=['vg_beta'])", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,normal='x',vectordensity=200)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,vectors='vg_v',vectorsize=1,normal='y',vectordensity=200)", @@ -323,7 +323,8 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] +#"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] + ] v5multipopcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_parallel',op='magnitude',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='REPLACEPOP/vg_v_perpendicular',lin=1)", From 934469c52715bcfce395003ac9202325bfa74418 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 14:35:27 +0200 Subject: [PATCH 253/341] manual git shenanigans on last commit --- .github/workflows/generate_reference_plots.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 74845f0b..124867ac 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -37,7 +37,6 @@ jobs: - name: Produce plots run: | export TMPDIR=$RUNNER_TEMP -HEAD:.github/workflows/generate_reference_plots.yml module purge module load Python/3.10.4-GCCcore-11.3.0 . CI_env/bin/activate @@ -45,14 +44,13 @@ HEAD:.github/workflows/generate_reference_plots.yml DATAPATH="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets/$(git rev-parse HEAD)" mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH -======= PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" mkdir $PATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH ->>>>>>> origin/image_compare:.github/workflows/generate_reference_data.yml cat testpackage_gen_verf.txt python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt + From b3a86fe70c27b2c61177a6dc64761457c89b5a5e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 11 Dec 2025 16:04:14 +0200 Subject: [PATCH 254/341] sbatch accidentally twice because of git merge shenanigans --- .github/workflows/generate_reference_plots.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 124867ac..8f3e5d6e 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -45,11 +45,6 @@ jobs: mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH - PATH="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets/$(git rev-parse HEAD)" - mkdir $PATH - sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $PATH - - cat testpackage_gen_verf.txt python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt From 7d43db01da2f76c749d2ffbf953fb212b2bd202f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 17:09:07 +0200 Subject: [PATCH 255/341] Reduce log spam --- testpackage/testpackage_compare.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index fa67c36c..697b42c9 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -89,17 +89,18 @@ def compare_images_in_folders(a,b,jobcount,jobcurr): #Print unique and missing files - for file in unique_files: - print("Unique file:",file) - for file in missing_files: - print("Missing file:",file) + if jobcurr==0: + for file in unique_files: + print("Unique file:",file) + for file in missing_files: + print("Missing file:",file) - if len(unique_files)!=0: - print("::warning::Found new file(s) produced by the code!") + if len(unique_files)!=0: + print("::warning::Found new file(s) produced by the code!") - if len(missing_files)!=0: - raise SystemError("Found file(s) **not** produced by the code!") + if len(missing_files)!=0: + raise SystemError("Found file(s) **not** produced by the code!") if different: @@ -129,4 +130,4 @@ def compare_images_in_folders(a,b,jobcount,jobcurr): jobindex=args.jobindex compare_images_in_folders(a,b,jobcount,jobindex) - \ No newline at end of file + From b3e6f799f2180ff1b5a8e3e1bcad36a6b0f25142 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 11 Dec 2025 15:25:22 +0200 Subject: [PATCH 256/341] Modified the vmax/vmin values of ionosphere testpackage plots since they looked off on couple plots --- .../testpackage_definitions/testpackage_plot_ionosphere.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py index 424e1ad7..185b50fe 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py +++ b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py @@ -47,8 +47,8 @@ "pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, title='title_test')", #vmin,vmax,Symmetric -"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, symmetric=True,vmin=2,vmax=40)", -"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vmin=2,vmax=40)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, symmetric=True,vmin=0,vmax=1)", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vmin=0,vmax=0.5)", "pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vmin=0)", "pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX,vscale=1e9)", #operators From b70d3d409cf899bc0fde2a288449a4e8e16da81c Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 18:01:04 +0200 Subject: [PATCH 257/341] Removed the now outdated testpackage scripts --- testpackage/testpackage_colormap.py | 933 ---------------------------- testpackage/testpackage_vdf.py | 273 -------- 2 files changed, 1206 deletions(-) delete mode 100644 testpackage/testpackage_colormap.py delete mode 100644 testpackage/testpackage_vdf.py diff --git a/testpackage/testpackage_colormap.py b/testpackage/testpackage_colormap.py deleted file mode 100644 index 455dd9d3..00000000 --- a/testpackage/testpackage_colormap.py +++ /dev/null @@ -1,933 +0,0 @@ -import analysator as pt -import sys, os -import numpy as np -import traceback - -datalocation = "/wrk/group/spacephysics/vlasiator" -runs = [] -runs.append( { 'name': 'ABC', - 'verifydir': 'testpackage_colormap/ABC/', - 'fileLocation': datalocation+'/2D/ABC/bulk/', - 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'pops': ['avgs'], - 'time': 1000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) -runs.append( { 'name': 'BCQ', - 'verifydir': 'testpackage_colormap/BCQ/', - 'fileLocation': datalocation+'/2D/BCQ/bulk/', - 'fluxLocation': None, #datalocation+'/2D/BCQ/flux/', # missing on Vorna - 'pops': ['avgs'], - 'time': 2000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -runs.append( { 'name': 'BFD', - 'verifydir': 'testpackage_colormap/BFD/', - 'fileLocation': datalocation+'/2D/BFD/bulk/', - 'fluxLocation': datalocation+'/2D/BFD/fluxfunction/', - 'fluxprefix': 'bulk.', - 'pops': ['proton','helium'], - 'time': 2000, - 'singletime': False, - 'filename': None, - 'nosubpops': False, # backstreaming / non-backstreaming - 'vlasiator5': False, - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -# runs.append( { 'name': 'BCQr', -# 'verifydir': 'testpackage_colormap/BCQr/', -# 'fileLocation': datalocation+'/2D/BCQ/', -# 'fluxLocation': None, -# 'pops': ['avgs'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0001361.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -# runs.append( { 'name': 'AFC', -# 'verifydir': 'testpackage_colormap/AFC/', -# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', -# 'fluxLocation': datalocation+'/2D/AFC/production_halfres/flux/', -# 'pops': ['proton'], -# 'time': 1000, -# 'singletime': False, -# 'filename': None, -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) -# runs.append( { 'name': 'AFCr', -# 'verifydir': 'testpackage_colormap/AFCr/', -# 'fileLocation': datalocation+'/2D/AFC/production_halfres/', -# 'fluxLocation': None, -# 'pops': ['proton'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0000592.2019-04-19_07-58-12.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [24.0e6,9.6e6,11.27e-9,10] } ) -# runs.append( { 'name': 'BFDr', -# 'verifydir': 'testpackage_colormap/BFDr/', -# 'fileLocation': datalocation+'/2D/BFD/restart/', -# 'fluxLocation': None, -# 'pops': ['avgs'], -# 'time': 0, -# 'singletime': False, -# 'filename': 'restart.0001126.2018-06-03_21-34-16.vlsv', -# 'nosubpops': False, # backstreaming / non-backstreaming -# 'vlasiator5': False, -# 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) -runs.append( { 'name': 'BGA', - 'verifydir': 'testpackage_colormap/BGA/', - 'fileLocation': datalocation+'/2D/BGA/zero_ehall_layers_23/', - 'fluxLocation': None, - 'pops': ['proton'], - 'time': 380, - 'singletime': True, # neighboring bulk files not available - 'filename': None, - 'vlasiator5': True, - 'nosubpops': True, # thermal / non-thermal - 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) - -# Custom expression function -def exprMA_cust(exprmaps, requestvariables=False): - if vlasiator5 is True: - reqs = ['vg_va'] - else: - reqs = ['va'] - if requestvariables==True: - return reqs - # exprmaps is a dictionary of numpy arrays - # Each array has 2 dimensions [xsize, ysize] - # or 3 dimensions [xsize, ysize, components] - # here the function returns the M_A with a preset bulk velocity - custombulkspeed=1500000. # m/s - va = exprmaps[reqs[0]][:,:] - MA = np.ma.divide(custombulkspeed,va) - return MA - -# Second example of a more involved custom expression function -def expr_cav_cust(pass_maps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # This custom expression returns a map with values of - # either 0 (solar wind), 0.5 (caviton), or 1.0 (SHFA), calculated against - # time-averaged background values. This version doesn't do intelligent checks for the - # format of the incoming data. - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - raise TypeError("expr_cav_cust expected a list of timesteps to average from, but got a single timestep. Exiting.") - - - # Multiple time steps were found - ntimes = len(pass_maps) - dsteps = [x['dstep'] for x in pass_maps] - curri = dsteps.index(0) - thesemaps = pass_maps[curri] - - thisrho = np.ma.masked_less_equal(thesemaps[reqs[0]][:,:], 0) - thisB = np.ma.masked_less_equal(thesemaps[reqs[1]],0) - thisbeta = np.ma.masked_less_equal(thesemaps[reqs[2]],0) - thisBmag = np.linalg.norm(thisB, axis=-1) - - avgrho = np.zeros(np.array(thisrho.shape)) - avgBmag = np.zeros(np.array(thisrho.shape)) - # avgbeta = np.zeros(np.array(thisrho.shape)) - - for i in range(ntimes): - if i==curri: # Exclude current frame from background value averaging - continue - nowmaps = pass_maps[i] - print(nowmaps['dstep']) - avgrho = np.add(avgrho, nowmaps[reqs[0]]) - avgBcalc = np.linalg.norm(nowmaps[reqs[1]], axis=-1) - avgBmag = np.add(avgBmag, avgBcalc) - # avgbeta = np.add(avgbeta, nowmaps[2]) - - avgrho = np.divide(np.ma.masked_less_equal(avgrho,0), np.array([ntimes-1])) - avgBmag = np.divide(np.ma.masked_less_equal(avgBmag,0), np.array([ntimes-1])) - #avgbeta = np.divide(np.ma.masked_less_equal(avgbeta,0), np.array([ntimes-1])) - - rhoratio = np.ma.divide(thisrho, avgrho) - Bmagratio = np.ma.divide(thisBmag, avgBmag) - #betaratio = np.divide(thisbeta, avgbeta) - - rhoratioreq = 0.9 - bmagratioreq = 0.9 - betashfareq = level_beta_SHFA - - # Calculations using masked arrays proved problematic so a less-than elegant method is used here. - empty = np.zeros(np.array(thisrho.shape))+0.0 - half = empty + 0.5 - one = empty + 1.0 - - caviton=np.zeros(empty.shape,dtype='float64') - np.add(empty, one,out=caviton, where=(rhoratiobetashfareq)) - print("sum of SHFA ",shfa.sum()) - - combo=np.zeros(empty.shape,dtype='float64') - np.add(empty, half,out=combo,where=(cavitonbmag>1.5)) - print("sum of combo ",combo.sum()) - combo2=np.zeros(empty.shape,dtype='float64') - combo2 = np.add(empty, half,out=combo2, where=(shfa>2.5)) - print("sum of combo2 ",combo2.sum()) - combo3 = combo+combo2 - print("sum of combo3 ",combo3.sum()) - - # Mask out anything that is inside the bow shock - combo3 = np.ma.masked_where(thisrho>level_bow_shock, combo3) - print("sum of combo3 upstream ",combo3.sum()) - - return combo3 - - -# Second example of a more involved custom expression function -def timesmooth(pass_maps): - # pass_maps is a dictionary of numpy arrays - # Each array has 2 dimensions [ysize, xsize] - # or 3 dimensions [ysize, xsize, components] - - # for time averaging, it's a list of dictionaries - # Each dictionary contains an entry called 'dstep' - # Which contains the relative time step position, i.e. - # a value of 0 indicates no time offset. - - # consists of a single [ysize,xsize] array to smooth over time - - if type(pass_maps) is not list: - # Not a list of time steps, calculating this value does not make sense. - raise TypeError("timesmooth expected a list of timesteps to average from, but got a single timestep. Exiting.") - - ntimes = len(pass_maps) - print("this many time steps ",ntimes) - # Select first valid variable - listofkeys = iter(pass_maps[0]) - while True: - var = next(listofkeys) - if var!="dstep": break - - # Multiple time steps were found - avg = np.zeros(pass_maps[0][var].shape) - for i in range(ntimes): - avg = np.add(avg, pass_maps[i][var]) - return np.divide(avg, np.array([ntimes])) - -# Helper function for drawing on existing panel -def extcontour(ax, XmeshXY,YmeshXY, extmaps, requestvariables=False): - if vlasiator5 is True: - reqs= ['vg_rho','vg_b_vol','vg_beta'] - else: - reqs= ['rho', 'B', 'beta'] - if requestvariables==True: - return reqs - - rho = extmaps[reqs[0]] - beta = extmaps[reqs[2]] - # take magnitude of B - B = np.linalg.norm(extmaps[reqs[1]],axis=-1) - - # Colours to use - color_cavitons = '#924900' - color_SHFAs = '#B66DFF' - color_BS = '#FFFF6D' - - # mask cavitons - cavitons = np.ma.masked_greater_equal(B,level_B_caviton) - cavitons.mask[rho > level_n_caviton] = True - cavitons.fill_value = 0. - cavitons[cavitons.mask == False] = 1. - - # mask SHFAs - SHFAs = np.ma.masked_greater_equal(B,level_B_caviton) - SHFAs.mask[rho > level_n_caviton] = True - SHFAs.mask[beta < level_beta_SHFA] = True - SHFAs.fill_value = 0. - SHFAs[SHFAs.mask == False] = 1. - - # draw contours - contour_shock = ax.contour(XmeshXY,YmeshXY,rho,[level_bow_shock], - linewidths=1.2, colors=color_BS) - contour_cavitons = ax.contour(XmeshXY,YmeshXY,cavitons.filled(),[0.5], linewidths=1.5, colors=color_cavitons) - contour_SHFAs = ax.contour(XmeshXY,YmeshXY,SHFAs.filled(),[0.5], linewidths=1.5, colors=color_SHFAs) - -regularcalls = [ -# Input and output methods, nooverwrite -"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", - -# Thickness, scale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", - -# msec musec titles -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - -# title, axes, noborders -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - -#Horizontal colorbar -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',highres=True,cb_horizontal=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cb_horizontal=True)", - -# Variables, operators, colormaps, usesci, lin, vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', colormap='nipy_spectral')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', colormap='nipy_spectral', vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='x', colormap='bwr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='z', colormap='bwr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', colormap='warhol',lin=1, vscale=1e-3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='x', colormap='PuOr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='V', op='z', colormap='PuOr',symlog=0, usesci=0)"] - -nonrestartcalls = [ -# Overplots and flux lines -"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", - -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', colormap='hot_desaturated', vscale=1e3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='x', colormap='RdBu',symlog=0, usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='y', colormap='RdBu',symlog=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='E', op='z', colormap='RdBu',symlog=0, usesci=0)", - -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='RhoBackstream', colormap='jet')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta',lin=1, usesci=0, colormap='viridis',vmax=50)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Mms',lin=1,usesci=0, vmin=0, colormap='magma')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='va',lin=1,usesci=0, colormap='magma_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vms',lin=1, colormap='plasma_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vs',lin=1, colormap='viridis_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='max_v_dt', vscale=1e3)", - -# Vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature', colormap='plasma', vscale=1e-6,lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure', vscale=1e9)", - -# Symlog and vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-12)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=0,vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - -# Zoom and units -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - -# Externals and expressions -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['rho'], boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['beta'])", - -# Everything at once -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='viridis')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B', vectorcolormap='magma')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20,vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400,vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='E',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", - - -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='black')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinecolor='gray')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='B', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='V', streamlinedensity=2, boxre=[-10,10,5,50])", - -# More data reducers -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VBackstream',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VNonBackstream',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicular',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelBackstream', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularBackstream',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VParallelNonBackstream', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='VPerpendicularNonBackstream',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pressure')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PParallelNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpendicularNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdyn',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Pdynx',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Temperature')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TParallelNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpendicularNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='beta')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='betaPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeam',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] - - -multipopcalls = [ -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VParallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/VPerpendicular',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pressure')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PParallelNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpendicularNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/PPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdyn',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Pdynx',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Temperature')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TParallelNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpendicularNonBackstream')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/TPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverPar', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpOverParNonBackstream', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/beta')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaParallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/betaPerpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Thermalvelocity',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/Blocks')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/gyrotropy')"] - -v5regularcalls = [ -# Input and output methods, nooverwrite -"pt.plot.plot_colormap(filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1)", -"pt.plot.plot_colormap(vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1)", - -# Thickness, scale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=5.0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, highres=True)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, highres=3)", - -# Tick interval -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1)", - -# msec musec titles -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec')", - -# Watermarks -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, Earth=True)", - -# title, axes, noborders -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1,highres=True)", - -# Variables, operators, colormaps, usesci, lin, vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', colormap='nipy_spectral', vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='x', colormap='bwr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='z', colormap='bwr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', colormap='warhol',lin=1, vscale=1e-3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='x', colormap='PuOr')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)"] - -v5nonrestartcalls = [ -# Overplots and flux lines -"pt.plot.plot_colormap(filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved=1, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxfile=fluxLocation+fluxname, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, step=REPLACETIME, fluxthick=0.5, fluxlines=10)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, fluxdir=fluxLocation, fluxthick=5, fluxlines=2)", - -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', colormap='hot_desaturated')", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', colormap='hot_desaturated', vscale=1e3)", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='x', colormap='RdBu',symlog=0, usesci=0)", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='y', colormap='RdBu',symlog=0)", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_e_vol', op='z', colormap='RdBu',symlog=0, usesci=0)", - -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rho_nonthermal', colormap='jet')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta',lin=1, usesci=0, colormap='viridis',vmax=50)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_MA',lin=1,usesci=0,vmin=2,vmax=40, colormap='inferno_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_Mms',lin=1,usesci=0, vmin=0, colormap='magma')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_va',lin=1,usesci=0, colormap='magma_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vms',lin=1, colormap='plasma_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vs',lin=1, colormap='viridis_r')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_maxdt_acceleration', vscale=1e6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_maxdt_acceleration', vscale=1e3)", - -# Vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e3, vmax=7.e6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e-3, vmax=7.e0, vscale=1e-6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vmin=7.e6, vmax=7.e9, vscale=1e3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature', colormap='plasma', vscale=1e-6,lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure', vscale=1e9)", - -# Symlog and vscale -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-12)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=0,vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1,vscale=1e9)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_b_vol', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - -# Zoom and units -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=3)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxre=[-10,10,5,50],axisunit=6)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, boxm=[-10e6,50e6,-5e6,15e6],axisunit=0)", - -# Externals and expressions -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", -"pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", - -# Everything at once -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - -# Streamlines, vectors -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='viridis')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol', vectorcolormap='magma')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_b_vol',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20,vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400,vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=1.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20,vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400,vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=20, boxre=[-10,10,5,50],vectorsize=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectordensity=400, boxre=[-10,10,5,50],vectorsize=0.5)", - -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='black')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinecolor='gray')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_b_vol', streamlinedensity=2, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=2)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5,streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2,streamlinethick=0.5)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=0.5, boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', boxre=[-10,10,5,50])", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, streamlines='vg_v', streamlinedensity=2, boxre=[-10,10,5,50])", - -# More data reducers -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_nonthermal',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_thermal',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_nonthermal', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_nonthermal',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_parallel_thermal', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v_perpendicular_thermal',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pressure')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_parallel_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_perpendicular_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdyn',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_pdynx',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_temperature')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_parallel_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_perpendicular_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeam',lin=1)", -# "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeamRatio')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_gyrotropy')"] - -v5multipopcalls = [ -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_perpendicular',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pressure')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_parallel_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_perpendicular_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_p_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdyn',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_pdynx',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_temperature')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_nonthermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_parallel_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_perpendicular_thermal')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_t_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_nonthermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_anisotropy_thermal', vmin=0.1, vmax=10)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_parallel')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_beta_perpendicular')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_thermalvelocity',lin=1)", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_blocks')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_gyrotropy')"] - -# For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# regularcalls = [] -# nonrestartcalls = ["pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -# ] -# multipopcalls = [] -# v5regularcalls = [] -# v5nonrestartcalls = [] -# v5multipopcalls = [] - -#construct calls -calls = [] -callrunids = [] -callrunindex = [] -for i,run in enumerate(runs): - # bulk and restart files - vlasiator5 = run['vlasiator5'] - filename = run['filename'] - fileLocation = run['fileLocation'] - singletime = run['singletime'] - nosubpops = run['nosubpops'] - fluxLocation = run['fluxLocation'] - callindex = 0 - - calls_in=v5regularcalls if vlasiator5 else regularcalls - for call in calls_in: - if not filename is None: - if vlasiator5: - call = call.replace("var='vg_v'","var='vg_restart_v'") - else: - call = call.replace("var='V'","var='restart_V'") - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - - # non-restart files - if filename is None: - #non restart calls - calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls - for call in calls_in: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - - callrunids.append(i) - calls.append(call) - callrunindex.append(callindex) - callindex += 1 - - #multipop calls - calls_in=v5multipopcalls if vlasiator5 else multipopcalls - for pop in run['pops']: - if pop != 'avgs': - for call in calls_in: - # Skip flux function calls if no flux files - if "flux" in call and fluxLocation is None: - continue - # skip time integration if only one file available - if "pass_times" in call and singletime: - continue - # thermal / non-thermal subpopulations - if vlasiator5 and (("_thermal" in call) or ("_nonthermal" in call)) and nosubpops: - continue - elif (("_backstream" in call) or ("_nonbackstream" in call)) and nosubpops: - continue - mpcall = call.replace('REPLACEPOP',pop) - callrunids.append(i) - calls.append(mpcall) - callrunindex.append(callindex) - callindex += 1 - - -nteststot = len(callrunids) - - -# How many jobs? -jobcount=int(sys.argv[1]) -jobcurr=int(sys.argv[2]) -increment = int(nteststot/jobcount) -remainder = nteststot - jobcount * increment -start=jobcurr * increment -end=start + increment -# Remainder frames are divvied out evenly among tasks -if jobcurr < remainder: - start = start + jobcurr - end = end + jobcurr + 1 -else: - start = start + remainder - end = end + remainder - - -# Perform call -for j in range(start,end): - # Calculate which run - jrun = callrunindex[j] - runid = callrunids[j] - call = calls[j] - - runname = runs[runid]['name'] - verifydir = runs[runid]['verifydir'] - fileLocation = runs[runid]['fileLocation'] - fluxLocation = runs[runid]['fluxLocation'] - pops = runs[runid]['pops'] - time = runs[runid]['time'] - filename = runs[runid]['filename'] - vlasiator5 = runs[runid]['vlasiator5'] - singletime = runs[runid]['singletime'] - - level_bow_shock = runs[runid]['cavitonparams'][0] - level_n_caviton = runs[runid]['cavitonparams'][1] - level_B_caviton = runs[runid]['cavitonparams'][2] - level_beta_SHFA = runs[runid]['cavitonparams'][3] - - outputLocation=pt.plot.defaultoutputdir+verifydir - - # Source data files - if filename is None: - bulkname = "bulk."+str(time).rjust(7,'0')+".vlsv" - else: - bulkname = filename - if 'fluxprefix' in runs[runid]: - fluxname = runs[runid]['fluxprefix']+str(time).rjust(7,'0')+".bin" - else: - fluxname = "flux."+str(time).rjust(7,'0')+".bin" - - call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") - call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") - call = call.replace('REPLACETIME',"'"+str(time)+"'") - - # Many different plots - print(j, runid, jrun, call) - f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) - try: - exec(call) - except Exception as e: - print("----------------------------\nFAILURE DURING CALL ",j," \n```\n"+call+"```\n", repr(e)) - - traceback.print_exc() - print("END TRACE for call",j,"\n----------------------------") diff --git a/testpackage/testpackage_vdf.py b/testpackage/testpackage_vdf.py deleted file mode 100644 index 3dc61065..00000000 --- a/testpackage/testpackage_vdf.py +++ /dev/null @@ -1,273 +0,0 @@ -import analysator as pt -import sys, os -import numpy as np -import traceback - -runs = [] -runs.append( { 'name': 'ABC', - 'verifydir': 'testpackage_vdf/ABC/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/ABC/distributions/', - 'pops': ['avgs'], - 'time': 100, - 'filename': None} ) -runs.append( { 'name': 'BCQ', - 'verifydir': 'testpackage_vdf/BCQ/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/bulk/', - 'pops': ['avgs'], - 'time': 1600, - 'filename': None } ) -runs.append( { 'name': 'BED', - 'verifydir': 'testpackage_vdf/BED/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BED/bulk/', - 'pops': ['avgs'], - 'time': 2000, - 'filename': None } ) -runs.append( { 'name': 'BFD', - 'verifydir': 'testpackage_vdf/BFD/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BFD/bulk/', - 'pops': ['proton','helium'], - 'time': 1000, - 'filename': None } ) -runs.append( { 'name': 'BCQr', - 'verifydir': 'testpackage_vdf/BCQr/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BCQ/restart/', - 'pops': ['avgs'], - 'time': 0, - 'filename': 'restart.0001361.vlsv' } ) -runs.append( { 'name': 'BFDr', - 'verifydir': 'testpackage_vdf/BFDr/', - 'fileLocation': '/wrk-vakka/group/spacephysics/vlasiator/2D/BFD/restart/', - 'pops': ['avgs'], - 'time': 0, - 'filename': 'restart.0001126.vlsv' } ) - -regularcalls = [ -# Input and output methods, nooverwrite -"pt.plot.plot_vdf(figsize=[5,4],filename=fileLocation+bulkname, outputdir=outputLocation+'/'+REPLACEINDEX+'_', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],filedir=fileLocation, step=REPLACETIME, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, outputfile=outputLocation+REPLACEPREVINDEX+'_outputfiletest.png', nooverwrite=1, coordre=REPLACECOORDRE)", - -# cellids, coordinates -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACECELLID)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACECOORDINATES)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellids=REPLACEMULTIPLECELLID)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordinates=REPLACEMULTIPLECOORDINATES)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE)", - -# Colorbar -"pt.plot.plot_vdf(vlsvobj=f, run=verifydir+REPLACEINDEX, coordre=REPLACEMULTIPLECOORDRE,cb_horizontal=True)", - - -# Thickness, scale -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, thick=2.0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, scale=2.0, coordre=REPLACECOORDRE)", - -# Tick interval -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1000, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=500, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=0.5,axisunit=6, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, tickinterval=1,axisunit=6, coordre=REPLACECOORDRE)", - -# msec musec titles -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='msec', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='musec', coordre=REPLACECOORDRE)", - -# B vector -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", - -# Zoom and units -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, box=[-2e6,2e6,-2e6,2e6],axisunit=0, coordre=REPLACECOORDRE)", - -# Watermarks -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmarkb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='NW', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SE', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wmark='SW', coordre=REPLACECOORDRE)", - -# Biglabels -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='A', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='B', biglabloc=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='C', biglabloc=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='D', biglabloc=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, biglabel='E', biglabloc=3, coordre=REPLACECOORDRE)", - -# title, axes, noborders -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noylabels=1,noxlabels=1,noborder=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,nocb=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, title='',noylabels=1,noxlabels=1,noborder=1,internalcb=1, coordre=REPLACECOORDRE)", - -# slicethick -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=0, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=4, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, slicethick=1e3, coordre=REPLACECOORDRE)", - -# cellsize -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=0.5, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=2, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cellsize=4, coordre=REPLACECOORDRE)", - -# fmin, fmax, setThreshold -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, fmin=1.e-14,fmax=1.e-12, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-20, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=1.e-15, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, setThreshold=0, coordre=REPLACECOORDRE)", - -# colormaps -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='nipy_spectral', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='jet', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='hot_desaturated_r', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='viridis', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='plasma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='magma', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='warhol', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr', coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr', coordre=REPLACECOORDRE)", - -# cbulk, center, bvector -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, cbulk=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[-7e5,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bvector=1, center=[2e5,2e5,2e5], coordre=REPLACECOORDRE)", - -# wflux -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, wflux=1, coordre=REPLACECOORDRE)", - -# directions -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xy=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,0,5], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, xz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[0,1,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, yz=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[-1,0,0], coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1], coordre=REPLACECOORDRE)", -] - -multipopcalls = [ -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, pop='REPLACEPOP', coordre=REPLACECOORDRE)"] - - - -# count how many tests to run in total -ntests = [] -for i,run in enumerate(runs): - n = len(regularcalls) - for pop in run['pops']: - if pop!='avgs': - n += len(multipopcalls) - ntests.append(n) -nteststot = np.sum(np.array(ntests)) - -# How many jobs? -jobcount=int(sys.argv[1]) -jobcurr=int(sys.argv[2]) -increment = int(nteststot/jobcount) -remainder = nteststot - jobcount * increment -start=jobcurr * increment -end=start + increment -# Remainder frames are divvied out evenly among tasks -if jobcurr < remainder: - start = start + jobcurr - end = end + jobcurr + 1 -else: - start = start + remainder - end = end + remainder - -#print("nteststot",nteststot) -#print("jobcount",jobcount,"jobcurr",jobcurr,"start",start,"end",end) - -for j in range(start,end): - # Calculate which run - jrun = j - runid = 0 - while True: - if jrun Date: Thu, 11 Dec 2025 18:03:40 +0200 Subject: [PATCH 258/341] Cleaned up comments in template_maker --- testpackage/testpackage_template_maker.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index dd330f9e..ee298b1f 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -7,18 +7,6 @@ import re import argparse -#add manualcals filtering or something since rightnow it tries to do it for 3D data? does it work? - - -# For handier debugging, uncomment these to overwrite call lists and include only relevant calls -# restartcalls = [] -# nonrestartcalls = ["pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['rho','B','beta'],lin=1,colormap='bwr',usesci=0)","pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", -# ] -# multipopcalls = [] -# v5restartcalls = [] -# v5nonrestartcalls = [] -# v5multipopcalls = [] - required_args=False def call_replace(call,func,skipped_args,required_args=required_args): #This is kind of scuffed maybe @@ -107,14 +95,8 @@ def call_replace(call,func,skipped_args,required_args=required_args): #required args for functions, lists are handled as OR statements, tuples within lists as AND - #add a way to add required args automatically - #list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults - #maybe add overide to this in runs append - - #filedir issues test with the one below and see if fixed, alos other errors - required_args ={ "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], From a52ebfa25353b648a081adf0342642152378e00a Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 18:06:28 +0200 Subject: [PATCH 259/341] Removed the old batch scripts also --- testpackage/run_testpackage_colormap.sh | 20 ---------- .../run_testpackage_colormap_workflow.sh | 39 ------------------ testpackage/run_testpackage_vdf.sh | 20 ---------- testpackage/run_testpackage_vdf_workflow.sh | 40 ------------------- 4 files changed, 119 deletions(-) delete mode 100644 testpackage/run_testpackage_colormap.sh delete mode 100755 testpackage/run_testpackage_colormap_workflow.sh delete mode 100644 testpackage/run_testpackage_vdf.sh delete mode 100755 testpackage/run_testpackage_vdf_workflow.sh diff --git a/testpackage/run_testpackage_colormap.sh b/testpackage/run_testpackage_colormap.sh deleted file mode 100644 index 3454c8cd..00000000 --- a/testpackage/run_testpackage_colormap.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -l -#SBATCH -t 00:30:00 -#SBATCH -J analysator_testpackage -#SBATCH -p short -#SBATCH -n 1 -#SBATCH --array=0-20 -#SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 - -jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) -index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) - -hostname -source pyvenv.sh - -export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/ - -python testpackage_colormap.py $jobcount $index -echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/run_testpackage_colormap_workflow.sh b/testpackage/run_testpackage_colormap_workflow.sh deleted file mode 100755 index 811b2de3..00000000 --- a/testpackage/run_testpackage_colormap_workflow.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -l -#SBATCH -t 00:30:00 -#SBATCH -J analysator_testpackage -#SBATCH -p short -#SBATCH -n 1 -#SBATCH --array=1-4 -#SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 - - -#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS -jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) -index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) - - -hostname - - -module purge -export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -module load Python/3.10.4-GCCcore-11.3.0 -module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - -echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT - -source CI_env/bin/activate - -module list - -mkdir -p $PWD/produced_plots/ - -export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/produced_plots/ - - -python ./testpackage/testpackage_colormap.py $jobcount $index -#python ./testpackage/color_small_test.py $jobcount $index -echo "EXIT_CODE_FROM_JOB $?" -#echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/run_testpackage_vdf.sh b/testpackage/run_testpackage_vdf.sh deleted file mode 100644 index 32200596..00000000 --- a/testpackage/run_testpackage_vdf.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -l -#SBATCH -t 00:20:00 -#SBATCH -J analysator_testpackage_vdf -#SBATCH -p short -#SBATCH -M carrington -#SBATCH -n 1 -#SBATCH --array=1 -#SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 - -jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) -index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) - -source pyvenv.sh - -export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/ - -python testpackage_vdf.py $jobcount $index -echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/run_testpackage_vdf_workflow.sh b/testpackage/run_testpackage_vdf_workflow.sh deleted file mode 100755 index 75f73458..00000000 --- a/testpackage/run_testpackage_vdf_workflow.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -l -#SBATCH -t 00:30:00 -#SBATCH -J analysator_testpackage -#SBATCH -p short -#SBATCH -n 1 -#SBATCH --array=1-4 -#SBATCH --no-requeue -#SBATCH --mem-per-cpu=16000 - - -#THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS -jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) -index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) - - -hostname - - -module purge -export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -module load Python/3.10.4-GCCcore-11.3.0 -module load ImageMagick/7.1.0-37-GCCcore-11.3.0 - -echo "SLURM_JOB_ID=$SLURM_JOB_ID" >> $GITHUB_OUTPUT - - -source CI_env/bin/activate - -module list - -mkdir -p $PWD/produced_plots/ - -export PTNONINTERACTIVE=1 -export PTOUTPUTDIR=$PWD/produced_plots/ - - -python ./testpackage/testpackage_vdf.py $jobcount $index -#python ./testpackage/color_small_test.py $jobcount $index -echo "EXIT_CODE_FROM_JOB $?" -#echo Job $SLURM_ARRAY_TASK_ID complete. From 7e174e5bef9c9766fb059b15e062a03486f19476 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 18:08:08 +0200 Subject: [PATCH 260/341] Removed the unused ImageMagick from create_env --- testpackage/create_env.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 8e13a5c4..f8599cfc 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -76,7 +76,6 @@ def create_venv_script(path,venv_path): used_gcc_version = version_info[-1].strip("[]") f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") - f.write("module load ImageMagick/7.1.0-37-GCCcore-11.3.0\n") f.write("module list\n") f.write(f"source {venv_path}/bin/activate\n") f.close() From 1efa34303207de4f526af6aa35c544c465939abb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 18:15:36 +0200 Subject: [PATCH 261/341] Should fix the linter complaining --- testpackage/testpackage_commons.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index c366c12f..b8732220 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -192,6 +192,14 @@ def source_file_name(filename,fileLocation,time): callrunindex = [] funcids=[] +#here so lint doesnt complain +restartcalls=None +nonrestartcalls=None +multipopcalls=None +v5restartcalls=None +v5nonrestartcalls=None +v5multipopcalls=None + for i,run in enumerate(runs): # bulk and restart files vlasiator5 = run['vlasiator5'] From ec3d2b41968ac8adda0fd793d6a5d49244179c17 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 11 Dec 2025 18:21:44 +0200 Subject: [PATCH 262/341] Added references to custom_expr.py so linter maybe doesnt complain? --- testpackage/testpackage_custom_expr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testpackage/testpackage_custom_expr.py b/testpackage/testpackage_custom_expr.py index 0834f4d7..ae1f31c1 100644 --- a/testpackage/testpackage_custom_expr.py +++ b/testpackage/testpackage_custom_expr.py @@ -1,5 +1,11 @@ import numpy as np +vlasiator5=None +level_bow_shock = None +level_n_caviton = None +level_B_caviton = None +level_beta_SHFA = None + # Custom expression function From c48dfe5012c77f6e23986a8b25b9a65f7b718cd2 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 12 Dec 2025 15:00:24 +0200 Subject: [PATCH 263/341] fixed figsize fixing --- analysator/pyPlots/plot_vdf.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index d9826b55..eb89d2c1 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -69,7 +69,7 @@ def doHistogram(f,VX,VY,Voutofslice,vxBinEdges,vyBinEdges,vthick,reducer="integr fw = f # use particle phase-space density as weighting in the histogram # Select cells which are within slice area - if vthick!=0: + if vthick!=plot_vdf: indexes = [(abs(Voutofslice) <= 0.5*vthick) & (VX > min(vxBinEdges)) & (VX < max(vxBinEdges)) & (VY > min(vyBinEdges)) & (VY < max(vyBinEdges)) ] @@ -1086,19 +1086,14 @@ def plot_vdf(filename=None, if axes is None: if figsize is not None: - #Matplotlib jank, it noborder changed the imagesize even though you'd think insetting would work - #it did fix the size if inset was something weird like [0.5,0.5,0.5,0.5] *shrug* if noborder: logging.warning("noborder and figsize enabled, this may undo effects of figsize") fig = plt.figure(figsize=figsize,dpi=300) - axm=plt.gca() - axm.axis('off') - ax1 = axm.inset_axes([0.05,0.05,0.9,0.9]) else: # Create 300 dpi image of suitable size fig = plt.figure(figsize=[4.0,3.15*ratio] ,dpi=300) - ax1 = plt.gca() # get current axes + ax1 = plt.gca() # get current axes else: ax1=axes @@ -1109,7 +1104,7 @@ def plot_vdf(filename=None, # Grid #plt.grid(color='grey',linestyle='-') - #plt.minorticks_on() + #plt.minorticks_on()for i in {0..9}; do echo $i; find . -name "000$i*.png" -exec sh -c "identify {} | grep -Po '(\d+x\d+)\s' " \; ; done ax1.grid(color='grey',linestyle='-',lw=thick) ax1.tick_params(axis='x',which='minor') ax1.tick_params(axis='y',which='minor') @@ -1188,10 +1183,11 @@ def plot_vdf(filename=None, BLcoords=[0.02,0.02] BLha = "left" BLva = "bottom" - + plt.text(BLcoords[0],BLcoords[1],biglabel, fontsize=fontsize4,weight='black', transform=ax1.transAxes, ha=BLha, va=BLva,color='k',bbox=dict(facecolor='white', alpha=0.5, edgecolor=None)) + if bvector is not None and bpara is None and bperp is None and bpara1 is None: # Draw vector of magnetic field direction if xy is not None and coordswap is None: @@ -1306,6 +1302,8 @@ def plot_vdf(filename=None, plt.tight_layout() savefig_pad=0.05 # The default is 0.1 bbox_inches=None + elif figsize is not None: + bbox_inches=None else: plt.tight_layout(pad=0.01) savefig_pad=0.01 From 3f43cb103153e095dff0989f7eb79e7cf1440685 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 12 Dec 2025 15:04:51 +0200 Subject: [PATCH 264/341] fixed typo --- analysator/pyPlots/plot_vdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index eb89d2c1..97b9ad87 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -69,7 +69,7 @@ def doHistogram(f,VX,VY,Voutofslice,vxBinEdges,vyBinEdges,vthick,reducer="integr fw = f # use particle phase-space density as weighting in the histogram # Select cells which are within slice area - if vthick!=plot_vdf: + if vthick!=0: indexes = [(abs(Voutofslice) <= 0.5*vthick) & (VX > min(vxBinEdges)) & (VX < max(vxBinEdges)) & (VY > min(vyBinEdges)) & (VY < max(vyBinEdges)) ] From a1cb5ed2b85355f59a593e306f49c2fa3876af14 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 12 Dec 2025 15:06:15 +0200 Subject: [PATCH 265/341] Another typo, (learning vim is hard) --- analysator/pyPlots/plot_vdf.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index 97b9ad87..fe033ed5 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -1104,7 +1104,7 @@ def plot_vdf(filename=None, # Grid #plt.grid(color='grey',linestyle='-') - #plt.minorticks_on()for i in {0..9}; do echo $i; find . -name "000$i*.png" -exec sh -c "identify {} | grep -Po '(\d+x\d+)\s' " \; ; done + #plt.minorticks_on() ax1.grid(color='grey',linestyle='-',lw=thick) ax1.tick_params(axis='x',which='minor') ax1.tick_params(axis='y',which='minor') @@ -1182,12 +1182,10 @@ def plot_vdf(filename=None, elif biglabloc==3: BLcoords=[0.02,0.02] BLha = "left" - BLva = "bottom" - + BLva = "bottom" plt.text(BLcoords[0],BLcoords[1],biglabel, fontsize=fontsize4,weight='black', transform=ax1.transAxes, ha=BLha, va=BLva,color='k',bbox=dict(facecolor='white', alpha=0.5, edgecolor=None)) - if bvector is not None and bpara is None and bperp is None and bpara1 is None: # Draw vector of magnetic field direction if xy is not None and coordswap is None: From 0a2586f1dc018c7008ece1776dbf5a3a811423f0 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 12 Dec 2025 15:52:19 +0200 Subject: [PATCH 266/341] Added savefig_pad since it was not assignet if figsize was set --- analysator/pyPlots/plot_vdf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/analysator/pyPlots/plot_vdf.py b/analysator/pyPlots/plot_vdf.py index fe033ed5..9273244e 100644 --- a/analysator/pyPlots/plot_vdf.py +++ b/analysator/pyPlots/plot_vdf.py @@ -1301,6 +1301,7 @@ def plot_vdf(filename=None, savefig_pad=0.05 # The default is 0.1 bbox_inches=None elif figsize is not None: + savefig_pad=0.05 bbox_inches=None else: plt.tight_layout(pad=0.01) From fddbaaad4acd600abe8f625ce8d9820147f26258 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Fri, 12 Dec 2025 15:55:54 +0200 Subject: [PATCH 267/341] changed diff to image_compare and changed install dependencies timeout to 60 for debug purposes --- .github/workflows/test_compare_images.yml | 2 +- testpackage/testpackage_get_diff.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 1890a456..46f2122f 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -35,7 +35,7 @@ jobs: uses: astral-sh/setup-uv@v6 timeout-minutes: 5 - name: Install dependencies - timeout-minutes: 5 + timeout-minutes: 60 run: | export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 090cb31a..3317457c 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,7 +1,7 @@ #from testpackage_helper import system_call from create_env import system_call -git_diff=system_call('git diff --name-only origin/master...').split('\n') +git_diff=system_call('git diff --name-only origin/image_compare...').split('\n') #Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). #Checking uses 'in' operation, case insensitive From 41197e486f03def92f46c9dff870e9b6e4701d20 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 15 Dec 2025 11:48:06 +0200 Subject: [PATCH 268/341] General clean up, removing unused imports and changing syntax to be better like type()== calls were changed to type() is Signed-off-by: lassejsc --- testpackage/create_env.py | 2 +- testpackage/testpackage_compare.py | 5 ----- testpackage/testpackage_get_diff.py | 2 +- testpackage/testpackage_get_job_error.py | 1 - testpackage/testpackage_template_maker.py | 14 +++++--------- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index f8599cfc..0642d792 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -93,7 +93,7 @@ def create_venv_script(path,venv_path): venv_name= 'venv_testpackage' venv_path = os.path.abspath('./'+venv_name) - if not venv_name in os.listdir('.') and create_venv_local: + if venv_name not in os.listdir('.') and create_venv_local: print('venv_testpackage not found, creating virtual environment') create_venv(venv_path,editable=args.editable,install_analysator=not args.no_analysator) create_venv_script('./',venv_path) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 697b42c9..d027fbb8 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -1,12 +1,7 @@ import subprocess -import time as timetime -import os -import sys from argparse import ArgumentParser import cv2 import numpy as np -import logging -import os.path #could be used to replace compare_images with a cv2 based implementation diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 3317457c..5ddfe8ff 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -40,7 +40,7 @@ if not val: #run all tests quit() - elif type(val)==list: + elif type(val) is list: output.extend(val) else: output.append(val) diff --git a/testpackage/testpackage_get_job_error.py b/testpackage/testpackage_get_job_error.py index 5f99fc17..9a4aa5fb 100644 --- a/testpackage/testpackage_get_job_error.py +++ b/testpackage/testpackage_get_job_error.py @@ -1,5 +1,4 @@ -import os from argparse import ArgumentParser diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index ee298b1f..6fb5e92e 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -1,9 +1,5 @@ -import analysator as pt -import sys, os -import numpy as np -import traceback +import analysator as pt #this import is used, see the function_pars import inspect -import logging import re import argparse @@ -30,7 +26,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): check=False for param in required_params: - if type(param)==tuple and param[0] not in named_parameters: + if type(param) is tuple and param[0] not in named_parameters: check=True elif any((all(r in named_parameters for r in param),(param in named_parameters))): if not skipped_args or func not in skipped_args or not any(r in skipped_args[func].keys() for r in param): @@ -39,7 +35,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): if not check: #Add parameters if there are default_params if default_params: - if type(default_params)==str: + if type(default_params) is str: default_params=[default_params] for param in default_params: if param not in named_parameters: @@ -60,9 +56,9 @@ def call_replace(call,func,skipped_args,required_args=required_args): skipped_args_dict=False call_args=arg.split("=") if skipped_args_dict and call_args[0] in skipped_args_dict.keys(): - if type(skipped_args_dict[call_args[0]])==str and skipped_args_dict[call_args[0]] in call_args[1]: + if type(skipped_args_dict[call_args[0]]) is str and skipped_args_dict[call_args[0]] in call_args[1]: continue - elif type(skipped_args_dict[call_args[0]])==list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} + elif type(skipped_args_dict[call_args[0]]) is list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} continue if arg.split("=")[0] in function_pars: args_out.append(arg) From e89588a43d1da7e95423f6a7d1b1827519c483b9 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 13:08:40 +0200 Subject: [PATCH 269/341] Added warning if testpackage changes --- testpackage/testpackage_get_diff.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 3317457c..245bae60 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,6 +1,6 @@ #from testpackage_helper import system_call from create_env import system_call - +import logging git_diff=system_call('git diff --name-only origin/image_compare...').split('\n') #Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). @@ -37,6 +37,8 @@ for diff_line in git_diff: for key,val in file_checks.items(): if key.lower() in diff_line.lower(): + if key.lower() == 'testpackage_': + logging.warning('::warning::Something in testpackage has changed, make sure the test is still comparable with current verification_set!') if not val: #run all tests quit() From 1fa31a2359014efa9d7000e4f5f2112db38649eb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 13:47:30 +0200 Subject: [PATCH 270/341] ditto earlier commit --- .github/workflows/test_compare_images.yml | 1 + testpackage/testpackage_get_diff.py | 27 +++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 46f2122f..9c6973a3 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -52,6 +52,7 @@ jobs: module load Python/3.10.4-GCCcore-11.3.0 export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) + cat diff_log.txt echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT echo "$DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 245bae60..9da3cc93 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,7 +1,8 @@ #from testpackage_helper import system_call from create_env import system_call import logging -git_diff=system_call('git diff --name-only origin/image_compare...').split('\n') +branch='image_compare' +git_diff=system_call(f'git diff --name-only origin/{branch}...').split('\n') #Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). #Checking uses 'in' operation, case insensitive @@ -27,28 +28,36 @@ "compare_images.yml":None, "miscellaneous":None, } - #Override if there are many changes as run all tests +logger = logging.getLogger(__name__) +logging.basicConfig(filename="diff_log.txt",level=logging.INFO) +run_all=False +testpackage_check=True if len(git_diff)>6: - quit() + logging.info(f"Multiple ({len(git_diff)}) changes, will run all tests") + run_all=True output=[] - for diff_line in git_diff: for key,val in file_checks.items(): if key.lower() in diff_line.lower(): - if key.lower() == 'testpackage_': - logging.warning('::warning::Something in testpackage has changed, make sure the test is still comparable with current verification_set!') + if 'testpackage_' in key.lower() and testpackage_check: + testpackage_check=False + logging.warning(f'::warning:: Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!') if not val: - #run all tests - quit() + run_all=True elif type(val)==list: output.extend(val) else: output.append(val) -if output: + +if run_all: + quit() +elif output: print(" ".join(output)) else: print("pass") + + From 94fa06e88a6978d1820d0811535c98c0b8c58c2f Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 13:56:49 +0200 Subject: [PATCH 271/341] Added constraint to gen.._verfset script --- testpackage/run_testpackage_generate_verf_set.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index 2831315c..0e976588 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -4,6 +4,7 @@ #SBATCH -p short #SBATCH -n 1 #SBATCH --array=0-10 +#SBATCH --constraint="carrington|ukko" #SBATCH --no-requeue #SBATCH --mem-per-cpu=16000 From 4f64c99d8669ab87ddeb7f02a01eacf49546f2a5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:09:48 +0200 Subject: [PATCH 272/341] Added :: so maybe github recognizes the warning now --- testpackage/testpackage_get_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 9da3cc93..493c8ee5 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -43,7 +43,7 @@ if key.lower() in diff_line.lower(): if 'testpackage_' in key.lower() and testpackage_check: testpackage_check=False - logging.warning(f'::warning:: Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!') + logging.warning(f' ::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!::') if not val: run_all=True elif type(val)==list: From 6b5a3563663715ce4ae3cb198573d74c5c483822 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:21:06 +0200 Subject: [PATCH 273/341] Maybe it finally recognizes? --- testpackage/testpackage_get_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 493c8ee5..e6eca0a6 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -30,7 +30,7 @@ } #Override if there are many changes as run all tests logger = logging.getLogger(__name__) -logging.basicConfig(filename="diff_log.txt",level=logging.INFO) +logging.basicConfig(format='%(message)s',filename="diff_log.txt",level=logging.INFO) run_all=False testpackage_check=True if len(git_diff)>6: From 564814c8d3db0e22e4f3d7d9f608afcb4eef9709 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:23:51 +0200 Subject: [PATCH 274/341] Why is git being like this, maybe htis time the file changed finally --- testpackage/testpackage_get_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index e6eca0a6..ab8e8dbe 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -43,7 +43,7 @@ if key.lower() in diff_line.lower(): if 'testpackage_' in key.lower() and testpackage_check: testpackage_check=False - logging.warning(f' ::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!::') + logging.warning(f'::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!::') if not val: run_all=True elif type(val)==list: From 3d65143c1e2fc707418f64b2bf412a84f21e89af Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:30:48 +0200 Subject: [PATCH 275/341] Fixed run_compare not taking pass correctly --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index c2fd1551..87eb4153 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -24,7 +24,7 @@ module list verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" #if pass we do not check for anything -if echo $@ | grep -q -P "\spass$|\spass\s"; then +if echo $@ | grep -q -P "\spass$|\spass\s|pass"; then exit 0 fi From 6ffe5b411eee57fc54c9e91777f34558d807d5d4 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:39:32 +0200 Subject: [PATCH 276/341] Added latex :) --- testpackage/run_testpackage_generate_verf_set.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index 2831315c..1cc279bb 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -13,6 +13,7 @@ index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) hostname source CI_env/bin/activate +export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH export PTNONINTERACTIVE=1 export PTOUTPUTDIR=$1 From dc1d0d82e720418762eea1dab0dbf340bc8cf0ff Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 14:57:24 +0200 Subject: [PATCH 277/341] Cleaned up imports from commons.py and added exception Exception since apparently bare exception = bad --- testpackage/testpackage_commons.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index b8732220..46f5be70 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -1,10 +1,6 @@ import analysator as pt -import sys, os -import numpy as np +import os import traceback -import inspect -import logging -import re import argparse from testpackage_template_maker import call_replace @@ -227,7 +223,7 @@ def source_file_name(filename,fileLocation,time): #try to import the list of calls corresponding to the function to be tested. Skip if not found try: exec(f'import testpackage_definitions.testpackage_{func} as testpackage_{func}') - except: + except Exception: raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the correct folder") @@ -235,7 +231,7 @@ def source_file_name(filename,fileLocation,time): for call_list in ["restartcalls","nonrestartcalls","multipopcalls","v5restartcalls","v5nonrestartcalls","v5multipopcalls"]: try: exec(f'{call_list}=testpackage_{func}.{call_list}') - except: + except Exception: exec(f'{call_list}=[]') skipped_args=run['skipped_args'] From 84678156bbee8d8669c4a853ff17ca7421ac9d76 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 15:00:45 +0200 Subject: [PATCH 278/341] Better exception handling and warning for testpackage_commons --- testpackage/testpackage_commons.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 46f5be70..4e5417c0 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -223,15 +223,16 @@ def source_file_name(filename,fileLocation,time): #try to import the list of calls corresponding to the function to be tested. Skip if not found try: exec(f'import testpackage_definitions.testpackage_{func} as testpackage_{func}') - except Exception: - raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the correct folder") + except Exception as e: + raise IOError(f"testpackage_{func} could not be imported, check that the file exists and is in the correct folder! \n Error message:"+str(e)) #Get the list of calls from the imported file, set list to empty list if list not foud in the file for call_list in ["restartcalls","nonrestartcalls","multipopcalls","v5restartcalls","v5nonrestartcalls","v5multipopcalls"]: try: exec(f'{call_list}=testpackage_{func}.{call_list}') - except Exception: + except Exception as e: + print(f"::warning::Error trying to get call list:\n {str(e)}") exec(f'{call_list}=[]') skipped_args=run['skipped_args'] From 79b24b7acb60c4f5c4dfd4839c490fbf4fb85b34 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 15:10:59 +0200 Subject: [PATCH 279/341] Formatting changes for commons --- testpackage/testpackage_commons.py | 31 +++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4e5417c0..e8b6cd67 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -40,7 +40,8 @@ def source_file_name(filename,fileLocation,time): 'verifydir': '/ABC/', 'fileLocation': datalocation+'/2D/ABC/bulk/', 'fluxLocation': datalocation+'/2D/ABC/flux/', - 'skipped_args':{'plot_vdf':{'step':''},'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}, + 'skipped_args':{'plot_vdf':{'step':''}, + 'plot_vdf_profiles':{'bpara':'','bperp':'','step':''}, 'plot_vdfdiff':{'filedir':'','bpara':'','bperp':''}}, 'funcs': ['plot_colormap','plot_vdf','plot_vdf_profiles','plot_vdfdiff'], 'pops': ['avgs'], @@ -73,7 +74,8 @@ def source_file_name(filename,fileLocation,time): 'funcs': ['plot_colormap3dslice','plot_ionosphere','plot_isosurface'], 'pops': ['avgs'], 'time': 1000, - 'skipped_args':{'plot_ionosphere':{"var":["ig_z","ig_p","ig_source","ig_residual"]},'ALL':{'expression':''}}, #ig_zz and ig_pp is also skipped on purpose + 'skipped_args':{'plot_ionosphere':{"var":["ig_z","ig_p","ig_source","ig_residual"]}, + 'ALL':{'expression':''}}, #ig_zz and ig_pp is also skipped on purpose 'singletime': False, 'filename': None, #restart file 'manualcall':False, @@ -175,12 +177,23 @@ def source_file_name(filename,fileLocation,time): 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) #First arg in tuple is the one that needs to be there, second etc can be there without the first -required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], - "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], - "plot_vdfdiff":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step"),'vlsvobj','filename'],None)], - "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step"),'vlsvobj','filename'],None)] - +required_args = { + "plot_vdf": [ + (["coordre", "coordinates", "cellids"], ["coordre=REPLACECOORDRE"]), + ([("filedir", "step"), "vlsvobj", "filename"], None), + ], + "plot_vdf_profiles": [ + (["coordre", "coordinates", "cellids"], ["coordre=REPLACECOORDRE"]), + ([("filedir", "step"), "vlsvobj", "filename"], None), + ], + "plot_vdfdiff": [ + (["coordre", "coordinates", "cellids"], ["coordre=REPLACECOORDRE"]), + ([("filedir", "step"), "vlsvobj", "filename"], None), + ], + "plot_isosurface": [ + ([("surf_step", "surf_var")], ["surf_step=10", "surf_var='vg_rho'"]), + ([("filedir", "step"), "vlsvobj", "filename"], None), + ], } calls = [] @@ -433,7 +446,7 @@ def source_file_name(filename,fileLocation,time): print("END TRACE for call",j,"\n----------------------------") #This is here so get_job_error can get the error from the call. # note that we could also raise the error but then execution of subsequent calls would stop - if not "nooverwrite" in call: + if "nooverwrite" not in call: print("EXIT_CODE_FROM_JOB 1") From 8e7f965d73cf4d092f076e240266c8df83281e4e Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 15:26:38 +0200 Subject: [PATCH 280/341] slight restructuring adjustments --- testpackage/testpackage_commons.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index e8b6cd67..4d3dda83 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -440,14 +440,14 @@ def source_file_name(filename,fileLocation,time): exec(call) except Exception as e: - print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) - - traceback.print_exc() - print("END TRACE for call",j,"\n----------------------------") #This is here so get_job_error can get the error from the call. # note that we could also raise the error but then execution of subsequent calls would stop - if "nooverwrite" not in call: + if "nooverwrite" not in call: print("EXIT_CODE_FROM_JOB 1") + print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) + + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") From 24cbd3acd3cc3349981b43e14385f85c532000a5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 15:48:38 +0200 Subject: [PATCH 281/341] Removed the warning from exec call_list since it's misleading in a log --- testpackage/testpackage_commons.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 4d3dda83..2181442b 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -244,8 +244,7 @@ def source_file_name(filename,fileLocation,time): for call_list in ["restartcalls","nonrestartcalls","multipopcalls","v5restartcalls","v5nonrestartcalls","v5multipopcalls"]: try: exec(f'{call_list}=testpackage_{func}.{call_list}') - except Exception as e: - print(f"::warning::Error trying to get call list:\n {str(e)}") + except Exception: exec(f'{call_list}=[]') skipped_args=run['skipped_args'] From e86d16778ba8db28c1b3a8d1370ec190871f1ecb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Dec 2025 15:52:01 +0200 Subject: [PATCH 282/341] Added clarifying comment to import call --- .../testpackage_definitions/testpackage_plot_colormap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap.py b/testpackage/testpackage_definitions/testpackage_plot_colormap.py index afd58c1c..7a713817 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap.py @@ -1,4 +1,4 @@ -import testpackage_custom_expr as cexp +import testpackage_custom_expr as cexp #importing this, even unused, is required for usage in testpackage_commons.py restartcalls = [ From 0cf0711cc27a68cd06dded3d8341a952633e8993 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Tue, 16 Dec 2025 10:50:11 +0200 Subject: [PATCH 283/341] commented experssion call from template maker out --- testpackage/testpackage_template_maker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 6fb5e92e..44efa6cf 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -539,7 +539,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_parallel')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta_perpendicular')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" + # "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[14,0],pass_vars=['vg_rho'])" ]) From ab433135e8af5f410b53476afea319d0768d2958 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 10:40:57 +0200 Subject: [PATCH 284/341] Added clarifying prints --- .github/workflows/test_compare_images.yml | 2 +- testpackage/run_compare.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 46f2122f..819a52ab 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -53,7 +53,7 @@ jobs: export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT - echo "$DIFFRESULT" + echo "Comparing $DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT cat testpackage_run.txt diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 87eb4153..44d9d777 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -29,14 +29,15 @@ if echo $@ | grep -q -P "\spass$|\spass\s|pass"; then fi check=true - +verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') +echo "Comparing against $verfset" #Note that this is skipped if no arguments are passed for i in $@ do check=false echo "Comparing for $i" #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/$i/" + folder_1="$verf_loc/$verfset/$i/" folder_2="${PWD}/produced_plots/$i/" python3 ./testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" echo "EXIT_CODE_FROM_JOB $?" @@ -45,7 +46,7 @@ done if $check; then echo "Comparing all" - folder_1="$verf_loc/$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')/" + folder_1="$verf_loc/$verfset/" folder_2="${PWD}/produced_plots/" python3 ./testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" echo "EXIT_CODE_FROM_JOB $?" From e07638de9335f12b32105c96fe95402aae0a482c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 10:52:18 +0200 Subject: [PATCH 285/341] added lockfile so compare doesnt compare incomplete verfset --- .github/workflows/generate_reference_plots.yml | 3 ++- testpackage/run_compare.sh | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index 8f3e5d6e..be5ead12 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -42,10 +42,11 @@ jobs: . CI_env/bin/activate DATAPATH="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets/$(git rev-parse HEAD)" + touch $DATAPATH/.lockfile mkdir $DATAPATH sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH cat testpackage_gen_verf.txt python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt - + rm $DATAPATH/.lockfile diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 44d9d777..aeae7256 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -30,6 +30,10 @@ fi check=true verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') +if [[ -f $verf_loc/$verfset/.lockfile ]]; then + echo ".lockfile found in $verf_loc/$verfset, not comparing" + exit(1) +fi echo "Comparing against $verfset" #Note that this is skipped if no arguments are passed for i in $@ From f5bf034ab9d5dc9e3b5fde55a05259f61e6463d6 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 11:01:56 +0200 Subject: [PATCH 286/341] Better wording on print --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 819a52ab..16b35796 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -53,7 +53,7 @@ jobs: export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT - echo "Comparing $DIFFRESULT" + echo "Running $DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT cat testpackage_run.txt From 1837a9d65991aef963892aa542ab8fe41759d2d1 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 11:10:01 +0200 Subject: [PATCH 287/341] better lockfile failing --- .github/workflows/test_compare_images.yml | 7 ++++++- .github/workflows/test_compare_images_full.yml | 7 ++++++- testpackage/run_compare.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 16b35796..59ed3447 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -50,7 +50,12 @@ jobs: export TMPDIR=$RUNNER_TEMP module purge module load Python/3.10.4-GCCcore-11.3.0 - + verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" + verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') + if [[ -f $verf_loc/$verfset/.lockfile ]]; then + echo ".lockfile found in $verf_loc/$verfset, not running test" + exit(1) + fi export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT echo "Running $DIFFRESULT" diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index bc03efe3..ee08b8fb 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -48,7 +48,12 @@ jobs: export TMPDIR=$RUNNER_TEMP module purge module load Python/3.10.4-GCCcore-11.3.0 - + verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" + verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') + if [[ -f $verf_loc/$verfset/.lockfile ]]; then + echo ".lockfile found in $verf_loc/$verfset, not running test" + exit(1) + fi sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh cat testpackage_run.txt diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index aeae7256..2832d520 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -31,7 +31,7 @@ fi check=true verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then - echo ".lockfile found in $verf_loc/$verfset, not comparing" + echo ".lockfile found in $verf_loc/$verfset, not comparing, something probably went wrong removing the lockfile" exit(1) fi echo "Comparing against $verfset" From 88024d11dcef26fda90e8aa2390f1eb00ae790e2 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 14:06:52 +0200 Subject: [PATCH 288/341] Fix exit code syntax in workflow script --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 59ed3447..44ecb017 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -54,7 +54,7 @@ jobs: verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then echo ".lockfile found in $verf_loc/$verfset, not running test" - exit(1) + exit 1 fi export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT From e48033dee62ca9efb9680f92c132b5929b7ce84f Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 14:07:08 +0200 Subject: [PATCH 289/341] Fix exit status syntax in run_compare.sh --- testpackage/run_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 2832d520..4ae92c31 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -32,7 +32,7 @@ check=true verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then echo ".lockfile found in $verf_loc/$verfset, not comparing, something probably went wrong removing the lockfile" - exit(1) + exit 1 fi echo "Comparing against $verfset" #Note that this is skipped if no arguments are passed From ace1aa5e169e794d98456482d7ef9585c4173238 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 14:07:43 +0200 Subject: [PATCH 290/341] fixed exit syntax in full workflow --- .github/workflows/test_compare_images_full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index ee08b8fb..1adb0bd5 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -52,7 +52,7 @@ jobs: verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then echo ".lockfile found in $verf_loc/$verfset, not running test" - exit(1) + exit 1 fi sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh From 9b1a90a314cdfc4478835f7e0fa09f08b747b134 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 15:11:34 +0200 Subject: [PATCH 291/341] Ensure lockfile is created after DATAPATH directory --- .github/workflows/generate_reference_plots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index be5ead12..b3535c8a 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -42,8 +42,8 @@ jobs: . CI_env/bin/activate DATAPATH="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets/$(git rev-parse HEAD)" - touch $DATAPATH/.lockfile mkdir $DATAPATH + touch $DATAPATH/.lockfile sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH cat testpackage_gen_verf.txt From 695f00c931f1209f1f4c6993219aacd07199926c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 15:38:56 +0200 Subject: [PATCH 292/341] Added hostname to run_compare.sh So we know what nodes it runs on --- testpackage/run_compare.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 4ae92c31..467c083d 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -13,6 +13,7 @@ jobcount=$(( $SLURM_ARRAY_TASK_MAX - $SLURM_ARRAY_TASK_MIN + 1 )) index=$(( $SLURM_ARRAY_TASK_ID - $SLURM_ARRAY_TASK_MIN )) +hostname module purge module load Python/3.10.4-GCCcore-11.3.0 From b0bf0751c661fe484d19b65b54dd3396f48e8dc5 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 16:34:17 +0200 Subject: [PATCH 293/341] Added more verbose printing upon finding .lockfile, edited the workflow header comment --- .github/workflows/test_compare_images.yml | 6 ++---- .github/workflows/test_compare_images_full.yml | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index bc67d067..148060bc 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -1,6 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - +# This workflow will install Python dependencies and analysator, run the analysator testpackage based on git diff and compare the images name: Turso compare selectively images on: @@ -53,7 +51,7 @@ jobs: verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then - echo ".lockfile found in $verf_loc/$verfset, not running test" + echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation." exit 1 fi export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index 1adb0bd5..8068817c 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -1,5 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python +#This workflow will install python and run the full analysator testpackage with image comparison for the results name: Turso compare all images @@ -51,7 +50,7 @@ jobs: verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then - echo ".lockfile found in $verf_loc/$verfset, not running test" + echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation." exit 1 fi sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh From b881c853d58995995ec07beace847a29eb5808bd Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 16:44:10 +0200 Subject: [PATCH 294/341] Revise workflow description for clarity --- .github/workflows/generate_reference_plots.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/generate_reference_plots.yml b/.github/workflows/generate_reference_plots.yml index b3535c8a..f5e54f53 100644 --- a/.github/workflows/generate_reference_plots.yml +++ b/.github/workflows/generate_reference_plots.yml @@ -1,6 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - +# This workflow will install Python dependencies , analysator and generate verification set to /wrk-kappa/group/spacephysics/analysator/CI/verification_sets/ under new folder based on commit id name: generate_reference_data on: From 8def1f32bac87d1983c5b05fb4a1ef53106ddb3c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 16:47:41 +0200 Subject: [PATCH 295/341] Removed useless concurrency that was based on pullrequests --- .github/workflows/test_compare_images_full.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index fe2c8291..b36ace3a 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -9,10 +9,6 @@ on: - cron: '0 8 * * MON' workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - jobs: From ea6d5e07fac3c0511d51f64d5785f46a42d5ba98 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 16:58:37 +0200 Subject: [PATCH 296/341] updated plot_vdfdiff if statement, variable changed to correct one Changed step to step_diff --- analysator/pyPlots/plot_vdfdiff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysator/pyPlots/plot_vdfdiff.py b/analysator/pyPlots/plot_vdfdiff.py index 43e865ab..c81bfdb4 100644 --- a/analysator/pyPlots/plot_vdfdiff.py +++ b/analysator/pyPlots/plot_vdfdiff.py @@ -201,7 +201,7 @@ def plot_vdfdiff(filename1=None, filename2=None, vlsvReader2=pt.vlsvfile.VlsvReader(filename2) elif vlsvobj2 is not None: vlsvReader2=vlsvobj2 - elif ((filedir is not None) and (step is not None)): + elif ((filedir is not None) and (step_diff is not None)): filename = glob.glob(filedir+'bulk*'+str(step_diff).rjust(7,'0')+'.vlsv')[0] vlsvReader2=pt.vlsvfile.VlsvReader(filename) else: From 2b4bdaf7e1b2718711e44685abef0e1b591a9882 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 17:00:43 +0200 Subject: [PATCH 297/341] removed old comments from run_testpackage_workflow.sh --- testpackage/run_testpackage_workflow.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index ff2495d1..b5eb09ce 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -20,7 +20,6 @@ hostname module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH module load Python/3.10.4-GCCcore-11.3.0 -#module load ImageMagick/7.1.0-37-GCCcore-11.3.0 echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT @@ -36,6 +35,4 @@ export PTOUTPUTDIR=$PWD/produced_plots/ python ./testpackage/testpackage_commons.py $jobcount $index $@ -#python ./testpackage/color_small_test.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" -#echo Job $SLURM_ARRAY_TASK_ID complete. From fdb734f99df004514b5de7b52bac429b8c48107d Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:06:01 +0200 Subject: [PATCH 298/341] Removed old comments and added little comments to testpackage_commons.py --- testpackage/testpackage_commons.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 2181442b..46482979 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -30,11 +30,9 @@ def source_file_name(filename,fileLocation,time): if "pass" in funcs_to_use: quit() -#datalocation = "/wrk-vakka/group/spacephysics/vlasiator" datalocation = "/wrk-kappa/group/spacephysics/analysator/CI/analysator-test-data/vlasiator" runs = [] -#Change this to make it produce same plots as testpackage_vdf and testpackage_colormap used to do runs.append( { 'name': 'ABC', 'verifydir': '/ABC/', @@ -209,8 +207,8 @@ def source_file_name(filename,fileLocation,time): v5nonrestartcalls=None v5multipopcalls=None +#Prepare the call list for i,run in enumerate(runs): - # bulk and restart files vlasiator5 = run['vlasiator5'] filename = run['filename'] fileLocation = run['fileLocation'] @@ -218,9 +216,6 @@ def source_file_name(filename,fileLocation,time): nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] -# if run['name']!='FID': -# continue - if not funcs_to_use: functions = run['funcs'] @@ -233,7 +228,7 @@ def source_file_name(filename,fileLocation,time): for j,func in enumerate(functions): callindex = 0 - #try to import the list of calls corresponding to the function to be tested. Skip if not found + #try to import the list of calls corresponding to the function to be tested. try: exec(f'import testpackage_definitions.testpackage_{func} as testpackage_{func}') except Exception as e: @@ -410,6 +405,7 @@ def source_file_name(filename,fileLocation,time): bulkname = "distributions."+str(100).rjust(7,'0')+".vlsv" time=100 + #Special case for plot_vdfdiff, we need another .vlsv file for it if func == 'plot_vdfdiff': time_offset=10 bulkname_vdfdiff = source_file_name(filename,fileLocation,time-time_offset) From 28d50931d2163bf6c8acab6deacbf83c55573945 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:27:41 +0200 Subject: [PATCH 299/341] Multiline comment broke the template maker, removed that and added figsize to required args for plot_vdf. Also uncommented the AMR and cb_horziontal call --- testpackage/testpackage_template_maker.py | 42 ++++------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index 44efa6cf..c7154d10 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -92,9 +92,9 @@ def call_replace(call,func,skipped_args,required_args=required_args): #required args for functions, lists are handled as OR statements, tuples within lists as AND #list of tuples, first element is the list of required arguments and second is the defaults if argument is not found, leaving it as None skips defaults - + #tuples inside inner list [(arg1,arg2,..),..] means that for arg1 to be present arg2 has to be present required_args ={ - "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None])], + "plot_vdf":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[None]),("figsize","figsize=[5,4]")], "plot_vdf_profiles":[(["coordre","coordinates","cellids"],["coordre=REPLACECOORDRE"]),([("filedir","step")],[""])], "plot_isosurface":[([("surf_step","surf_var")],["surf_step=10","surf_var='vg_rho'"]),([("filedir","step")],[""])] @@ -155,7 +155,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): # title, axes, noborders - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\mathcal{Color}$')", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title=r'$\\mathcal{Title}$ and so forth $\odot$', cbtitle=r'$\\mathcal{Color}$')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noborder=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, title='',cbtitle='',noxlabels=1)", @@ -253,13 +253,9 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='bwr')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, colormap='PuOr')", - #colorbar - #not yet in in master see PR #359 - #"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", - #AMR, fsaved - #Does not work currently, fix for the AMR contour is in PR #364 - #"pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1"), + "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fsaved='red')", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=1)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, fluxrope=0.5)", @@ -316,17 +312,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1,vscale=1e9)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='B', op='y', colormap='bwr',symlog=1e-3,vscale=1e9)", - ''' - # Externals and expressions - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['rho','B','beta'])", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['va'], vmin=1, vmax=20,lin=1,usesci=0)", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", - - # Everything at once - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - ''' # Streamlines, vectors "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='B')", @@ -442,21 +428,6 @@ def call_replace(call,func,skipped_args,required_args=required_args): "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='y', colormap='PuOr',symlog=0, usesci=0)", "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_v', op='z', colormap='PuOr',symlog=0, usesci=0)", - ''' - # Externals and expressions - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, pass_vars=['vg_rho','vg_b_vol','vg_beta'])", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, pass_vars=['vg_va'], vmin=1, vmax=20,lin=1,usesci=0)", - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, expression=exprMA_cust, boxre=[0,30,-15,15], vmin=1, vmax=20,lin=1,usesci=0)", #why error with plot3d? keyeerror vg_va - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3, pass_vars=['vg_rho','vg_b_vol','vg_beta'],lin=1,colormap='bwr',usesci=0)", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=expr_cav_cust, pass_times=3,lin=1,colormap='bwr',usesci=0, boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_rho'], boxre=[0,30,-15,15])", - "pt.plot.REPLACEFUNC(filename=fileLocation+bulkname, run=verifydir+REPLACEINDEX, expression=timesmooth, pass_times=[7,0], pass_vars=['vg_beta'])", - - - # Everything at once - "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, external=extcontour, boxre=[0,30,-15,15], expression=exprMA_cust, vmin=1, vmax=20,lin=1,usesci=0, fsaved=1, fluxfile=fluxLocation+fluxname)", - ''' # Streamlines, vectors "pt.plot.REPLACEFUNC(vlsvobj=f, run=verifydir+REPLACEINDEX, vectors='vg_v',vectorsize=1,vectordensity=200)", @@ -652,7 +623,7 @@ def call_replace(call,func,skipped_args,required_args=required_args): restart_replace=True for call in calls_in: - call=call_replace(call,func,skipped_args) + call=call_replace(call,func,skipped_args,required_args) if not call: continue @@ -668,7 +639,6 @@ def call_replace(call,func,skipped_args,required_args=required_args): calls_in[:]=temp_list - with open(f"testpackage_{func}.py","w") as f: f.write("nonrestartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[0]])+"]\n\n") f.write("restartcalls=["+',\n'.join(['"{}"'.format(call) for call in copy_of_lists[1]])+"]\n\n") From f74c3b43c9f0c337498391f32c2330fdb1e302c4 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:30:17 +0200 Subject: [PATCH 300/341] Added figsize to required args for good measure as that is needed for consistent plot sizes for comparison --- testpackage/testpackage_commons.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 46482979..b3103ee9 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -179,6 +179,7 @@ def source_file_name(filename,fileLocation,time): "plot_vdf": [ (["coordre", "coordinates", "cellids"], ["coordre=REPLACECOORDRE"]), ([("filedir", "step"), "vlsvobj", "filename"], None), + (["figsize"],["figsize=[5,3]"]) ], "plot_vdf_profiles": [ (["coordre", "coordinates", "cellids"], ["coordre=REPLACECOORDRE"]), From 0006b106017815bfd61aa31c1d781a328a532820 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:32:00 +0200 Subject: [PATCH 301/341] Removed manualcall from the run dictionaries as that was leftover from some previous version --- testpackage/testpackage_commons.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index b3103ee9..becd694a 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -76,7 +76,6 @@ def source_file_name(filename,fileLocation,time): 'ALL':{'expression':''}}, #ig_zz and ig_pp is also skipped on purpose 'singletime': False, 'filename': None, #restart file - 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) @@ -91,7 +90,6 @@ def source_file_name(filename,fileLocation,time): 'skipped_args':{'ALL':{'expression':''}}, 'singletime': False, 'filename': None, #restart file - 'manualcall':False, 'nosubpops': True, # backstreaming / non-backstreaming 'vlasiator5': True, 'cavitonparams': [6.6e6,2.64e6,4.e-9,10] } ) @@ -120,7 +118,6 @@ def source_file_name(filename,fileLocation,time): 'singletime': True, # neighboring bulk files not available 'time': 1361, 'skipped_args':{'plot_vdf':{'step':''}}, - 'manualcall':False, 'vlasiator5': False, 'nosubpops': False, # thermal / non-thermal 'filename': 'restart.0001361.vlsv', @@ -134,7 +131,6 @@ def source_file_name(filename,fileLocation,time): 'pops': ['proton'], 'skipped_args':None, 'time': 380, - 'manualcall':False, 'singletime': True, # neighboring bulk files not available 'filename': None, 'vlasiator5': True, @@ -151,7 +147,6 @@ def source_file_name(filename,fileLocation,time): 'fluxLocation': None, 'singletime': True, # neighboring bulk files not available 'time': 1126, - 'manualcall':False, 'skipped_args':{'plot_vdf':{'step':''}}, 'nosubpops': False, # thermal / non-thermal 'vlasiator5': False, @@ -169,7 +164,6 @@ def source_file_name(filename,fileLocation,time): 'time': 2000, 'singletime': False, 'filename': None, - 'manualcall':False, 'nosubpops': False, # backstreaming / non-backstreaming 'vlasiator5': False, 'cavitonparams': [2.0e6,0.8e6,4.e-9,10] } ) From c980fbe90bc9ae5cf9d19808c2fff4ea647622fb Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:47:46 +0200 Subject: [PATCH 302/341] Added cb_horizontal to plot calls where it is and added AMR plotting call for colormap3dslice --- .../testpackage_definitions/testpackage_plot_colormap.py | 8 ++++++-- .../testpackage_plot_colormap3dslice.py | 6 +++++- .../testpackage_plot_ionosphere.py | 1 + .../testpackage_plot_isosurface.py | 8 ++++++-- .../testpackage_definitions/testpackage_plot_vdf.py | 3 ++- .../testpackage_definitions/testpackage_plot_vdfdiff.py | 4 +++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap.py b/testpackage/testpackage_definitions/testpackage_plot_colormap.py index 7a713817..44a1e02d 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap.py @@ -217,7 +217,9 @@ "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vBeamRatio')", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')"] +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +] multipopcalls = [ @@ -475,7 +477,9 @@ "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", # "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeam',lin=1)", # "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeamRatio')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_gyrotropy')"] +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_gyrotropy')", +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +] v5multipopcalls = [ "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='REPLACEPOP/vg_v_parallel', op='magnitude',lin=1)", diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index 66c84b40..d9e79259 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -188,7 +188,9 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vBeamRatio')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", -"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')"] +"pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" + ] restartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] @@ -323,6 +325,8 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX,amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" #"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] ] diff --git a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py index 185b50fe..861a4da0 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py +++ b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py @@ -78,6 +78,7 @@ "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_pp')", "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_z')", "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_zz')", +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" ] diff --git a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py index 2d9e9197..8b9b5d5b 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py +++ b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py @@ -65,7 +65,9 @@ "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,boxre=[0,30,-15,15])", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=0.1,vmax=10)", -"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0.5,vmax=1.5,usesci=0)"] +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0.5,vmax=1.5,usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" + ] restartcalls=[] @@ -76,7 +78,9 @@ v5nonrestartcalls=["pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='nipy_spectral',vscale=1e9)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1,vscale=1e-3)", -"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr',symlog=0,usesci=0)"] +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr',symlog=0,usesci=0)", +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +] v5multipopcalls=[] diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdf.py b/testpackage/testpackage_definitions/testpackage_plot_vdf.py index 2d9aa5b4..adca92de 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdf.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdf.py @@ -245,7 +245,8 @@ "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bpara=1,coordswap=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1, coordre=REPLACECOORDRE)", "pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, bperp=1,coordswap=1, coordre=REPLACECOORDRE)", -"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)" +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, normal=[1,1,1],normalx=[1,-1,0],coordre=REPLACECOORDRE)", +"pt.plot.plot_vdf(figsize=[5,4],vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True,coordre=REPLACECOORDRE)", ] multipopcalls = [ diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py index 82d8b002..32c7a570 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py @@ -90,7 +90,9 @@ "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='inferno_r',coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='magma_r',coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='plasma_r',coordre=REPLACEMULTIPLECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='viridis_r',coordre=REPLACEMULTIPLECOORDRE)"] +"pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='viridis_r',coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj=f, vlsvobj2=g,run=verifydir+REPLACEINDEX, cb_horizontal=True,coordre=REPLACEMULTIPLECOORDRE)", + ] restartcalls=[] From 40ce31f3b672d342569c5c87f53e0d48fe3a7964 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 17:57:54 +0200 Subject: [PATCH 303/341] Moved the call_replace and system_call to testpackage_helpers.py for better structure --- testpackage/create_env.py | 21 +----- testpackage/testpackage_commons.py | 2 +- testpackage/testpackage_get_diff.py | 3 +- testpackage/testpackage_helpers.py | 92 +++++++++++++++++++++++ testpackage/testpackage_template_maker.py | 73 +----------------- 5 files changed, 96 insertions(+), 95 deletions(-) create mode 100644 testpackage/testpackage_helpers.py diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 0642d792..888e959b 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -1,29 +1,10 @@ import os import venv -import subprocess +from testpackage_helpers import system_call from sys import version_info as python_version_info from sys import version as python_version import argparse - - -def system_call(cmd,live_output=False): - with subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) as proc: - if live_output: - for line in proc.stdout: - print(str(line,'utf-8').rstrip('\n')) #Note that for example pip's progress bar is not displayed - - out,err = proc.communicate() - - - #If errors, raise an exception - if proc.returncode!=0: - err = str(err,'utf-8') - raise RuntimeError(err) - - out = str(out,'utf-8').rstrip('\n') - return out - def create_venv(path,install_analysator=True,editable=False): virt_env= venv.EnvBuilder(with_pip=True,upgrade_deps=True) context=virt_env.ensure_directories(path) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index becd694a..88dcf6fa 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -2,7 +2,7 @@ import os import traceback import argparse -from testpackage_template_maker import call_replace +from testpackage_helpers import call_replace def source_file_name(filename,fileLocation,time): if filename is None: diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 5d176d66..5924dd6c 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,5 +1,4 @@ -#from testpackage_helper import system_call -from create_env import system_call +from testpackage_helpers import system_call import logging branch='image_compare' git_diff=system_call(f'git diff --name-only origin/{branch}...').split('\n') diff --git a/testpackage/testpackage_helpers.py b/testpackage/testpackage_helpers.py new file mode 100644 index 00000000..ad37ec43 --- /dev/null +++ b/testpackage/testpackage_helpers.py @@ -0,0 +1,92 @@ +import subprocess +import analysator as pt #this import is used, see the function_pars +import inspect +import re + +def system_call(cmd,live_output=False): + with subprocess.Popen(cmd.split(" "),stdout=subprocess.PIPE,stderr=subprocess.PIPE) as proc: + if live_output: + for line in proc.stdout: + print(str(line,'utf-8').rstrip('\n')) #Note that for example pip's progress bar is not displayed + + out,err = proc.communicate() + + + #If errors, raise an exception + if proc.returncode!=0: + err = str(err,'utf-8') + raise RuntimeError(err) + + out = str(out,'utf-8').rstrip('\n') + return out + +def call_replace(call,func,skipped_args,required_args): + #This is kind of scuffed maybe + + call=call.replace('REPLACEFUNC',func) + + #Get the arguments of the call + args = re.search(r'\((.+)\)',call).group(1) + args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] + named_parameters=[arg.split("=")[0] for arg in args] + #Get parameters of the func + function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args + #Remove args that are not present as parameters for the func + args_out=[] + + #check that all required func args are set + if required_args and func in required_args.keys(): + for required_tuple in required_args[func]: + required_params=required_tuple[0] + default_params=required_tuple[1] + + check=False + for param in required_params: + if type(param) is tuple and param[0] not in named_parameters: + check=True + elif any((all(r in named_parameters for r in param),(param in named_parameters))): + if not skipped_args or func not in skipped_args or not any(r in skipped_args[func].keys() for r in param): + check=True + break + if not check: + #Add parameters if there are default_params + if default_params: + if type(default_params) is str: + default_params=[default_params] + for param in default_params: + if param not in named_parameters: + args_out.append(param) + else: + return None + + + #skip args if there are skipped args and append if called arg in function_pars + for arg in args: + if arg: + if skipped_args: + if func in skipped_args.keys(): + skipped_args_dict=skipped_args[func] + elif 'ALL' in skipped_args.keys(): + skipped_args_dict=skipped_args['ALL'] + else: + skipped_args_dict=False + call_args=arg.split("=") + if skipped_args_dict and call_args[0] in skipped_args_dict.keys(): + if type(skipped_args_dict[call_args[0]]) is str and skipped_args_dict[call_args[0]] in call_args[1]: + continue + elif type(skipped_args_dict[call_args[0]]) is list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} + continue + if arg.split("=")[0] in function_pars: + args_out.append(arg) + #else: + # logging.warning(f"Argument {arg} removed from call {call}") + + if not args_out: + return None + args_out=filter(None,args_out) + call=call[:call.rfind("(")+1]+",".join(args_out)+")" + + return call + + + diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index c7154d10..b3b9d23b 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -1,77 +1,6 @@ import analysator as pt #this import is used, see the function_pars -import inspect -import re import argparse - -required_args=False -def call_replace(call,func,skipped_args,required_args=required_args): - #This is kind of scuffed maybe - - call=call.replace('REPLACEFUNC',func) - - #Get the arguments of the call - args = re.search(r'\((.+)\)',call).group(1) - args = [x[0] or x[1] or x[2] for x in re.findall(r'(\w+=[^,(\[]+)|(\w+=\(.+\))|(\w+=\[.+?\])',args)] - named_parameters=[arg.split("=")[0] for arg in args] - #Get parameters of the func - function_pars=inspect.getfullargspec(eval("pt.plot."+func)).args - #Remove args that are not present as parameters for the func - args_out=[] - - #check that all required func args are set - if required_args and func in required_args.keys(): - for required_tuple in required_args[func]: - required_params=required_tuple[0] - default_params=required_tuple[1] - - check=False - for param in required_params: - if type(param) is tuple and param[0] not in named_parameters: - check=True - elif any((all(r in named_parameters for r in param),(param in named_parameters))): - if not skipped_args or func not in skipped_args or not any(r in skipped_args[func].keys() for r in param): - check=True - break - if not check: - #Add parameters if there are default_params - if default_params: - if type(default_params) is str: - default_params=[default_params] - for param in default_params: - if param not in named_parameters: - args_out.append(param) - else: - return None - - - #skip args if there are skipped args and append if called arg in function_pars - for arg in args: - if arg: - if skipped_args: - if func in skipped_args.keys(): - skipped_args_dict=skipped_args[func] - elif 'ALL' in skipped_args.keys(): - skipped_args_dict=skipped_args['ALL'] - else: - skipped_args_dict=False - call_args=arg.split("=") - if skipped_args_dict and call_args[0] in skipped_args_dict.keys(): - if type(skipped_args_dict[call_args[0]]) is str and skipped_args_dict[call_args[0]] in call_args[1]: - continue - elif type(skipped_args_dict[call_args[0]]) is list and any(arg_skip in call_args[1] for arg_skip in skipped_args_dict[call_args[0]]): #list of args in dict value means OR ex. {'var':["vg_rho","vg_phi"]} - continue - if arg.split("=")[0] in function_pars: - args_out.append(arg) - #else: - # logging.warning(f"Argument {arg} removed from call {call}") - - if not args_out: - return None - args_out=filter(None,args_out) - call=call[:call.rfind("(")+1]+",".join(args_out)+")" - - return call - +from testpackage_helpers import call_replace if __name__=='__main__': From ac8e368b67bedc3e58ca6be0a08655713ceb3272 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 18:11:27 +0200 Subject: [PATCH 304/341] added if statement incase diff_log is not made (could be the case) --- .github/workflows/test_compare_images.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index daf44500..3a1a3dd0 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -53,7 +53,9 @@ jobs: exit 1 fi export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) - cat diff_log.txt + if [[ -f diff_log.txt ]]; then + cat diff_log.txt + done echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT echo "Running $DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT From 05cd142f9f0129180af4167acdc4349fe739fc54 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 18:18:28 +0200 Subject: [PATCH 305/341] Added so the branch to compare to changes on based whether pullrequest is to master or dev --- testpackage/testpackage_get_diff.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 5924dd6c..f1010441 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,6 +1,10 @@ from testpackage_helpers import system_call import logging -branch='image_compare' +import sys +branch=sys.argv[1] +if branch not in ["master","dev"]: + raise SystemError("Pull request target not master or dev, this file should not even be running! Something is likely wrong with the github workflow.") + git_diff=system_call(f'git diff --name-only origin/{branch}...').split('\n') #Dictionary that tells which testpackage runs to run (values) if changes were made to these files (keys). From d6941f2bf8d4750502803c79a21de1654dcfa3c2 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 18:26:40 +0200 Subject: [PATCH 306/341] For whatever reason this was not added on the last commit, thank you git --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 3a1a3dd0..90cb61f5 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -52,7 +52,7 @@ jobs: echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation." exit 1 fi - export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py) + export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py ${{ github.base_ref }}) if [[ -f diff_log.txt ]]; then cat diff_log.txt done From 61f6539550567cb64b2e2100d7dbe23219846b46 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 18:28:25 +0200 Subject: [PATCH 307/341] Bash syntax issues (skill issue) --- .github/workflows/test_compare_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 90cb61f5..6dac5301 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -55,7 +55,7 @@ jobs: export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py ${{ github.base_ref }}) if [[ -f diff_log.txt ]]; then cat diff_log.txt - done + fi echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT echo "Running $DIFFRESULT" sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT From 66871aa468b1c85875279bf551cb274065de8230 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 18:40:40 +0200 Subject: [PATCH 308/341] Changed the AMR call so it would work, it now takes lists, this issue is resolved in #364 --- .../testpackage_definitions/testpackage_plot_colormap3dslice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index d9e79259..54c2dbf9 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -325,7 +325,7 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_parallel')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX,amr=0.1,amrlinestyles='dashed',amrcolours='red',amrlinewidths=1)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX,amr=0.1,amrlinestyles=['dashed'],amrcolours=['red'],amrlinewidths=[1])", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" #"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] ] From 3fff0d294c0b4133a6dfaf25d6676574421a1c05 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Wed, 17 Dec 2025 18:52:50 +0200 Subject: [PATCH 309/341] Change logging file mode to write in order to try to fix warnings --- testpackage/testpackage_get_diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index f1010441..9ea9000d 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -33,7 +33,7 @@ } #Override if there are many changes as run all tests logger = logging.getLogger(__name__) -logging.basicConfig(format='%(message)s',filename="diff_log.txt",level=logging.INFO) +logging.basicConfig(format='%(message)s',filename="diff_log.txt",filemode="w",level=logging.INFO) run_all=False testpackage_check=True if len(git_diff)>6: @@ -46,7 +46,7 @@ if key.lower() in diff_line.lower(): if 'testpackage_' in key.lower() and testpackage_check: testpackage_check=False - logging.warning(f'::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!::') + logging.warning(f'::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!') if not val: run_all=True elif type(val) is list: From 0793e509f0ce9e9321948ad9f4b38bc67ab8d2bd Mon Sep 17 00:00:00 2001 From: lassjsc Date: Wed, 17 Dec 2025 19:06:56 +0200 Subject: [PATCH 310/341] Removed logging in favor of just using open() --- testpackage/testpackage_get_diff.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index 9ea9000d..a0b8224e 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -1,5 +1,4 @@ from testpackage_helpers import system_call -import logging import sys branch=sys.argv[1] if branch not in ["master","dev"]: @@ -31,13 +30,13 @@ "compare_images.yml":None, "miscellaneous":None, } + +f=open("diff_log.txt","w") #Override if there are many changes as run all tests -logger = logging.getLogger(__name__) -logging.basicConfig(format='%(message)s',filename="diff_log.txt",filemode="w",level=logging.INFO) run_all=False testpackage_check=True if len(git_diff)>6: - logging.info(f"Multiple ({len(git_diff)}) changes, will run all tests") + f.write(f"Multiple ({len(git_diff)}) changes, will run all tests\n") run_all=True output=[] @@ -46,7 +45,7 @@ if key.lower() in diff_line.lower(): if 'testpackage_' in key.lower() and testpackage_check: testpackage_check=False - logging.warning(f'::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!') + f.write(f'::warning::Testpackage has changed in the current branch as compared to {branch}, make sure the test is still comparable with current verification_set!\n') if not val: run_all=True elif type(val) is list: @@ -54,7 +53,7 @@ else: output.append(val) - +f.close() if run_all: quit() From 3b40354e3c1aef8bfc2e99f503138108e4424abf Mon Sep 17 00:00:00 2001 From: lassjsc Date: Thu, 18 Dec 2025 10:34:28 +0200 Subject: [PATCH 311/341] Fixed cb_horizontal typo in testpackage definitions --- .../testpackage_definitions/testpackage_plot_colormap.py | 4 ++-- .../testpackage_plot_colormap3dslice.py | 4 ++-- .../testpackage_definitions/testpackage_plot_ionosphere.py | 2 +- .../testpackage_definitions/testpackage_plot_isosurface.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap.py b/testpackage/testpackage_definitions/testpackage_plot_colormap.py index 44a1e02d..13ad2491 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap.py @@ -218,7 +218,7 @@ "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Thermalvelocity',lin=1)", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='Blocks')", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] @@ -478,7 +478,7 @@ # "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeam',lin=1)", # "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_vBeamRatio')", "pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_gyrotropy')", -"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_colormap(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] v5multipopcalls = [ diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index 54c2dbf9..b54e7ce0 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -189,7 +189,7 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] restartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] @@ -326,7 +326,7 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX,amr=0.1,amrlinestyles=['dashed'],amrcolours=['red'],amrlinewidths=[1])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" #"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] ] diff --git a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py index 861a4da0..cb13ae62 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py +++ b/testpackage/testpackage_definitions/testpackage_plot_ionosphere.py @@ -78,7 +78,7 @@ "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_pp')", "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_z')", "pt.plot.plot_ionosphere(vlsvobj=f,run=verifydir+REPLACEINDEX,var='ig_zz')", -"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_ionosphere(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] diff --git a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py index 8b9b5d5b..1452b431 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_isosurface.py +++ b/testpackage/testpackage_definitions/testpackage_plot_isosurface.py @@ -66,7 +66,7 @@ "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,vmin=0.1,vmax=10)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,lin=1,vmin=0.5,vmax=1.5,usesci=0)", -"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] restartcalls=[] @@ -79,7 +79,7 @@ "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='warhol',lin=1,vscale=1e-3)", "pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f,run=verifydir+REPLACEINDEX,colormap='PuOr',symlog=0,usesci=0)", -"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horziontal=True)" +"pt.plot.plot_isosurface(surf_step=10,surf_var='vg_rho',vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" ] v5multipopcalls=[] From 83a85bb6e61ce984ba698412aca4e833af9e3783 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 10:42:08 +0200 Subject: [PATCH 312/341] fixed a typo in testpackage_plot_vdfdiff.py --- testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py index 32c7a570..06d8af67 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py +++ b/testpackage/testpackage_definitions/testpackage_plot_vdfdiff.py @@ -91,7 +91,7 @@ "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='magma_r',coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='plasma_r',coordre=REPLACEMULTIPLECOORDRE)", "pt.plot.plot_vdfdiff(vlsvobj1=f,vlsvobj2=g,run=verifydir+REPLACEINDEX,colormap='viridis_r',coordre=REPLACEMULTIPLECOORDRE)", -"pt.plot.plot_vdfdiff(vlsvobj=f, vlsvobj2=g,run=verifydir+REPLACEINDEX, cb_horizontal=True,coordre=REPLACEMULTIPLECOORDRE)", +"pt.plot.plot_vdfdiff(vlsvobj1=f, vlsvobj2=g,run=verifydir+REPLACEINDEX, cb_horizontal=True,coordre=REPLACEMULTIPLECOORDRE)", ] restartcalls=[] From b46be532d2c3d8a80d69fb1144da55a085b408f6 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 10:43:37 +0200 Subject: [PATCH 313/341] made it so the exception raised with nooverwrite call doesn't call it failure during call as it is supposed to do that. --- testpackage/testpackage_commons.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 88dcf6fa..778a5bbb 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -435,9 +435,12 @@ def source_file_name(filename,fileLocation,time): if "nooverwrite" not in call: print("EXIT_CODE_FROM_JOB 1") - print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) - - traceback.print_exc() - print("END TRACE for call",j,"\n----------------------------") - - + print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) + + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") + elif "nooverwrite" in call: + #Should be same but also doesnt hurt to be exact + print("----------------------------\nNOOVERWRITE CALL SUCCESSFULLY DONE ",j, runname," \n```\n"+call+"```\n", repr(e)) + traceback.print_exc() + print("END TRACE for call",j,"\n----------------------------") From db27fa90ebcfaac62e0c936e4593c948312bf55a Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 11:09:50 +0200 Subject: [PATCH 314/341] Removed unused import and moved analysator import in testpackage_helpers inside call_replace as that's where it is needed although it could also be just removed and checked whether it is imported but if it already is imported it should not cause any issues so this should be fine --- testpackage/testpackage_helpers.py | 2 +- testpackage/testpackage_template_maker.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/testpackage/testpackage_helpers.py b/testpackage/testpackage_helpers.py index ad37ec43..18c68fa6 100644 --- a/testpackage/testpackage_helpers.py +++ b/testpackage/testpackage_helpers.py @@ -1,5 +1,4 @@ import subprocess -import analysator as pt #this import is used, see the function_pars import inspect import re @@ -23,6 +22,7 @@ def system_call(cmd,live_output=False): def call_replace(call,func,skipped_args,required_args): #This is kind of scuffed maybe + import analysator as pt #this import is used, see the function_pars call=call.replace('REPLACEFUNC',func) #Get the arguments of the call diff --git a/testpackage/testpackage_template_maker.py b/testpackage/testpackage_template_maker.py index b3b9d23b..35968240 100644 --- a/testpackage/testpackage_template_maker.py +++ b/testpackage/testpackage_template_maker.py @@ -1,4 +1,3 @@ -import analysator as pt #this import is used, see the function_pars import argparse from testpackage_helpers import call_replace From 359672d82e6c2ea0f15c8a23755d3b3ef15a92f7 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 12:11:51 +0200 Subject: [PATCH 315/341] General comment cleanup and clarifications --- testpackage/create_env.py | 6 ++++-- testpackage/run_compare.sh | 5 +++-- testpackage/run_testpackage_generate_verf_set.sh | 1 - testpackage/testpackage_commons.py | 3 ++- testpackage/testpackage_get_diff.py | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 888e959b..ec865c59 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -51,14 +51,16 @@ def create_venv_script(path,venv_path): #Get used python version and gcc version #note that this may break if the version string format changes - #this is required so that the python module is loaded, otherwise python cannot be called outside the directory the venv is in + #Module load of python is required, otherwise python cannot be called outside the directory the venv is in (if the module system is used) version_info = python_version.split(" ") used_python_version = version_info[0] used_gcc_version = version_info[-1].strip("[]") + + #If module system is used, on HILE use cray-python! f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") - f.write("module list\n") f.write(f"source {venv_path}/bin/activate\n") + f.close() diff --git a/testpackage/run_compare.sh b/testpackage/run_compare.sh index 467c083d..dd3a15f9 100755 --- a/testpackage/run_compare.sh +++ b/testpackage/run_compare.sh @@ -21,7 +21,6 @@ source CI_env/bin/activate module load libglvnd/1.7.0-GCCcore-13.3.0 module list -#verf_loc="/wrk-vakka/turso/group/spacephysics/CI_analysator/analysator_testpackage/verification_sets" verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" #if pass we do not check for anything @@ -30,7 +29,10 @@ if echo $@ | grep -q -P "\spass$|\spass\s|pass"; then fi check=true + +#gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') + if [[ -f $verf_loc/$verfset/.lockfile ]]; then echo ".lockfile found in $verf_loc/$verfset, not comparing, something probably went wrong removing the lockfile" exit 1 @@ -41,7 +43,6 @@ for i in $@ do check=false echo "Comparing for $i" - #gets latest verfication set (based on modification date -> grep directories only -> take firstline -> get last word) folder_1="$verf_loc/$verfset/$i/" folder_2="${PWD}/produced_plots/$i/" python3 ./testpackage/testpackage_compare.py ${folder_1} ${folder_2} $jobcount $index && echo "No differences found in produced images" diff --git a/testpackage/run_testpackage_generate_verf_set.sh b/testpackage/run_testpackage_generate_verf_set.sh index f077967b..39f274b9 100644 --- a/testpackage/run_testpackage_generate_verf_set.sh +++ b/testpackage/run_testpackage_generate_verf_set.sh @@ -23,5 +23,4 @@ python ./testpackage/testpackage_commons.py $jobcount $index echo "EXIT_CODE_FROM_JOB $?" -echo Job $SLURM_ARRAY_TASK_ID complete. diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 778a5bbb..1c2b1a86 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -28,6 +28,7 @@ def source_file_name(filename,fileLocation,time): cmd_args=argp.parse_args() funcs_to_use=cmd_args.funcs if "pass" in funcs_to_use: + print("No significant changes made, the testpackage will not be run!") quit() datalocation = "/wrk-kappa/group/spacephysics/analysator/CI/analysator-test-data/vlasiator" @@ -210,7 +211,6 @@ def source_file_name(filename,fileLocation,time): singletime = run['singletime'] nosubpops = run['nosubpops'] fluxLocation = run['fluxLocation'] - if not funcs_to_use: functions = run['funcs'] @@ -221,6 +221,7 @@ def source_file_name(filename,fileLocation,time): for j,func in enumerate(functions): + #If one wants to test new calls to be added to the testpackage, they could be added in here after the testpackage_definitions/ lists have been parsed callindex = 0 #try to import the list of calls corresponding to the function to be tested. diff --git a/testpackage/testpackage_get_diff.py b/testpackage/testpackage_get_diff.py index a0b8224e..26149b23 100644 --- a/testpackage/testpackage_get_diff.py +++ b/testpackage/testpackage_get_diff.py @@ -32,10 +32,10 @@ } f=open("diff_log.txt","w") -#Override if there are many changes as run all tests +#Override if there are many changes -> run all tests run_all=False testpackage_check=True -if len(git_diff)>6: +if len(git_diff)>10: f.write(f"Multiple ({len(git_diff)}) changes, will run all tests\n") run_all=True From 6b882f4279f7aebcfe2446ed0f0da1d35d605ccc Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 12:29:54 +0200 Subject: [PATCH 316/341] added ::error: to the failure calls in testpackage_commons.py so they may be easier to find on github --- testpackage/testpackage_commons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 1c2b1a86..e38a1e58 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -436,7 +436,7 @@ def source_file_name(filename,fileLocation,time): if "nooverwrite" not in call: print("EXIT_CODE_FROM_JOB 1") - print("----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) + print("::error::----------------------------\nFAILURE DURING CALL ",j, runname," \n```\n"+call+"```\n", repr(e)) traceback.print_exc() print("END TRACE for call",j,"\n----------------------------") From e169df37d5e80d0cb5c45f417d13e9cc98420086 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 12:42:47 +0200 Subject: [PATCH 317/341] changed to # comment from ''' since it's more reliable this caused issue before with the call lists --- testpackage/testpackage_compare.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index d027fbb8..f25b3dfb 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -13,20 +13,18 @@ def compare_images(a,b): #below can be used to get the RMSE, which is about 2-3x as slow the images must be read astype(np.float16) first for accurate RMSE - ''' - #originally uint8 so we might underflow with the substraction if not casted as float, float16 should be good enough - if im1.shape != im2.shape: - - #something should be added to handle this better, have a threshold in general or something. - #the substraction yields an error, so one could pad it with - #smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) - - return False - diff = np.sqrt(np.mean((im1-im2)**2)) - if diff !=0: - return False - return True - ''' + # #originally uint8 so we might underflow with the substraction if not casted as float, float16 should be good enough + # if im1.shape != im2.shape: + # + # #something should be added to handle this better, have a threshold in general or something. + # #the substraction yields an error, so one could pad it with + # #smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) + # + # return False + # diff = np.sqrt(np.mean((im1-im2)**2)) + # if diff !=0: + # return False + # return True def compare_images_in_folders(a,b,jobcount,jobcurr): From 7660d65ea1dfc9e4def5ee10554ef89f4f93fa49 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 13:29:17 +0200 Subject: [PATCH 318/341] minor comment changes --- testpackage/create_env.py | 2 +- testpackage/testpackage_compare.py | 17 +---------------- testpackage/testpackage_helpers.py | 3 ++- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index ec865c59..7d0dfb17 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -69,7 +69,7 @@ def create_venv_script(path,venv_path): create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder) - parser=argparse.ArgumentParser(description='Create virtual environment for testpackage.') + parser=argparse.ArgumentParser(description='Create python virtual environment for testpackage, will also create batch script that can be sourced.') parser.add_argument('--no-analysator',action='store_true',help='Do not install analysator.',default=False) parser.add_argument('--editable','-e',action='store_true',help='Install analysator as editable',default=True) args=parser.parse_args() diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index f25b3dfb..1e1d0838 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -3,28 +3,13 @@ import cv2 import numpy as np -#could be used to replace compare_images with a cv2 based implementation def compare_images(a,b): im1=cv2.imread(a) im2=cv2.imread(b) return im1.shape == im2.shape and not(np.bitwise_xor(im1,im2).any()) - - - #below can be used to get the RMSE, which is about 2-3x as slow the images must be read astype(np.float16) first for accurate RMSE - # #originally uint8 so we might underflow with the substraction if not casted as float, float16 should be good enough - # if im1.shape != im2.shape: - # - # #something should be added to handle this better, have a threshold in general or something. - # #the substraction yields an error, so one could pad it with - # #smaller_image=np.pad(smaller_image,(0,larger_image.shape[0]-smaller_image.shape[0]),(0,larger_image.shape[1]-smaller_image.shape[1]),(0,0)) - # - # return False - # diff = np.sqrt(np.mean((im1-im2)**2)) - # if diff !=0: - # return False - # return True + def compare_images_in_folders(a,b,jobcount,jobcurr): diff --git a/testpackage/testpackage_helpers.py b/testpackage/testpackage_helpers.py index 18c68fa6..3d0e0c91 100644 --- a/testpackage/testpackage_helpers.py +++ b/testpackage/testpackage_helpers.py @@ -35,11 +35,12 @@ def call_replace(call,func,skipped_args,required_args): args_out=[] #check that all required func args are set + #see example for required_funcs in testpackage_template_maker.py or testpackage_commons.py if required_args and func in required_args.keys(): for required_tuple in required_args[func]: required_params=required_tuple[0] default_params=required_tuple[1] - + check=False for param in required_params: if type(param) is tuple and param[0] not in named_parameters: From 40d4a0fa9f345fce07e145f5bb7cd100fe863827 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 13:50:41 +0200 Subject: [PATCH 319/341] added so if on HILE the create_env pyvenv script uses cray-python --- testpackage/create_env.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 7d0dfb17..b7d3e7b0 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -56,8 +56,11 @@ def create_venv_script(path,venv_path): used_python_version = version_info[0] used_gcc_version = version_info[-1].strip("[]") - #If module system is used, on HILE use cray-python! - f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") + #If module system is used, on HILE use cray-python! + if 'HILE' in os.uname().nodename.upper(): + f.write("module load cray-python") + else: + f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") f.write("module list\n") f.write(f"source {venv_path}/bin/activate\n") From e5d0bdd0ac024864b6c3ad604d65bfdef95d43bd Mon Sep 17 00:00:00 2001 From: lassejsc Date: Thu, 18 Dec 2025 13:52:13 +0200 Subject: [PATCH 320/341] sigh, missing newline from previous commit --- testpackage/create_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/create_env.py b/testpackage/create_env.py index b7d3e7b0..67caaa21 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -58,7 +58,7 @@ def create_venv_script(path,venv_path): #If module system is used, on HILE use cray-python! if 'HILE' in os.uname().nodename.upper(): - f.write("module load cray-python") + f.write("module load cray-python\n") else: f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n") f.write("module list\n") From b99a426aec0fe248d9f50f5696ec6cfcad6fdcac Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 10:24:27 +0200 Subject: [PATCH 321/341] Added 'limitedsize=True' calls to colormap non-restarting calls --- .../testpackage_plot_colormap3dslice.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py index b54e7ce0..e8dc9415 100644 --- a/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py +++ b/testpackage/testpackage_definitions/testpackage_plot_colormap3dslice.py @@ -189,8 +189,9 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Thermalvelocity',lin=1)", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='Blocks')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='gyrotropy')", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" - ] +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='gyrotropy',limitedsize=True)" +] restartcalls=["pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='restart_V')"] @@ -326,7 +327,8 @@ "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_beta_perpendicular')", "pt.plot.plot_colormap3dslice(vlsvobj=f,run=verifydir+REPLACEINDEX,var='vg_rmirror',lin=1,vmin=0.5,vmax=1.5,usesci=0)", "pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX,amr=0.1,amrlinestyles=['dashed'],amrcolours=['red'],amrlinewidths=[1])", -"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)" +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, cb_horizontal=True)", +"pt.plot.plot_colormap3dslice(vlsvobj=f, run=verifydir+REPLACEINDEX, var='vg_beta',limitedsize=True)" #"pt.plot.plot_colormap3dslice(filename=fileLocation+bulkname,run=verifydir+REPLACEINDEX,expression=timesmooth,pass_times=[14,0],pass_vars=['vg_rho'])"] ] From b4012ed332cc66865c3b6433df7ea0cff087e88c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 11:14:12 +0200 Subject: [PATCH 322/341] New indexing system instead of plot output indexing being based on the function used, i.e plot_bla/BLA/00n_blablabla now it would be based on whether it was restarting/nonrestarting/multipop, i.e the lists in testpackage_definitions. So indexing inside a run could go like plot_bla/BLA/00n_list1_blabla , plot_bla/BLA/00m_list2_blablabla etc. Downside is that within a run we can have two plotfiles starting with same numbering(not same string still) and the upside is that we can now add calls to the end of the list without messing up the indexing for everything. --- testpackage/testpackage_commons.py | 33 ++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index e38a1e58..41ca4550 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -194,7 +194,7 @@ def source_file_name(filename,fileLocation,time): callrunids = [] callrunindex = [] funcids=[] - +list_inidices=[] #list of tuples, first value is 0,1,2 corresponding whether restart/non/multipotcall (used for indexing files) #here so lint doesnt complain restartcalls=None nonrestartcalls=None @@ -243,6 +243,7 @@ def source_file_name(filename,fileLocation,time): if filename is not None: calls_in=v5restartcalls if vlasiator5 else restartcalls + list_index=0 for call in calls_in: if vlasiator5: call = call.replace("var='vg_v'","var='vg_restart_v'") @@ -255,6 +256,8 @@ def source_file_name(filename,fileLocation,time): calls.append(call) callrunindex.append(callindex) callindex += 1 + list_inidices.append((0,list_index)) + list_index+=1 funcids.append(j) @@ -262,6 +265,7 @@ def source_file_name(filename,fileLocation,time): if filename is None: #non restart calls calls_in=v5nonrestartcalls if vlasiator5 else nonrestartcalls + list_index=0 for call in calls_in: # Skip flux function calls if no flux files @@ -285,6 +289,8 @@ def source_file_name(filename,fileLocation,time): if skipped_args: call=call_replace(call,func,skipped_args,required_args) if call is not None: + list_inidices.append((1,list_index)) + list_index+=1 callrunids.append(i) calls.append(call) callrunindex.append(callindex) @@ -297,6 +303,7 @@ def source_file_name(filename,fileLocation,time): calls_in=v5multipopcalls if vlasiator5 else multipopcalls for pop in run['pops']: if pop != 'avgs': + list_index=0 for call in calls_in: # Skip flux function calls if no flux files if "flux" in call and fluxLocation is None: @@ -313,6 +320,8 @@ def source_file_name(filename,fileLocation,time): if skipped_args: call=call_replace(call,func,skipped_args,required_args) if call is not None: + list_inidices.append((2,list_index)) + list_index+=1 callrunids.append(i) calls.append(call) callrunindex.append(callindex) @@ -347,9 +356,10 @@ def source_file_name(filename,fileLocation,time): jrun = callrunindex[j] runid = callrunids[j] runname = runs[runid]['name'] - + call = calls[j] - + + list_index=list_inidices[j] funcid=funcids[j] @@ -409,10 +419,21 @@ def source_file_name(filename,fileLocation,time): if runs[runid]['name']=="ABC": bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') g = pt.vlsvfile.VlsvReader(fileLocation+bulkname_vdfdiff) - - call = call.replace('REPLACEPREVINDEX',"'"+str(jrun-1).rjust(4,'0')+"'") - call = call.replace('REPLACEINDEX',"'"+str(jrun).rjust(4,'0')+"'") + if list_index[0] == 0: + callist_name = "_restartcall" + elif list_index[0] == 1: + calllist_name = "_nonrestartcall" + elif list_index[0] == 2: + calllist_name = "_multipopcall" + else: + raise ValueError( + "Something went wrong with indexing, should be 0,1 or 2, but the value of list_index[0] was " + + list_index[0] + ) + + call = call.replace('REPLACEPREVINDEX',"'"+str(list_index-1).rjust(4,'0')+calllist_name+"'") + call = call.replace('REPLACEINDEX',"'"+str(list_index[1]).rjust(4,'0')+calllist_name+"'") call = call.replace('REPLACETIME',"'"+str(time)+"'") call = call.replace('REPLACECELLID','1') From fa60f1f92e43b339af3d4ecc0fd18e7661648bce Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 11:23:51 +0200 Subject: [PATCH 323/341] More memory for sbatch job --- testpackage/run_testpackage_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index b5eb09ce..179c2904 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -6,7 +6,7 @@ #SBATCH -n 1 #SBATCH --array=1-20 #SBATCH --no-requeue -#SBATCH --mem-per-cpu=32000 +#SBATCH --mem-per-cpu=64000 #THIS SHOULD ONLY BE USED FOR GITHUB WORKFLOW TESTS From 00603a3555926bd2c0508f9577d1e740e28e4d1e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 12:50:35 +0200 Subject: [PATCH 324/341] variable naming error in the indexing fixed --- testpackage/testpackage_commons.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 41ca4550..33c2b7cd 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -420,20 +420,21 @@ def source_file_name(filename,fileLocation,time): bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') g = pt.vlsvfile.VlsvReader(fileLocation+bulkname_vdfdiff) + print(f"LIST_INDEX {list_index}") if list_index[0] == 0: - callist_name = "_restartcall" + callList_name = "_restartcall" elif list_index[0] == 1: - calllist_name = "_nonrestartcall" + callList_name = "_nonrestartcall" elif list_index[0] == 2: - calllist_name = "_multipopcall" + callList_name = "_multipopcall" else: raise ValueError( "Something went wrong with indexing, should be 0,1 or 2, but the value of list_index[0] was " + list_index[0] ) - call = call.replace('REPLACEPREVINDEX',"'"+str(list_index-1).rjust(4,'0')+calllist_name+"'") - call = call.replace('REPLACEINDEX',"'"+str(list_index[1]).rjust(4,'0')+calllist_name+"'") + call = call.replace('REPLACEPREVINDEX',"'"+str(list_index[1]-1).rjust(4,'0')+callList_name+"'") + call = call.replace('REPLACEINDEX',"'"+str(list_index[1]).rjust(4,'0')+callList_name+"'") call = call.replace('REPLACETIME',"'"+str(time)+"'") call = call.replace('REPLACECELLID','1') @@ -449,8 +450,8 @@ def source_file_name(filename,fileLocation,time): f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - exec(call) - + #exec(call) + print(call) except Exception as e: #This is here so get_job_error can get the error from the call. # note that we could also raise the error but then execution of subsequent calls would stop From 696e98e88a108efa3ceb5fa8963330971f30a299 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 12:54:41 +0200 Subject: [PATCH 325/341] Debug line left in, removed --- testpackage/testpackage_commons.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testpackage/testpackage_commons.py b/testpackage/testpackage_commons.py index 33c2b7cd..c883cc4b 100644 --- a/testpackage/testpackage_commons.py +++ b/testpackage/testpackage_commons.py @@ -420,7 +420,6 @@ def source_file_name(filename,fileLocation,time): bulkname_vdfdiff=bulkname_vdfdiff.replace('bulk','distributions') g = pt.vlsvfile.VlsvReader(fileLocation+bulkname_vdfdiff) - print(f"LIST_INDEX {list_index}") if list_index[0] == 0: callList_name = "_restartcall" elif list_index[0] == 1: @@ -450,8 +449,7 @@ def source_file_name(filename,fileLocation,time): f = pt.vlsvfile.VlsvReader(fileLocation+bulkname) try: - #exec(call) - print(call) + exec(call) except Exception as e: #This is here so get_job_error can get the error from the call. # note that we could also raise the error but then execution of subsequent calls would stop From 3dcc2e2d5e8a747b08b2a303fc6debbe88233127 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 12:26:48 +0200 Subject: [PATCH 326/341] Added testpackage dependancy group for image_compare/testpackage to use --- .github/workflows/test_compare_images.yml | 2 +- .github/workflows/test_compare_images_full.yml | 2 +- pyproject.toml | 5 +++-- testpackage/create_env.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_compare_images.yml b/.github/workflows/test_compare_images.yml index 6dac5301..3ba2a682 100644 --- a/.github/workflows/test_compare_images.yml +++ b/.github/workflows/test_compare_images.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false max-parallel: 2 matrix: - extras: ["all"] + extras: ["testpackage"] steps: - uses: actions/checkout@v4 timeout-minutes: 5 diff --git a/.github/workflows/test_compare_images_full.yml b/.github/workflows/test_compare_images_full.yml index b36ace3a..1e92dac7 100644 --- a/.github/workflows/test_compare_images_full.yml +++ b/.github/workflows/test_compare_images_full.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false max-parallel: 2 matrix: - extras: ["all"] + extras: ["testpackage"] steps: - uses: actions/checkout@v4 timeout-minutes: 5 diff --git a/pyproject.toml b/pyproject.toml index ae5ce201..401b17e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,12 +35,13 @@ vtk = [ ] all = [ "analysator[vtk]", - "opencv-python" ] bvtk = [ "vtk==9.2.6", ] - +testpackage = [ + "opencv-python" +] [project.urls] Homepage = "https://github.com/fmihpc/analysator" Issues = "https://github.com/fmihpc/analysator/issues" diff --git a/testpackage/create_env.py b/testpackage/create_env.py index 67caaa21..c48ca030 100644 --- a/testpackage/create_env.py +++ b/testpackage/create_env.py @@ -20,7 +20,7 @@ def create_venv(path,install_analysator=True,editable=False): virt_env.post_setup(context) if install_analysator: editable='--editable' if editable else None - system_call(f'{path}/bin/pip install {editable} ../[all]',live_output=True) + system_call(f'{path}/bin/pip install {editable} ../[testpackage]',live_output=True) print(f'Virtual environment created at {path}') return None From 4173f4aee8fc01a93a9cdccc62e2e708f7346691 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 12:27:38 +0200 Subject: [PATCH 327/341] added analysator[vtk] to tesstpackage dep. group --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 401b17e0..5da7dfc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,8 @@ bvtk = [ "vtk==9.2.6", ] testpackage = [ - "opencv-python" + "opencv-python", + "analysator[vtk]", ] [project.urls] Homepage = "https://github.com/fmihpc/analysator" From 9a16c5c7e99f8c901f741e9c7a44fd108a7ef069 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 14:28:10 +0200 Subject: [PATCH 328/341] Added new workflow to test oldest python version Hopefully it works(?) --- .../test_compare_image_oldest_python.yml | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/test_compare_image_oldest_python.yml diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml new file mode 100644 index 00000000..febd8832 --- /dev/null +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -0,0 +1,72 @@ +#This workflow will install python and run the full analysator testpackage with image comparison for the results + +name: Turso compare all images with oldest python + +on: + workflow_dispatch: + + +jobs: + + turso_system: + if: github.repository_owner == 'fmihpc' + runs-on: carrington + timeout-minutes: 120 + strategy: + fail-fast: false + max-parallel: 2 + matrix: + extras: ["testpackage"] + steps: + - uses: actions/checkout@v4 + timeout-minutes: 5 + - name: Install uv + uses: astral-sh/setup-uv@v6 + timeout-minutes: 5 + - name: Get oldest allowed python version from pyproject.toml + id: pyversion + run: | + echo "PYTHON=$(cat pyproject | grep -Po '^requires-python\W*=\W*".+\K\d.+\d')" >> $GITHUB_OUTPUT + module load Python/$PYTHON + - name: Install dependencies + timeout-minutes: 5 + run: | + export TMPDIR=$RUNNER_TEMP + export UV_LINK_MODE=copy + module purge + module load Python/{{ steps.pyversion.outputs.PYTHON }} + uv venv CI_env + . CI_env/bin/activate + uv pip install --editable ../analysator[${{ matrix.extras }}] + - name: Produce plots + id: run_cl + run: | + export TMPDIR=$RUNNER_TEMP + module purge + module load Python/{{ steps.pyversion.outputs.PYTHON }} + verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" + verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') + if [[ -f $verf_loc/$verfset/.lockfile ]]; then + echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation." + exit 1 + fi + sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh + + cat testpackage_run.txt + . CI_env/bin/activate + python ./testpackage/testpackage_get_job_error.py testpackage_run.txt + + - name: Comparing plotted data + run: | + export TMPDIR=$RUNNER_TEMP + module load Python/{{ steps.pyversion.outputs.PYTHON }} + . CI_env/bin/activate + sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh + cat testpackage_compare.txt + python ./testpackage/testpackage_get_job_error.py testpackage_compare.txt + - name: scancel dangling job upon cancellation + if: cancelled() + run: | + scancel ${{ steps.run_cl.outputs.SLURM_JOB_ID }} + + From ac28faf7c4a93c8608180da56ab721852bb16c35 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 15:19:01 +0200 Subject: [PATCH 329/341] Python version checking and trying for old python workflow --- .../test_compare_image_oldest_python.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index febd8832..a128216c 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -26,7 +26,24 @@ jobs: - name: Get oldest allowed python version from pyproject.toml id: pyversion run: | - echo "PYTHON=$(cat pyproject | grep -Po '^requires-python\W*=\W*".+\K\d.+\d')" >> $GITHUB_OUTPUT + PYTHON=$(cat pyproject | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') + MAJOR=$(echo $PYTHON | grep -Po '^\d+') + MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') + AVAILABLE_VERSIONS=$(module spider Python) + N=0 + while [[ ! $VERSIONS_MATCH ]] + do + echo "Trying to find module for Python/$PYTHON" + VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-' | grep -Po 'Python'/$PYTHON) + MINOR=$(( $MINOR + 1 )) + PYTHON=$MAJOR.$MINOR + N=$(( N + 1)) + if (( N> 20 )); then + echo "::error:: Could not find a python version to use." + exit 1 + fi + done + echo "PYTHON=$PYTHON" >> $GITHUB_OUTPUT module load Python/$PYTHON - name: Install dependencies timeout-minutes: 5 From 79371cf4fab970b9763c1048e1225aae5beaba02 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 15:28:18 +0200 Subject: [PATCH 330/341] missing file extension from cat in the new workflow --- .github/workflows/test_compare_image_oldest_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index a128216c..ad41378a 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -26,7 +26,7 @@ jobs: - name: Get oldest allowed python version from pyproject.toml id: pyversion run: | - PYTHON=$(cat pyproject | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') + PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') MAJOR=$(echo $PYTHON | grep -Po '^\d+') MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) From d213c5d318edb1daa1f00544e7b6bed9e0a5e334 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 15:33:18 +0200 Subject: [PATCH 331/341] missing dollars --- .github/workflows/test_compare_image_oldest_python.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index ad41378a..8f175fcf 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -51,7 +51,7 @@ jobs: export TMPDIR=$RUNNER_TEMP export UV_LINK_MODE=copy module purge - module load Python/{{ steps.pyversion.outputs.PYTHON }} + module load Python/${{ steps.pyversion.outputs.PYTHON }} uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] @@ -60,7 +60,7 @@ jobs: run: | export TMPDIR=$RUNNER_TEMP module purge - module load Python/{{ steps.pyversion.outputs.PYTHON }} + module load Python/${{ steps.pyversion.outputs.PYTHON }} verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets" verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$') if [[ -f $verf_loc/$verfset/.lockfile ]]; then @@ -76,7 +76,7 @@ jobs: - name: Comparing plotted data run: | export TMPDIR=$RUNNER_TEMP - module load Python/{{ steps.pyversion.outputs.PYTHON }} + module load Python/${{ steps.pyversion.outputs.PYTHON }} . CI_env/bin/activate sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh cat testpackage_compare.txt From 65028ebe97b4295c115bdca73bf9f89a8706ee5c Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 15:45:48 +0200 Subject: [PATCH 332/341] added another if so the version does not jump after successful match --- .../workflows/test_compare_image_oldest_python.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index 8f175fcf..c6652165 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -35,12 +35,14 @@ jobs: do echo "Trying to find module for Python/$PYTHON" VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-' | grep -Po 'Python'/$PYTHON) - MINOR=$(( $MINOR + 1 )) - PYTHON=$MAJOR.$MINOR - N=$(( N + 1)) - if (( N> 20 )); then - echo "::error:: Could not find a python version to use." - exit 1 + if [[ ! $VERSIONS_MATCH ]]; then + MINOR=$(( $MINOR + 1 )) + PYTHON=$MAJOR.$MINOR + N=$(( N + 1)) + if (( N> 20 )); then + echo "::error:: Could not find a python version to use." + exit 1 + fi fi done echo "PYTHON=$PYTHON" >> $GITHUB_OUTPUT From f3a787c9aa739f214782f9e351ab4855ea145ca4 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 15:46:56 +0200 Subject: [PATCH 333/341] testing to see if removing module load works from the run_testpackage_workflow since it would make things easier for the older python --- testpackage/run_testpackage_workflow.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 179c2904..77bc1fea 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -19,7 +19,6 @@ hostname module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH -module load Python/3.10.4-GCCcore-11.3.0 echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT From b7426ed0f535cb3ffacff4ccdebaeabcdb383091 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 16:36:23 +0200 Subject: [PATCH 334/341] module list in the testpackage_oldest_pytohn workflow for debugging --- .github/workflows/test_compare_image_oldest_python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index c6652165..1d4dfaad 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -54,6 +54,7 @@ jobs: export UV_LINK_MODE=copy module purge module load Python/${{ steps.pyversion.outputs.PYTHON }} + module list uv venv CI_env . CI_env/bin/activate uv pip install --editable ../analysator[${{ matrix.extras }}] From 6e75ba413fab60059a78a4191b8d969b2e20992a Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 16:41:53 +0200 Subject: [PATCH 335/341] forcing python version 3.7 in the oldest_python.yml to debug workflow --- .github/workflows/test_compare_image_oldest_python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index 1d4dfaad..c8bc26f2 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -31,6 +31,7 @@ jobs: MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) N=0 + PYTHON="3.7" while [[ ! $VERSIONS_MATCH ]] do echo "Trying to find module for Python/$PYTHON" From 6e72b6b3e2fc174f0a2c7676746831659ec0ac9b Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 16:44:12 +0200 Subject: [PATCH 336/341] =?UTF-8?q?ditto=20previous=20commit=20except=20ri?= =?UTF-8?q?ght=20spot=20for=20it=C2=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Universe is throwing signs for a holiday --- .github/workflows/test_compare_image_oldest_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index c8bc26f2..6c96ce87 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -27,11 +27,11 @@ jobs: id: pyversion run: | PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') + PYTHON="3.7" MAJOR=$(echo $PYTHON | grep -Po '^\d+') MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) N=0 - PYTHON="3.7" while [[ ! $VERSIONS_MATCH ]] do echo "Trying to find module for Python/$PYTHON" From 3d7fa8180b0902891ed3f61328ae1ca6a5f79129 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 16:58:02 +0200 Subject: [PATCH 337/341] testing whether this will make the older python version work might have issue if there exists both GCC and non GCC core version for same python version --- .github/workflows/test_compare_image_oldest_python.yml | 5 ++--- testpackage/run_testpackage_workflow.sh | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index 6c96ce87..4c33eb7e 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -27,7 +27,6 @@ jobs: id: pyversion run: | PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') - PYTHON="3.7" MAJOR=$(echo $PYTHON | grep -Po '^\d+') MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) @@ -35,10 +34,10 @@ jobs: while [[ ! $VERSIONS_MATCH ]] do echo "Trying to find module for Python/$PYTHON" - VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-' | grep -Po 'Python'/$PYTHON) + VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-GCC' | grep -Po 'Python'/$PYTHON) if [[ ! $VERSIONS_MATCH ]]; then MINOR=$(( $MINOR + 1 )) - PYTHON=$MAJOR.$MINOR + PYTHON="$MAJOR.$MINOR" N=$(( N + 1)) if (( N> 20 )); then echo "::error:: Could not find a python version to use." diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 77bc1fea..1c776b17 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -21,6 +21,12 @@ module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT +if [[ ${{ steps.pyversion.outputs.PYTHON }} ]]; then + module load Python/${{ steps.pyversion.outputs.PYTHON }} +else + module load Python/3.10.4-GCCcore-11.3.0 +fi + source CI_env/bin/activate From 5f90d267d03e8e87fd1176b94929d480be8e6f8f Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 17:02:43 +0200 Subject: [PATCH 338/341] Revert "testing whether this will make the older python version work" This reverts commit 3d7fa8180b0902891ed3f61328ae1ca6a5f79129. --- .github/workflows/test_compare_image_oldest_python.yml | 5 +++-- testpackage/run_testpackage_workflow.sh | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index 4c33eb7e..6c96ce87 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -27,6 +27,7 @@ jobs: id: pyversion run: | PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') + PYTHON="3.7" MAJOR=$(echo $PYTHON | grep -Po '^\d+') MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) @@ -34,10 +35,10 @@ jobs: while [[ ! $VERSIONS_MATCH ]] do echo "Trying to find module for Python/$PYTHON" - VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-GCC' | grep -Po 'Python'/$PYTHON) + VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-' | grep -Po 'Python'/$PYTHON) if [[ ! $VERSIONS_MATCH ]]; then MINOR=$(( $MINOR + 1 )) - PYTHON="$MAJOR.$MINOR" + PYTHON=$MAJOR.$MINOR N=$(( N + 1)) if (( N> 20 )); then echo "::error:: Could not find a python version to use." diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 1c776b17..77bc1fea 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -21,12 +21,6 @@ module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT -if [[ ${{ steps.pyversion.outputs.PYTHON }} ]]; then - module load Python/${{ steps.pyversion.outputs.PYTHON }} -else - module load Python/3.10.4-GCCcore-11.3.0 -fi - source CI_env/bin/activate From 80d4ea4cb03e38ec1170d1833af3d42b8a03e22e Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 19 Dec 2025 18:22:30 +0200 Subject: [PATCH 339/341] added back the module load Python into run_testpackage_workflow --- testpackage/run_testpackage_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/run_testpackage_workflow.sh b/testpackage/run_testpackage_workflow.sh index 77bc1fea..9eaa6e96 100755 --- a/testpackage/run_testpackage_workflow.sh +++ b/testpackage/run_testpackage_workflow.sh @@ -21,7 +21,7 @@ module purge export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH echo "SLURM_JOB_ID=$SLURM_ARRAY_JOB_ID" >> $GITHUB_OUTPUT - +module load Python/3.10.4-GCCcore-11.3.0 source CI_env/bin/activate module list From e2f0cb6909583c59f93a4629b7cbb380c1353b42 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 5 Jan 2026 10:14:21 +0200 Subject: [PATCH 340/341] Added echoing of the loaded module and module purge at start of python version finding, commented out debug line --- .github/workflows/test_compare_image_oldest_python.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_compare_image_oldest_python.yml b/.github/workflows/test_compare_image_oldest_python.yml index 6c96ce87..57517d21 100644 --- a/.github/workflows/test_compare_image_oldest_python.yml +++ b/.github/workflows/test_compare_image_oldest_python.yml @@ -26,8 +26,9 @@ jobs: - name: Get oldest allowed python version from pyproject.toml id: pyversion run: | + module purge PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d') - PYTHON="3.7" + #PYTHON="3.7" MAJOR=$(echo $PYTHON | grep -Po '^\d+') MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)') AVAILABLE_VERSIONS=$(module spider Python) @@ -48,6 +49,7 @@ jobs: done echo "PYTHON=$PYTHON" >> $GITHUB_OUTPUT module load Python/$PYTHON + module list Python - name: Install dependencies timeout-minutes: 5 run: | From ffe45ccab063e5f96641d0700004f033f7396f78 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 5 Jan 2026 11:53:49 +0200 Subject: [PATCH 341/341] Added better error output for image comparison script --- testpackage/testpackage_compare.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testpackage/testpackage_compare.py b/testpackage/testpackage_compare.py index 1e1d0838..ed66863c 100644 --- a/testpackage/testpackage_compare.py +++ b/testpackage/testpackage_compare.py @@ -59,11 +59,14 @@ def compare_images_in_folders(a,b,jobcount,jobcurr): #Feed the different files to compare_images - for file in different_files[start:end]: - if(not compare_images(file,file.replace(a,b))): - different=True - print("Images differ:",file,file.replace(a,b)) + for file in different_files[start:end]: + try: + if(not compare_images(file,file.replace(a,b))): + different=True + print("Images differ:",file,file.replace(a,b)) + except Exception as e: + raise SystemError(f"Error calling compare_images({file},{file.replace(a,b)}):"+str(e)) #Print unique and missing files