Metadata-Version: 2.1
Name: nemesis_eleos
Version: 0.2
Summary: A Python interface to the NEMESIS spectral inversion tool
Home-page: https://github.com/simon-toogood/eleos
Author: Simon Toogood
Author-email: Simon Toogood <scat2@leicester.ac.uk>
License: MIT License
        
        Copyright (c) [year] [fullname]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/simon-toogood/eleos
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10, <4
Description-Content-Type: text/markdown
License-File: LICENSE

# 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.

```python

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. 

```python
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)
```


