Full Pipeline
This project is maintained by jrvliet
This is the main page for the mockspec code. This code generates and analyzes synthetic quasar absorption line profiles in the circumgalactic medium around galaxies simulated with ART. It has been developed by Jacob Vander Vliet and Dr. Chris Churchill at New Mexico State University. The full details of how the code works can be found: here and here.
This code generates synthetic quasar absorption lines by running lines of sight (LOS) through a simulated galaxy made with ART. This repository has all the code required to generate and analyze the spectra.
There are a few steps that need to be taken before the code can be run.
ANA has an interesting behaviour where it finds the center of the galaxy, but is super bad at it. You need to find the center with Rockstar (found here and put it in manually. The Rockstar center is found in the halos* files and is the first halo listed. These files contain ALL the halos in the simulation, ordered by mass. Since we want the host galaxy, use the first line.
The coordinates are put in on the lines "xuser", "yuser", "zuser". The flag in front of "ioptCenter=1/2/3-->potential/HF/IFRIT" should be set to 2, indicating the center is from a halo finder if the simulation is a VELA, or 1 (indicating the center is the location of maximum potential) if the simulation is a dwarf. This setting is the biggest source of uncertainty in ANA. Always check the output Mvir and Rvir against the value from Rockstar, which is recorded along with the centers. If they differ by a significant amount, change the setting of ioptcenter and try again.
Line 30 of schedule_R.dat should be the single word 'test'. This is the prefix appended to the front of all files created by ANA. Change this to the galID, such as D9m4a or vela20v2.
The rest of the file should not be touched.
To setup control.dat, only change after the three repeated lines of "1. 129". The single number on the next line is the number of snapshots to run ANA on. Leave this as one. The rest of the file is the list of expansion parameters of the snapshots. Even if there are several numbers listed here, ANA will only run on the first one, since the number of snapshots to run is set to 1. Also, ensure the first line, labeled jobname1, is set to 10MpcBox_HartGal_csf. This is the large 10Mpc box that will be read.
Once both control.dat and schedule_R.dat are set, run ana.R.exe. The file needed is the GZ file. The necessary output files are named <galID>_GZa<expansion parameter>.txt (the gas box) and summary.txt (summary file).
readbinary.exe <binary file> <name of output ASCII file> GZ
The name of the output ASCII file should be the name of the binary file, but with .dat replaced with .txtinteger lspecies(nspec)
If you are analyzing a Vela of the 4th generation, this needs to be changed to:
integer*8 lspecies(nspec)
The other change is to use the correct a_setup.h file. The justGZ directory has three available: Dwarf_a_setup.h, VELA_a_setup.h, VELA4_a_setup.h. Copy the one you are using to a_setup.h and make the code.
To use this version, the directory has to be set up properly. There needs to be a directory called outputs in the location where you are running the code. This this directory there needs to be a directory called rockstar. There also needs to be find called input_.txt. This file is output by the Rockstar code.
When the code is run, it will output the GZ box in ASCII into the output directory. It will be called _GZa.txt. There will also be a file called ioread.txt which is the screen output of ANA and a file called rotmat_a.txt. This contains the rotation matrix for the box.
The main driver is mockspec.py. Run this in the directory with the snapshot. Everything is controlled by the mockspec.config file.
The code generates several files along the way:
Most of the outputs are stored in the HDF5 file format. This format results in smaller output files that write and read faster than plain text and is the industry standard. To access the files, it is helpful to know the columns included in each file:
abs_cells:
ALL.sysabs:
Gasbox: