Metadata-Version: 2.4
Name: merlin-spectra
Version: 0.0.2
Summary: Interface with Cloudy Photoionization Software data and RAMSES-RT Simulation data to create galaxy images and spectra in nebular emission lines.
Project-URL: Homepage, https://github.com/BradenN6/Merlin
Author-email: Braden Nowicki <bnowicki@terpmail.umd.edu>
License-File: LICENSE
Keywords: JWST,astrophysics,spectra
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.10
Requires-Dist: astropy>6.1
Requires-Dist: matplotlib>3.10
Requires-Dist: numpy>1.26
Requires-Dist: pandas>2.2
Requires-Dist: scipy>1.15
Requires-Dist: yt>4.4
Description-Content-Type: text/markdown

# Merlin

## Nebular Line Emission Diagnostics from Cosmological Simulations of 
## Early Universe Galaxies.

Author: Braden Nowicki
Advisor: Dr. Massimo Ricotti

Interface with Cloudy Photoionization Software data and RAMSES-RT Simulation
data to create galaxy images and spectra in nebular emission lines.


### File Structure:

MERLIN

merlin/ : primary package for analysis and visualizations
CloudyFiles/ : files related to Cloudy grid runs.
Reference/ : previously-developed analysis code.

#### Creating a Line List with Cloudy

The Cloudy Photoionization Code is used to generate line emission (flux)
throughout the desired parameter space. We consider gas parameters
Ionization Parameter, Hydrogen Number Density, and Temperature.
A simple grid run is performed, simulating emission for lines present in
CloudyFiles/gridrun/LineList_NebularO.dat and
CloudyFiles/gridrun/LineList_NebularCN.dat (can be adjusted)
from a 1 cm thick gas cell. The exact conditions can be adjusted (the star
SED, for instance) for a given run; a simulation for every combination of the
varying parameters is performed. Line list data is output in
'LineList_NebularCN.dat' and 'LineList_NebularO.dat', then combined into a
single 'linelist.dat' file via 'combine_tables.py'.

See CloudyFiles/gridrun. interp6.in is the input file. The run file (with
executable privilege) can be used in your installation of Cloudy.
For instance, in the terminal, './run interp6' would run the desired
simulations (note that grid runs require the use of the -r option, present
in 'run', and therefore the input file is given as interp6, ommitting .in.)

#### Running Merlin on RAMSES-RT Output Data

'main.py' outlines the process: create derived field functions; load
the simulation given by the filepath (as a command line argument) pointing to
the info_*.txt file within an output folder; instantiate an
EmissionLineInterpolator object for the derived flux and luminosity
fields using the desired 'linelist.dat' table; instantiate a
VisualizationManager object; and run the desired routines/analysis for the
time slice.

The class structures allow for easy testing of new features and updates.
One must call save_sim_info() for Object variables like current_redshift
to be created; afterwards, any function can be called in a modular fashion.
There are some exceptions: phase_with_profiles(), for instance, uses
an object generated by phase_plot().


#### Running in the Cluster on Multiple Time Slices
With the desired routines and field setup chosen in a driver script
like 'main.py', analysis can be performed on multiple time slices in parallel.
For RAMSES-RT output data stored in a cluster, use scp to copy merlin,
a driver script like 'main.py', and a shell script like 'analysis.sh'
to the cluster scratch space. Test that it works in the scratch space by
running 'main.py' on one time slice. You must first perform the module loads
and pip installs at the beginning of 'main.py' for the dependencies.
The shell script 'analysis.sh' shows one way to run the script on
multiple time slices in parallel (in one job).

#### Bulk Analysis of Multiple Time Slices


#### A Note on the Naming of this Code

The Merlin is a small species of falcon from the Northern Hemisphere.
The naming of this package is inspired by the Merlin's exceptionally sharp
eyesight; we generate observational diagnostics from simulated distant,
high-redshift galaxies. Birds are a bellwether of environmental decline;
populations are down nearly 3 billion birds since 1970. Please consider
supporting local efforts to safeguard birds, their migration, and their
habitats.
