Generating Multiple NEMESIS Cores
The process of generating multiple NEMESIS cores with eleos is much the same as generating a single core. This example will generate a set of cores, each with a different opacity for a stratospheric haze layer and run them as an array job on ALICE. Each core gets the same summary plots and tables created as in the first example.
1from eleos import cores, shapes, profiles
2import numpy as np
3
4
5# Define a parameterised phosphine profile
6ph3 = profiles.GasProfile(gas_name="PH3",
7 shape=shapes.Shape20(
8 knee_pressure=1.0,
9 tropopause_pressure=0.1,
10 deep_vmr=1.86e-6, deep_vmr_error=0.2e-6,
11 fsh=0.2, fsh_error=0.1))
12
13
14# And a thick cloud layer
15main = profiles.AerosolProfile(label="Main Cloud",
16 retrieve_optical=True,
17 shape=shapes.Shape48(
18 base_pressure=2, base_pressure_error=0.5,
19 top_pressure=0.1, top_pressure_error=0.2,
20 opacity=1, opacity_error=0.5,
21 fsh=0.3, fsh_error=0.05),
22 radius=3.0, radius_error=0.1,
23 variance=0.5, variance_error=0.2,
24 real_n=1.3,
25 imag_n=1e-3, imag_n_error=1e-3)
26
27# And a thin haze layer
28haze = profiles.AerosolProfile(label="Haze",
29 retrieve_optical=True,
30 shape=shapes.Shape37(
31 bottom_pressure=0.1,
32 top_pressure=0.01,
33 opacity=0.25, opacity_error=0.1),
34 radius=0.34, radius_error=0.02,
35 variance=0.3, variance_error=0.3,
36 real_n=1.3,
37 imag_n=1e-3, imag_n_error=1e-3)
38
39# Clear the target directory
40cd = "multiple_example/"
41cores.clear_parent_directory(cd)
42
43# Loop over the desired haze opacities
44for haze_opacity in np.arange(1e-20, 2.25, 0.25):
45
46 # Set the haze opacity
47 haze.opacity = haze_opacity
48
49 # Create and generate the core as normal
50 core = cores.NemesisCore(cd,
51 spx_file="data/nearnadir.spx",
52 profiles=[ph3, main, haze],
53 fmerror_factor=4,
54 reference_wavelength=4)
55
56 core.set_pressure_limits(min_pressure=1e-3, max_pressure=10)
57
58 core.generate_core()
59
60# Run the cores an an array job on ALICE
61cores.generate_alice_job(cd, python_env_name="pythonmain", username="scat2", hours=24)
62cores.run_alice_job(cd)