From 53e5508642e8f0136f16f67c17b4c10b59aa99b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Mon, 11 Sep 2017 03:05:49 +0300 Subject: [PATCH] Mathematica script for calculating the 2D Bessel transforms. Former-commit-id: 6371433778d3b7ee2f0a286f2f3e2cbddc53c917 --- besseltransforms/runit.sh | 11 +++++++++++ besseltransforms/vzor.m | 6 ++++++ qpms/tmatrices.py | 7 +++++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 besseltransforms/runit.sh create mode 100644 besseltransforms/vzor.m diff --git a/besseltransforms/runit.sh b/besseltransforms/runit.sh new file mode 100755 index 0000000..d277388 --- /dev/null +++ b/besseltransforms/runit.sh @@ -0,0 +1,11 @@ +#!/bin/bash +K=$1 +Q=$2 +N=$3 +module load mathematica +cat - vzor.m <<<" +kk=$K; +qq=$Q; +nn=$N; +" | math -noprompt > "${K}-${Q}-${N}" + diff --git a/besseltransforms/vzor.m b/besseltransforms/vzor.m new file mode 100644 index 0000000..85ce73d --- /dev/null +++ b/besseltransforms/vzor.m @@ -0,0 +1,6 @@ +$Assumptions = k >= 0 && k0 >= 0 && c >= 0 && n >= 0 ; +Refine[Integrate[(1 - Exp[-c x])^\[Kappa] (k0 x)^(-q) Exp[ + I k0 x] x BesselJ[n, k x] Exp[-c x], {x, + 0, \[Infinity]}], {\[Kappa] == kk, q == qq, n == nn}] +Series[%, {k, \[Infinity], 10}] +Quit[ ] diff --git a/qpms/tmatrices.py b/qpms/tmatrices.py index 9b765d7..7546595 100644 --- a/qpms/tmatrices.py +++ b/qpms/tmatrices.py @@ -152,7 +152,7 @@ def _scuffTMatrixConvert_EM_01(EM): else: return None -def loadScuffTMatrices(fileName): +def loadScuffTMatrices(fileName, normalisation = 1): """ TODO doc """ @@ -182,7 +182,10 @@ def loadScuffTMatrices(fileName): for outc_type in [0,1]: TMatrices[:,1-outc_type,:,1-inc_type,:] = TMatrices_tmp_real[:,:,outc_type,:,inc_type]+1j*TMatrices_tmp_imag[:,:,outc_type,:,inc_type] # IMPORTANT: now we are going from Reid's/Kristensson's/Jackson's/whoseever convention to Taylor's convention - TMatrices[:,:,:,:,:] = TMatrices[:,:,:,:,:] * np.sqrt(ny*(ny+1))[ň,ň,ň,ň,:] / np.sqrt(ny*(ny+1))[ň,ň,:,ň,ň] + if normalisation == 1: + TMatrices[:,:,:,:,:] = TMatrices[:,:,:,:,:] * np.sqrt(ny*(ny+1))[ň,ň,ň,ň,:] / np.sqrt(ny*(ny+1))[ň,ň,:,ň,ň] + elif normalisation == 2: # Kristensson? + pass return (TMatrices, freqs, freqs_weirdunits, lMax)