code and scripts for finding main halos, making histograms and 2D projected maps, and analysing those products in FIRE simulations
This is an in-development set of scripts, not a polished package. Many
of the scripts are in flux, especially those in queuerun
and
makeplots
, and I do have a tendency to do development on the main
branch (especially if it's unlikely to break something important).
Because I'm updating this a lot, it's simpler to just use git pulls
instead of running an installation every time. However, I have provided
a condaenv_firep1.yml
file that includes the python packages required
to run these scripts. It can be used to set up a conda environment
where this code should run.
Note that a few functions requires additional packages, such as Andrew Wetzel's FIRE analysis code. I haven't included these here, since these are no longer the defaults I use.
Note that the main projection code and ion balance calculations call some compiled C code. I don't have that publicly available right now, because I did not write the SPH projection code myself (I only made small modifications), and I have not gotten around to asking the authors for permission.
The utils
directory should contain a file called opts_locs.py
. This
file simply lists a number of files and directories needed to run the
code, such as where to search for simulation outputs, and where to store
halo data. Some example files opts_locs_<system>.py
are provided.
Note that the kernel_list
, desngb
, solar_abunds_ea
, and Zsun_ea
variables do not need to be changed. They're basically just stored here
because this started off as a parameter file.
Storing files as opts_locs_<system>.py
and copying those to
opts_locs.py
locally is recommended, as it provides a back-up for the
setups on github, without constantly overwriting local locations.
(utils/opts_locs.py
is included in .gitignore for this reason.)
To run, for example, run.py
, options are:
- run from the directory above
fire_an
as(This will raise an error becausepython -m fire_an/queuerun/run -3
run.py
only takes postive integer arguments, but it also won't accidentally start an hour-long process on a login node.) - or add the directory above fire_an (e.g.
foo
) toPYTHONPATH
:and then, from anywhere, run:export PYTHONPATH="/path/to/foo/:${PYTHONPATH}"
or specify an absolute or relative path topython -m fire_an.queuerun.run -3
run.py
from your current directory:python /path/to/fire_an/queuerun/run.py -3
This is basically an issue of the different scripts in different
directories needing to be able to find each other. Running from the
directory above fire_an
adds that directory to PYTHONPATH
, like
adding it to PYTHONPATH
explicitly does.
TODO
This repo is mainly for me to sync up in-progress work. Much of this code is untested, half-finished projects I abandoned, or work in progress. Also, I have a tendency to do work and testing on the main branch.
Note that tests are usually of the 'plot and see if it makes sense' form, not functions that will return a boolean value.