Sample script for python use of make_mie_table

I am working on a simple liquid water cloud example. I intend to use the normal propgen commands, and call them through python function. Here is the first one, makeMieWaterGamma.

I prefer calling a different function for each case rather than passing flags.
The next one might be makeMieAerosolGamma. I'd rather import a different function than remember which flag to pass.


In [1]:
from wgm_pyshdom_sandbox.propgen import make_table

In [2]:
# Define particle parameters
fname = 'mie_water_gamma'
wavlen = .532
reffmin = .01
reffmax = 2.5
reffnum = 7

In [3]:
# Test the make_table routine
make_table.makeMieWaterGamma??

In [4]:
# Make a mie table and return the filename
fout = make_table.makeMieWaterGamma(fname, wavlen, reffmin, reffmax, reffnum, overwrite=True)
print(fout)


mie_water_gamma.part

In [5]:
cat $fout


! Polarized Mie scattering table vs. effective radius (LWC=1 g/m^3)
    0.532    0.532  wavelength range (micron)
 1.000  W   particle density (g/cm^3) and type (Water, Ice, Aerosol)
  0.133372E+01 -0.149628E-08  particle index of refraction
7.00000 gamma size distribution shape parameter
   7    0.010    2.500  number, starting, ending effective radius
   0.0100  0.28280E+01 0.999990      4  Reff  Ext  Alb  Nrank
1     1.00000    0.01609    0.50007    0.00336    0.00001
2     0.00000    0.00000    3.00004    0.01121    0.00003
3     0.00000    0.00000    0.02770    0.00009    0.00000
4     0.00736    1.50003    0.01209    0.00005    0.00000
5     0.00000    0.00000    1.22471    0.00614    0.00002
6     0.00000    0.00000   -0.00000   -0.00000   -0.00000
   0.0251  0.44099E+02 0.999999      5  Reff  Ext  Alb  Nrank
1     1.00000    0.10029    0.50256    0.02088    0.00047    0.00001
2     0.00000    0.00000    3.00139    0.06950    0.00116    0.00002
3     0.00000    0.00000    0.17281    0.00349    0.00005    0.00000
4     0.04602    1.50116    0.07513    0.00186    0.00003    0.00000
5     0.00000    0.00000    1.22331    0.03802    0.00073    0.00001
6     0.00000    0.00000   -0.00021   -0.00000   -0.00000   -0.00000
   0.0630  0.57418E+03 1.000000      7  Reff  Ext  Alb  Nrank
1     1.00000    0.60174    0.59440    0.12994    0.01698    0.00162    0.00012    0.00001
2     0.00000    0.00000    3.05215    0.40727    0.04110    0.00332    0.00023    0.00001
3     0.00000    0.00000    1.04423    0.12867    0.01171    0.00086    0.00005    0.00000
4     0.28115    1.54370    0.44516    0.06725    0.00695    0.00056    0.00004    0.00000
5     0.00000    0.00000    1.16654    0.21191    0.02495    0.00222    0.00016    0.00001
6     0.00000    0.00000   -0.00747    0.00126    0.00020    0.00002    0.00000    0.00000
   0.1581  0.32561E+04 1.000000     13  Reff  Ext  Alb  Nrank
1     1.00000    1.98127    1.89425    1.19722    0.62856    0.26033    0.09753    0.03076    0.00918    0.00240    0.00061    0.00014    0.00003    0.00001
2     0.00000    0.00000    3.72289    2.01691    1.02554    0.39660    0.14478    0.04359    0.01276    0.00322    0.00081    0.00018    0.00004    0.00001
3     0.00000    0.00000    3.42385    1.95175    0.92333    0.36120    0.12522    0.03772    0.01067    0.00268    0.00066    0.00015    0.00003    0.00001
4     0.87567    2.08862    1.88010    1.25255    0.61622    0.25800    0.09136    0.02874    0.00823    0.00214    0.00053    0.00012    0.00003    0.00001
5     0.00000    0.00000    0.38544    0.34059    0.22327    0.11486    0.04532    0.01641    0.00487    0.00141    0.00035    0.00009    0.00002    0.00000
6     0.00000    0.00000    0.08720    0.18727    0.09147    0.05399    0.01768    0.00667    0.00175    0.00051    0.00011    0.00003    0.00001    0.00000
   0.3969  0.56715E+04 1.000000     30  Reff  Ext  Alb  Nrank
