PySDM_examples.Alpert_and_Knopf_2016.table_1

  1from PySDM_examples.Alpert_and_Knopf_2016.table import Table
  2
  3from PySDM.initialisation.spectra import Lognormal, TopHat
  4from PySDM.physics import si
  5
  6
  7class Table1(Table):
  8    def label(self, key):
  9        if isinstance(self[key]["ISA"], Lognormal):
 10            return (
 11                f"σ=ln({int(self[key]['ISA'].s_geom)}),"
 12                f"N={int(self[key]['ISA'].norm_factor * self.volume)}"
 13            )
 14        return key
 15
 16    def __init__(self, *, volume=1 * si.cm**3):
 17        super().__init__(
 18            volume=volume,
 19            data={
 20                "Iso1": {
 21                    "ISA": Lognormal(
 22                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 23                    ),
 24                    "color": "#298131",
 25                    "J_het": 1e3 / si.cm**2 / si.s,
 26                },
 27                "Iso2": {
 28                    "ISA": Lognormal(
 29                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 30                    ),
 31                    "color": "#9ACFA4",
 32                    "J_het": 1e3 / si.cm**2 / si.s,
 33                },
 34                "Iso3": {
 35                    "ISA": Lognormal(
 36                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 37                    ),
 38                    "color": "#1A62B4",
 39                    "J_het": 1e3 / si.cm**2 / si.s,
 40                },
 41                "Iso4": {
 42                    "ISA": Lognormal(
 43                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 44                    ),
 45                    "color": "#95BDE1",
 46                    "J_het": 1e3 / si.cm**2 / si.s,
 47                },
 48                "IsoWR": {
 49                    "ISA": Lognormal(
 50                        norm_factor=1000 / volume,
 51                        m_mode=6.4e-3 * si.cm**2,
 52                        s_geom=9.5,
 53                    ),
 54                    "color": "#FED2B0",
 55                    "J_het": 6e-4 / si.cm**2 / si.s,
 56                },
 57                "IsoBR": {
 58                    "ISA": TopHat(
 59                        norm_factor=63 / volume,
 60                        endpoints=(9.4e-8 * si.cm**2, 7.5e-7 * si.cm**2),
 61                    ),
 62                    "color": "#FED2B0",
 63                    "J_het": 2.8e3 / si.cm**2 / si.s,
 64                },
 65                "IsoHE1": {
 66                    "ISA": Lognormal(
 67                        norm_factor=40 / volume, m_mode=1.2 * si.cm**2, s_geom=2.2
 68                    ),
 69                    "color": "#FED2B0",
 70                    "J_het": 4.1e-3 / si.cm**2 / si.s,
 71                },
 72                "IsoHE2": {
 73                    "ISA": Lognormal(
 74                        norm_factor=40 / volume, m_mode=2e-2 * si.cm**2, s_geom=8.5
 75                    ),
 76                    "color": "#FED2B0",
 77                    "J_het": 2e-2 / si.cm**2 / si.s,
 78                },
 79                "IsoDI1": {
 80                    "ISA": Lognormal(
 81                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 82                    ),
 83                    "J_het": 1.8e-2 / si.cm**2 / si.s,
 84                    "color": "#9ACFA4",
 85                },
 86                "IsoDI2": {
 87                    "ISA": Lognormal(
 88                        norm_factor=45 / volume, m_mode=5.1e-2 * si.cm**2, s_geom=3.2
 89                    ),
 90                    "J_het": 1 / si.cm**2 / si.s,
 91                    "color": "#FED2B0",
 92                },
 93                "IsoDI3": {
 94                    "ISA": Lognormal(
 95                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 96                    ),
 97                    "J_het": 1 / si.cm**2 / si.s,
 98                    "color": "#95BDE1",
 99                },
100            },
101        )
  8class Table1(Table):
  9    def label(self, key):
 10        if isinstance(self[key]["ISA"], Lognormal):
 11            return (
 12                f"σ=ln({int(self[key]['ISA'].s_geom)}),"
 13                f"N={int(self[key]['ISA'].norm_factor * self.volume)}"
 14            )
 15        return key
 16
 17    def __init__(self, *, volume=1 * si.cm**3):
 18        super().__init__(
 19            volume=volume,
 20            data={
 21                "Iso1": {
 22                    "ISA": Lognormal(
 23                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 24                    ),
 25                    "color": "#298131",
 26                    "J_het": 1e3 / si.cm**2 / si.s,
 27                },
 28                "Iso2": {
 29                    "ISA": Lognormal(
 30                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 31                    ),
 32                    "color": "#9ACFA4",
 33                    "J_het": 1e3 / si.cm**2 / si.s,
 34                },
 35                "Iso3": {
 36                    "ISA": Lognormal(
 37                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 38                    ),
 39                    "color": "#1A62B4",
 40                    "J_het": 1e3 / si.cm**2 / si.s,
 41                },
 42                "Iso4": {
 43                    "ISA": Lognormal(
 44                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 45                    ),
 46                    "color": "#95BDE1",
 47                    "J_het": 1e3 / si.cm**2 / si.s,
 48                },
 49                "IsoWR": {
 50                    "ISA": Lognormal(
 51                        norm_factor=1000 / volume,
 52                        m_mode=6.4e-3 * si.cm**2,
 53                        s_geom=9.5,
 54                    ),
 55                    "color": "#FED2B0",
 56                    "J_het": 6e-4 / si.cm**2 / si.s,
 57                },
 58                "IsoBR": {
 59                    "ISA": TopHat(
 60                        norm_factor=63 / volume,
 61                        endpoints=(9.4e-8 * si.cm**2, 7.5e-7 * si.cm**2),
 62                    ),
 63                    "color": "#FED2B0",
 64                    "J_het": 2.8e3 / si.cm**2 / si.s,
 65                },
 66                "IsoHE1": {
 67                    "ISA": Lognormal(
 68                        norm_factor=40 / volume, m_mode=1.2 * si.cm**2, s_geom=2.2
 69                    ),
 70                    "color": "#FED2B0",
 71                    "J_het": 4.1e-3 / si.cm**2 / si.s,
 72                },
 73                "IsoHE2": {
 74                    "ISA": Lognormal(
 75                        norm_factor=40 / volume, m_mode=2e-2 * si.cm**2, s_geom=8.5
 76                    ),
 77                    "color": "#FED2B0",
 78                    "J_het": 2e-2 / si.cm**2 / si.s,
 79                },
 80                "IsoDI1": {
 81                    "ISA": Lognormal(
 82                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 83                    ),
 84                    "J_het": 1.8e-2 / si.cm**2 / si.s,
 85                    "color": "#9ACFA4",
 86                },
 87                "IsoDI2": {
 88                    "ISA": Lognormal(
 89                        norm_factor=45 / volume, m_mode=5.1e-2 * si.cm**2, s_geom=3.2
 90                    ),
 91                    "J_het": 1 / si.cm**2 / si.s,
 92                    "color": "#FED2B0",
 93                },
 94                "IsoDI3": {
 95                    "ISA": Lognormal(
 96                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 97                    ),
 98                    "J_het": 1 / si.cm**2 / si.s,
 99                    "color": "#95BDE1",
100                },
101            },
102        )
Table1(*, volume=1.0000000000000002e-06)
 17    def __init__(self, *, volume=1 * si.cm**3):
 18        super().__init__(
 19            volume=volume,
 20            data={
 21                "Iso1": {
 22                    "ISA": Lognormal(
 23                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 24                    ),
 25                    "color": "#298131",
 26                    "J_het": 1e3 / si.cm**2 / si.s,
 27                },
 28                "Iso2": {
 29                    "ISA": Lognormal(
 30                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=1
 31                    ),
 32                    "color": "#9ACFA4",
 33                    "J_het": 1e3 / si.cm**2 / si.s,
 34                },
 35                "Iso3": {
 36                    "ISA": Lognormal(
 37                        norm_factor=1000 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 38                    ),
 39                    "color": "#1A62B4",
 40                    "J_het": 1e3 / si.cm**2 / si.s,
 41                },
 42                "Iso4": {
 43                    "ISA": Lognormal(
 44                        norm_factor=30 / volume, m_mode=1e-5 * si.cm**2, s_geom=10
 45                    ),
 46                    "color": "#95BDE1",
 47                    "J_het": 1e3 / si.cm**2 / si.s,
 48                },
 49                "IsoWR": {
 50                    "ISA": Lognormal(
 51                        norm_factor=1000 / volume,
 52                        m_mode=6.4e-3 * si.cm**2,
 53                        s_geom=9.5,
 54                    ),
 55                    "color": "#FED2B0",
 56                    "J_het": 6e-4 / si.cm**2 / si.s,
 57                },
 58                "IsoBR": {
 59                    "ISA": TopHat(
 60                        norm_factor=63 / volume,
 61                        endpoints=(9.4e-8 * si.cm**2, 7.5e-7 * si.cm**2),
 62                    ),
 63                    "color": "#FED2B0",
 64                    "J_het": 2.8e3 / si.cm**2 / si.s,
 65                },
 66                "IsoHE1": {
 67                    "ISA": Lognormal(
 68                        norm_factor=40 / volume, m_mode=1.2 * si.cm**2, s_geom=2.2
 69                    ),
 70                    "color": "#FED2B0",
 71                    "J_het": 4.1e-3 / si.cm**2 / si.s,
 72                },
 73                "IsoHE2": {
 74                    "ISA": Lognormal(
 75                        norm_factor=40 / volume, m_mode=2e-2 * si.cm**2, s_geom=8.5
 76                    ),
 77                    "color": "#FED2B0",
 78                    "J_het": 2e-2 / si.cm**2 / si.s,
 79                },
 80                "IsoDI1": {
 81                    "ISA": Lognormal(
 82                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 83                    ),
 84                    "J_het": 1.8e-2 / si.cm**2 / si.s,
 85                    "color": "#9ACFA4",
 86                },
 87                "IsoDI2": {
 88                    "ISA": Lognormal(
 89                        norm_factor=45 / volume, m_mode=5.1e-2 * si.cm**2, s_geom=3.2
 90                    ),
 91                    "J_het": 1 / si.cm**2 / si.s,
 92                    "color": "#FED2B0",
 93                },
 94                "IsoDI3": {
 95                    "ISA": Lognormal(
 96                        norm_factor=45 / volume, m_mode=5.1e-1 * si.cm**2, s_geom=3.2
 97                    ),
 98                    "J_het": 1 / si.cm**2 / si.s,
 99                    "color": "#95BDE1",
100                },
101            },
102        )
def label(self, key):
 9    def label(self, key):
10        if isinstance(self[key]["ISA"], Lognormal):
11            return (
12                f"σ=ln({int(self[key]['ISA'].s_geom)}),"
13                f"N={int(self[key]['ISA'].norm_factor * self.volume)}"
14            )
15        return key