Some functions used to handle Illustris and IllustrisTNG data. Especially designed for my prolate JAM project. Some scripts are modified from Hongyu Li's code: https://github.com/HongyuLi2016/illustris-tools
This is a package, so please add the corresponding path into $PYTHONPATH.
data
:StarData.py
: contains a most general class StarData.
beta
: contains scripts used for measuring the distribution of the anisotropy parameter and velocity ellipsoids. For TNG galaxies, just add --TNG True and use --snapNum 99 instead of 135.StarData_Beta.py
: contains class StarData_Beta, which used StarData as the base class. It has a method to calculate the velocity dispersion tensor in a given spatial bin, a method to calculate the global anisotropy, and a method to calculate beta in spherical coordinates. There is also a function measureV2map. This function is much faster than StarData_Beta.measureV2Tensor if you want to calculate the dispersion tensor at a grid of linspace or logspace points.PlotBetaMap.py
: contains class PlotBetaMap, which used StarData_Beta as the base class. It has methods to plot beta distributions in the equatorial plane and the meridional plane. Can be run directly as python PlotBetaMap.py --subhaloID subhalo3 --shape oblate --snapNum 135.PlotVEMap.py
: contains class PlotVEMap, which used StarData_Beta as the base class. It has a method to plot velocity ellipsoids in the meridional plane. Can be run directly as python PlotVEMap.py --subhaloID subhalo3 --shape oblate --snapNum 135.getV2.py
: this is a script to get the measured dispersion tensors at a grid of linspace points in the meridional plane. Can be run as python getV2.py --subhaloID subhalo3 --shape oblate --snapNum 135.
mock
: make mock images, MGEs and Voronoi binned IFU data for a subhalo. See Hongyu's code: https://github.com/HongyuLi2016/illustris-tools. You can simply run python run.py --subhaloID subhalo3 --snapNum 135 --rotation oblate --phi 0 --inc 90. It will save all relavant files into a folder named subhalo3_p0_i90. For TNG galaxies, just add --TNG True, and change to --snapNum 99.makeImg.py
: python makeImg.py --subhaloID subhalo3 --rotation oblate --phi 0 --inc 90 will create mock images for a subhalo, after rotating the principal axes cooridinates into axes specified by phi, inc, pa (see Figure 1 of Monnet et al.1992). --rotation = oblate or prolate. "oblate rotation" means z axis is the shortest axis in principal axes coordinates, and "prolate rotation" means z is the longest. The output files will be in subhalo3_p0_i90/imgs.makeMGE.py
: python makeMGE.py --foldername subhalo3_p0_i90 will create MGE using the mock image (img_M.npy) generated by the first script. The output files will be in subhalo3_p0_i90/mge.makeIFUbins.py
: python makeIFUbins.py --foldername subhalo3_p0_i90 will create Voronoi bins for the IFU data. The output files will be in subhalo3_p0_i90/ifu.makeIFUdata.py
: python makeIFUdata.py --foldername subhalo3_p0_i90 will calculate mean velocity, velocity dispersion and their errors for the particles in each Voronoi bin. The output files will be in subhalo3_p0_i90/ifudumpIFUdata.py
: python dumpIFUdata.py --foldername subhalo3_p0_i90 will dump the IFU data into a fits file IFU.fits in subhalo3_p0_i90/ifu.v_plot.py
: python v_plot.py --foldername subhalo3_p0_i90 will read the IFU.fits file and plot the velocity maps. The output figure will be in subhalo3_p0_i90/ifu.