1     1.00000    2.48522    3.40565    3.66863    3.55836    3.17753    2.65711    2.12264    1.60332    1.17108    0.81855    0.55166    0.36425    0.22722    0.14469    0.08338    0.05233    0.02768    0.01752    0.00841    0.00551    0.00236    0.00164    0.00062    0.00047    0.00015    0.00013    0.00003    0.00003    0.00001    0.00001
2     0.00000    0.00000    4.32602    4.27778    4.14143    3.55777    3.02760    2.32900    1.81589    1.26559    0.92652    0.58769    0.41306    0.23849    0.16461    0.08615    0.05979    0.02812    0.02011    0.00839    0.00635    0.00231    0.00190    0.00059    0.00054    0.00014    0.00015    0.00003    0.00004    0.00001    0.00001
3     0.00000    0.00000    4.24248    4.29136    4.09853    3.55330    2.99392    2.31745    1.78748    1.25443    0.90609    0.58022    0.40077    0.23469    0.15820    0.08463    0.05678    0.02764    0.01880    0.00828    0.00581    0.00230    0.00169    0.00060    0.00047    0.00015    0.00012    0.00003    0.00003    0.00001    0.00001
4     0.96598    2.51009    3.36901    3.69350    3.54627    3.20026    2.65537    2.13916    1.60042    1.17964    0.81372    0.55499    0.35975    0.22834    0.14163    0.08383    0.05062    0.02792    0.01668    0.00855    0.00513    0.00243    0.00149    0.00065    0.00041    0.00016    0.00011    0.00004    0.00003    0.00001    0.00001
5     0.00000    0.00000   -0.00256   -0.05052   -0.03848   -0.06052   -0.04294   -0.03328   -0.02951   -0.00765   -0.01607    0.00325   -0.00782    0.00453   -0.00358    0.00289   -0.00156    0.00137   -0.00063    0.00054   -0.00024    0.00018   -0.00008    0.00006   -0.00003    0.00002   -0.00001    0.00000   -0.00000    0.00000   -0.00000
6     0.00000    0.00000   -0.01302    0.11328    0.09898    0.19993    0.16940    0.20899    0.16215    0.15589    0.11263    0.09009    0.06288    0.04250    0.02996    0.01694    0.01268    0.00584    0.00490    0.00176    0.00176    0.00046    0.00060    0.00011    0.00019    0.00002    0.00006    0.00000    0.00002   -0.00000    0.00000
   0.9961  0.18680E+04 1.000000     70  Reff  Ext  Alb  Nrank
