Commit 1ff43e82 authored by Maxime Rey's avatar Maxime Rey
Browse files

Bugfix + small stuff: wrong saving name for radcol + small improvements/aesthetics.

parent a6d2859c
......@@ -351,12 +351,12 @@ def qtymap(RamsesDir, timestep, zoom=1/0.7, factor=1, var_str='nH', wei_str="nH"
qty = vec_J_loc[:,1] /1.989e33/3.086e21/1e5 # [kpc Msun km/s]
cmap_color = 'seismic_r'
cbar_label = r'J [kpc M$_\odot$ km s$^{-1}$'
elif (var_str=='MgII') or (var_str=='CIV') or (var_str=='OVI') or (var_str=='HI'):
elif (var_str=='MgII') or (var_str=='CIV') or (var_str=='OVI'):
# raise ValueError('Not implemented yet ;) (but quick to do)')
cells_ions = ras.extract_ions(RamsesDir, timestep, var_str)
cells_ions = ras.extract_ions(RamsesDir, timestep, var_str, factor=factor)
qty = cells_ions
cmap_color = 'magma'
cbar_label = var_str + r'$ {\rm [atom. cm^{-2}]}$'
cbar_label = fr'$\rm N_{{{var_str}}}\ {{[atom. cm^{{-2}}]}}$'
else:
raise ValueError("Wrong var_str, choose amongst 'T', 'rho', 'nH', vz' or an ion.")
......@@ -423,6 +423,8 @@ def qtymap(RamsesDir, timestep, zoom=1/0.7, factor=1, var_str='nH', wei_str="nH"
raise ValueError("You shouldn't use weights for a column density. Replace weight by 'None'.")
column_factor = (zmax-zmin)*cu2cm # -> ergs s-1 cm-2
map2plot = map2plot*column_factor
if not((var_str=='MgII') or (var_str=='CIV') or (var_str=='OVI')): # Have to do something smarter for units ! x)
cbar_label+=r'[cm]'
if centered:
extent = xmin_c*cu2kpc,xmax_c*cu2kpc,ymin_c*cu2kpc,ymax_c*cu2kpc # [kpc]
......@@ -462,7 +464,7 @@ def qtymap(RamsesDir, timestep, zoom=1/0.7, factor=1, var_str='nH', wei_str="nH"
plt.ylabel('[kpc]')
if (var_str=='J') or (var_str=='J_cold'):
if (var_str=='J') or (var_str=='J_cold') or (cmap_color=='magma'):
c_lab = 'k'
else:
c_lab = 'w'
......
......@@ -147,20 +147,16 @@ def PDF(what2plot, genpath, folders, timesteps, labels, weight=None, density=Fal
else:
weight2use=None
if what2plot=='star_mass':
star_mass, _, _, _, _, _, _, _, _, _, _ = \
ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
star_mass, _, _, _, _, _, _, _, _, _, _ = ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
temp_var, x_label = star_mass*g2Msun, r'Stellar mass [M$_\odot$]'
elif what2plot=='star_age':
_, _, _, _, _, star_age, _, _, _, _, _ = \
ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
_, _, _, _, _, star_age, _, _, _, _, _ = ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
temp_var, x_label = star_age, 'Stellar age [Myr]'
elif what2plot=='star_mets':
_, _, _, _, _, _, _, _, _, star_mets, _ = \
ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
_, _, _, _, _, _, _, _, _, star_mets, _ = ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
temp_var, x_label = star_mets, r'Stars metallicity [Z$_\odot$]'
elif what2plot=='star_minit':
_, _, _, _, _, _, _, _, _, _, star_minit = \
ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
_, _, _, _, _, _, _, _, _, _, star_minit = ras.extract_stars(RamsesDir, timestep, factor=factor, saveinfile=saveinfile, rmsat=rmsat)
temp_var, x_label = star_minit*g2Msun, r'Stellar mass [M$_\odot$]'
else:
raise ValueError('This parameter either does not exist or is not included yet.')
......@@ -889,7 +885,7 @@ def rad_col(genpath, folders, timesteps, labels, r_max=150, lmax=18, var_str='HI
except KeyError:
pass
else:
base_name = f'out_{var_str}_{timestep:05d}_{r_max}_{lmax}'
base_name = f'{var_str}_{timestep:05d}_{r_max}_{lmax}'
if rmsat:
base_name = base_name+'_nosat'
try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment