Open akshattripathi opened 5 months ago
I guess I also had to add the lines:
SFT = SFT[np.where(RedStar>=0)]
RadiusStar = RadiusStar[np.where(RedStar>=0)]
below: Eta = np.asarray(eta) - eta_galaxy
I also had to add the scale factor multiplication to the line:
HMSR = API.getSubhaloField('SubhaloHalfmassRadType',snapshot=snap,simulation='TNG50-1')[gal, 4]*scale_factor/h
This makes the results look more reasonable but still not as good. I'm testing it using the code:
orig = open('Data/snap96gal3/snap96gal3.dat')
new = open('snap96gal3/snap96gal3.dat')
x_orig, y_orig, z_orig = [], [], []
for line in orig.readlines():
x_orig.append(float(line.split()[0]))
y_orig.append(float(line.split()[1]))
z_orig.append(float(line.split()[2]))
x, y, z = [], [], []
for line in new.readlines():
x.append(float(line.split()[0]))
y.append(float(line.split()[1]))
z.append(float(line.split()[2]))
plt.scatter(x_orig, y_orig, c='b', marker='.');
plt.scatter(x, y, c='r', marker='.');
Yes, the file is provided for only one galaxy to run the example code. Files for other galaxies can be generated from TNG50_GalaxyFiles.ipynb. Please, bear in mind, as stated, that these codes are example codes that are meant to be adapted for your scientific case. These examples help getting started on a project involving either Illustris, or EAGLE.
Hello,
I'm running the code in file _iMaStarExample.ipynb (which, as far as I understand, takes a galaxy in TNG50 with its
snap
andgal
numbers and then spits out a synthetic data cube). After changing a few things (like unzipping the Mappings.tar.gz file and then putting it in the main directory, changing the version number from 0.2 to 1.1 in the _iMaStarfunctions.py file, putting the _MaStar_SSPv1.1.fits file in the correct directory and upgrading ppxf on my computer), I was able to run the code successfully. I have a few questions and I would greatly appreciate it if you can answer them for me.It seems as if the file _snap[snap_num]gal[galnum].dat is necessary to run the notebook _iMaStarExample.ipynb all the way through successfully. This file seems available only for one galaxy on Github. For the rest of the galaxies, I will be using the _TNG50GalaxyFiles.ipynb notebook to create the _snap[snap_num]gal[galnum].dat. For that file, I ran into some issues and wanted to see if what I'm doing makes sense:
1) In the _TNG50GalaxyFiles.ipynb notebook, is "a in"
SFT
just the scale factor? This is set when the different properties of the star particles are being defined in the block of code:2) In the _TNG50GalaxyFiles.ipynb notebook, when one is defining the galaxy, they also need to specify its redshift. Is that the
TNG_snap_redshift
or theobs_redshift
?Also, is
arr_down_miii+arr_down
the variable that's stored in the data cube fits files at https://www.tng-project.org/api/TNG50-1/files/imanga/?4) There seemed to have been a small error in the code
eta = cosmo.lookback_time(RedStar)
. SinceRedStar
is sometimes negative, this returned an error a few times. To fix this, I changed it toeta = cosmo.lookback_time(RedStar[RedStar >= 0])
. Is that ok? Can that be a possible problem down the line?5) In the same file, there seems to be a scale_factor multiplication missing that's making the code return blank data. I fixed it by changing the line that defines the center of mass to this:
SHP = API.getSubhaloField('SubhaloPos', simulation='TNG50-1', snapshot=snap)[gal]*scale_factor/h
and that seems to fix the problem!Thanks Akshat Tripathi