1     1.00000    2.28016    3.30526    3.56411    3.90086    4.05126    4.23281    4.38484    4.51162    4.57201    4.60463    4.55570    4.45256    4.31734    4.09030    3.89477    3.58995    3.35591    3.02594    2.77276    2.46013    2.20495    1.93632    1.69325    1.48006    1.25954    1.10155    0.91016    0.80006    0.64065    0.56813    0.44039    0.39505    0.29633    0.26935    0.19561    0.18026    0.12690    0.11853    0.08103    0.07665    0.05097    0.04877    0.03161    0.03054    0.01936    0.01884    0.01169    0.01144    0.00694    0.00685    0.00404    0.00403    0.00231    0.00232    0.00129    0.00130    0.00070    0.00071    0.00037    0.00038    0.00019    0.00020    0.00009    0.00010    0.00003    0.00004    0.00001    0.00002    0.00000    0.00001
2     0.00000    0.00000    4.15704    4.06672    4.27879    4.23185    4.47271    4.43751    4.71634    4.58749    4.80152    4.55658    4.65150    4.30501    4.29104    3.86881    3.78663    3.31929    3.21071    2.73065    2.62597    2.16278    2.07863    1.65527    1.59704    1.22819    1.19393    0.88616    0.87033    0.62346    0.61975    0.42878    0.43178    0.28890    0.29471    0.19105    0.19731    0.12419    0.12971    0.07945    0.08381    0.05005    0.05326    0.03108    0.03331    0.01904    0.02052    0.01150    0.01244    0.00682    0.00743    0.00397    0.00437    0.00227    0.00251    0.00127    0.00141    0.00069    0.00076    0.00036    0.00041    0.00019    0.00022    0.00009    0.00011    0.00003    0.00005    0.00001    0.00002    0.00000    0.00001
3     0.00000    0.00000    3.98651    4.07599    4.23275    4.17914    4.45300    4.40244    4.67455    4.58461    4.73667    4.56768    4.58306    4.31284    4.22678    3.86999    3.72599    3.31648    3.15119    2.72692    2.56638    2.15988    2.01926    1.65370    1.53913    1.22774    1.13908    0.88634    0.82012    0.62380    0.57545    0.42898    0.39417    0.28885    0.26404    0.19079    0.17328    0.12380    0.11163    0.07904    0.07073    0.04969    0.04415    0.03079    0.02720    0.01881    0.01655    0.01134    0.00993    0.00673    0.00588    0.00392    0.00343    0.00223    0.00196    0.00124    0.00109    0.00067    0.00058    0.00035    0.00031    0.00019    0.00016    0.00009    0.00007    0.00003    0.00003    0.00001    0.00001    0.00000    0.00000
4     0.92860    2.32740    3.23227    3.57209    3.89354    4.02414    4.23419    4.37831    4.49289    4.59976    4.57087    4.60075    4.42220    4.36423    4.06879    3.93909    3.57452    3.39823    3.01207    2.81392    2.44479    2.24479    1.91827    1.73085    1.45935    1.29369    1.07905    0.93982    0.77698    0.66519    0.54575    0.45972    0.37450    0.31085    0.25144    0.20601    0.16544    0.13403    0.10685    0.08573    0.06785    0.05396    0.04243    0.03345    0.02617    0.02044    0.01594    0.01232    0.00957    0.00731    0.00566    0.00426    0.00330    0.00243    0.00189    0.00135    0.00105    0.00073    0.00056    0.00039    0.00029    0.00020    0.00015    0.00010    0.00007    0.00004    0.00003    0.00001    0.00001    0.00000    0.00000
5     0.00000    0.00000   -0.05272   -0.09055   -0.02938   -0.08958    0.02722   -0.06897    0.03934   -0.03683    0.01239   -0.01917   -0.01615   -0.01590   -0.03452   -0.02024   -0.04258   -0.02502   -0.04354   -0.02748   -0.04004   -0.02749   -0.03400   -0.02578   -0.02690   -0.02303   -0.01989   -0.01974   -0.01375   -0.01625   -0.00886   -0.01284   -0.00527   -0.00975   -0.00285   -0.00712   -0.00132   -0.00501   -0.00044   -0.00341    0.00000   -0.00225    0.00020   -0.00144    0.00025   -0.00092    0.00024   -0.00058    0.00020   -0.00034    0.00015   -0.00018    0.00010   -0.00011    0.00006   -0.00008    0.00004   -0.00006    0.00003   -0.00004    0.00001   -0.00003   -0.00000   -0.00001   -0.00000   -0.00001   -0.00000   -0.00000   -0.00000   -0.00000   -0.00000
6     0.00000    0.00000   -0.11293    0.05436   -0.13786    0.08665   -0.06381    0.08050    0.03909    0.08959    0.11558    0.12748    0.16003    0.16892    0.18671    0.19435    0.20279    0.19846    0.20892    0.18495    0.20477    0.16042    0.19135    0.13126    0.17096    0.10234    0.14639    0.07669    0.12036    0.05567    0.09513    0.03943    0.07234    0.02740    0.05297    0.01877    0.03741    0.01270    0.02552    0.00851    0.01686    0.00564    0.01083    0.00369    0.00679    0.00239    0.00416    0.00152    0.00251    0.00094    0.00149    0.00059    0.00088    0.00038    0.00052    0.00024    0.00030    0.00013    0.00016    0.00007    0.00008    0.00003    0.00004    0.00002    0.00002    0.00000    0.00001   -0.00000    0.00000   -0.00000    0.00000
   2.5000  0.64445E+03 1.000000     78  Reff  Ext  Alb  Nrank
