Skip to main content

A Python interface to the NEMESIS spectral inversion tool

Project description

Eleos - A Python interface to NEMESIS

This is a WIP project and features may be added/removed at any time. Full documentation will be added in due course.

Core Generation Example

This code generates 4 cores, each with a different forward modelling error factor. It retrieves the temeprature profile using a prior from a file (tempapr.dat), the ammonia profile represented as a knee pressure (model 1 in NEMESIS), and an aerosol layer represented as model 32. It then generates a submission script to run NEMESIS using those cores on ALICE.

from eleos import shapes, profiles, cores

nh3_shape = shapes.Shape1(knee_pressure=0.1, 
                          deep_vmr=1e-4, 
                          deep_vmr_error=1e-4, 
                          fsh=0.3, 
                          fsh_error=0.3)
aero_shape = shapes.Shape32(base_pressure=0.8, 
                            base_pressure_error=0.5, 
                            opacity=1, 
                            opacity_error=0.3,
                            fsh=0.4,
                            fsh_error=0.2)


nh3_profile = profiles.GasProfile(gas_name="NH3", 
                                  isotope_id=0, 
                                  shape=nh3_shape)
aero_profile = profiles.AerosolProfile(aerosol_id=1, 
                                       shape=aero_shape)
temp_profile = profiles.TemperatureProfile(filepath="./data/jupiter/tempapr.dat")


core_list = []
for n in range(1, 5):
    core = cores.NemesisCore(parent_directory=f"cores/",
                             spx_file="/home/s/scat2/JWST/2022_JupSouthPole/zonal_spectra/sparse_55.0degS.spx",
                             ref_file="data/jupiter/jupiter.ref",
                             profiles=[temp_profile, nh3_profile, aero_profile],
                             fmerror_factor=n)
    core_list.append(core)

cores.generate_alice_job(cores=core_list, username="scat2")

Result Analysis Example

This code takes the result of running NEMESIS on the output of the above example and plots the retrieved spectrum and temperature profile, then saves it to a file.

res = NemesisResult("cores/core_1/")
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12,5))
res.plot_spectrum(ax=ax1)
res.plot_temperature(ax=ax2)
plt.tight_layout()
fig.savefig("nosync/temp.png", dpi=500)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nemesis_eleos-0.5.2.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nemesis_eleos-0.5.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file nemesis_eleos-0.5.2.tar.gz.

File metadata

  • Download URL: nemesis_eleos-0.5.2.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for nemesis_eleos-0.5.2.tar.gz
Algorithm Hash digest
SHA256 8fefd51d1098436f0a4aa90fac454d106f57df844110ae87ad16b95327a48e70
MD5 85dfdbce6bc43d2dc7ae6070bfc3ab9a
BLAKE2b-256 cbf315587ab513f2e21012bab8c6997871a32f44435adfb0488f043f15f49ed5

See more details on using hashes here.

File details

Details for the file nemesis_eleos-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: nemesis_eleos-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for nemesis_eleos-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ceeb2ddb982243c6c871aee420c4084708d5f8ce71c16a0a68f3ac1c5ca4d8de
MD5 eea5ba82ad2431e8e3f74a78ac672b32
BLAKE2b-256 ade1400fdc52a2cbafbf7a810aaa6873b56e57cb1338c54fe9b48117bce3af98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page