12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- from scattnlay import scattnlay
- import numpy as np
- import cmath
- import matplotlib.pyplot as plt
- import matplotlib as mp
- import math as m
- import sys,os,shutil,glob,subprocess
- def polarplot(x, m, fname, plot_type="unpolarized", mode_n = -1, mode_type = -1):
- theta = np.linspace(0,2*np.pi, 360*4)
- theta = theta[:-1]
- terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 = scattnlay(
- np.array([x]), np.array([m]), theta = theta, mode_n = mode_n, mode_type = mode_type)
- S = 1.0/2.0*( np.abs(S1[0])**2 + np.abs(S2[0])**2 )
- print(S)
- font = {'family' : 'monospace',
- 'weight' : 'bold',
- 'size' : '20'}
- mp.rc('font', **font)
- mp.rcParams['axes.linewidth'] = 2
-
- mp.rcParams['legend.fontsize'] = 20
- mp.rcParams['axes.labelweight'] = 'bold'
-
- ax = plt.subplot(111, polar=True)
-
-
-
-
-
-
-
- for lb in ax.get_yticklabels():
- lb.set_fontsize(15)
-
-
-
- ax.grid(linestyle="--")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- line_tscs, = ax.plot(theta, np.log(S), 'r', linewidth=3, label=r"$S_{11}$")
-
-
-
-
-
-
-
- plt.savefig(fname)
- plt.clf()
- plt.close()
|