1     1.00000    2.45952    3.71524    4.25487    4.84729    5.36645    5.85611    6.42473    6.97182    7.42414    7.99454    8.29742    8.77464    9.04259    9.37965    9.65296    9.91685   10.17376   10.42822   10.63443   10.88446   11.03799   11.24965   11.35631   11.49207   11.55104   11.59345   11.59797   11.54761   11.49233   11.35613   11.24296   11.02982   10.86614   10.58902   10.38244   10.05896    9.81689    9.46349    9.19725    8.82483    8.54960    8.16924    7.89393    7.52080    7.24098    6.87835    6.58433    6.21301    5.89756    5.49059    5.12943    4.66513    4.22869    3.71499    3.21482    2.70890    2.20551    1.80500    1.43088    1.20975    0.99660    0.86217    0.63050    0.52187    0.26260    0.24864    0.06519    0.10719    0.02105    0.03321    0.00277    0.02430   -0.00016    0.01581   -0.00034    0.01017   -0.00000    0.00002
2     0.00000    0.00000    4.36820    4.73287    5.18553    5.50520    6.07252    6.43891    7.12987    7.43241    8.09811    8.34108    8.84241    9.09462    9.44174    9.68959    9.98393   10.19077   10.49978   10.64063   10.95679   11.04061   11.32242   11.35845   11.56699   11.55287   11.67265   11.59843   11.63238   11.49024   11.44674   11.23747   11.12584   10.85667   10.68967   10.36857   10.16337    9.79835    9.57075    9.17400    8.93391    8.52180    8.27904    7.86190    7.63053    7.20542    6.98773    6.54657    6.32181    5.85928    5.59856    5.09279    4.77194    4.19539    3.81837    3.18525    2.80405    2.17824    1.88680    1.40151    1.27487    0.96789    0.91710    0.60978    0.56470    0.24918    0.27423    0.05835    0.11915    0.01922    0.03972    0.00191    0.02848   -0.00017    0.01778   -0.00035    0.01072   -0.00000    0.00002
3     0.00000    0.00000    4.22202    4.74896    5.13994    5.44274    6.06055    6.39669    7.08633    7.43674    8.03993    8.35709    8.80260    9.08492    9.43316    9.66222    9.97677   10.17620   10.47253   10.64824   10.91192   11.05865   11.27589   11.37028   11.53112   11.55317   11.64811   11.59020   11.61391   11.47751   11.43144   11.22143   11.11321   10.83811   10.67729   10.35129   10.14654    9.78598    9.54799    9.16485    8.90895    8.51210    8.25244    7.85528    7.59571    7.20806    6.94316    6.55366    6.27761    5.86014    5.56200    5.08727    4.73909    4.18775    3.78450    3.17704    2.76008    2.18059    1.82751    1.39531    1.23262    0.96404    0.88672    0.60274    0.51493    0.24972    0.22329    0.06581    0.08702    0.02436    0.02095    0.00796    0.00909   -0.00003   -0.00025   -0.00038   -0.00015    0.00000    0.00001
4     0.93876    2.49880    3.64698    4.27321    4.85347    5.33858    5.87054    6.41395    6.94340    7.44405    7.94759    8.32082    8.74654    9.03932    9.38148    9.63555    9.91899   10.17122   10.41114   10.65484   10.85194   11.06935   11.21772   11.38242   11.47238   11.56728   11.58658   11.60778   11.54854   11.49970   11.36213   11.24901   11.04040   10.87167   10.60162   10.39123   10.06879    9.83230    9.46904    9.21723    8.82960    8.57018    8.17330    7.91860    7.51716    7.27541    6.86539    6.62309    6.20062    5.92973    5.48548    5.15488    4.66305    4.25137    3.71089    3.23570    2.69256    2.23464    1.77054    1.44675    1.18790    1.01149    0.84958    0.64002    0.48614    0.27495    0.20718    0.08003    0.08143    0.03132    0.01909    0.01300    0.00859    0.00277   -0.00026    0.00070   -0.00014    0.00000    0.00001
5     0.00000    0.00000   -0.01324   -0.09387    0.01168   -0.07894    0.03870    0.00089    0.01446    0.07601   -0.03965    0.09348   -0.04703    0.02836   -0.00738   -0.03792    0.02935   -0.05519    0.03234   -0.02218    0.01615    0.02214   -0.00208    0.05480   -0.01215    0.06959   -0.01281    0.06984   -0.01066    0.06158   -0.00898    0.05009   -0.00823    0.03852   -0.00923    0.02920   -0.01332    0.02255   -0.01985    0.01514   -0.02511    0.00141   -0.02793   -0.01898   -0.03466   -0.04160   -0.04987   -0.06582   -0.06742   -0.09297   -0.08327   -0.11487   -0.09321   -0.11525   -0.08978   -0.08908   -0.06292   -0.05606   -0.01639   -0.02863   -0.00578   -0.07451   -0.03538   -0.06961   -0.01401   -0.02590   -0.00851   -0.01671   -0.00630   -0.00508    0.00694   -0.00335    0.00496    0.00051   -0.00163   -0.00003   -0.00238    0.00004   -0.00001
6     0.00000    0.00000   -0.04781    0.02711   -0.07968    0.03812   -0.01804   -0.00503    0.05381   -0.00211    0.06667    0.05723    0.02307    0.11995   -0.00768    0.11497    0.01968    0.07387    0.07040    0.03900    0.11319    0.04199    0.13318    0.07675    0.14351    0.12337    0.15461    0.16755    0.17048    0.20448    0.19165    0.23373    0.21571    0.25567    0.23989    0.27092    0.26152    0.28138    0.27744    0.28906    0.28651    0.29209    0.29172    0.28658    0.29644    0.27665    0.29950    0.27418    0.29867    0.28403    0.30107    0.30414    0.31726    0.32309    0.33983    0.32374    0.33791    0.28849    0.28968    0.19341    0.16755    0.12958    0.15240    0.13007    0.14948    0.05554    0.08696    0.00423    0.03414    0.00458    0.00172   -0.00271    0.00146   -0.00103    0.00064   -0.00040    0.00037   -0.00004   -0.00000

In [ ]: