- Create a new environment
module load python
module load jupyter-kernels
module load fi-utils
VENVDIR=/mnt/home/kiyer/jhive/
python -m venv --system-site-packages $VENVDIR/jhive_env
source $VENVDIR/jhive_env/bin/activate
- Clone the FSPS repository
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def find_nep(sfh_input, timeax, fname, vb = False): | |
| # code to find the number of major episodes of star formation comprisinga galaxy's SFH | |
| # | |
| # inputs: | |
| # sfh_input - 1D numpy array of star formation rates at various times | |
| # timeax - 1D numpy array of the times at which the SFRs are recorded |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| sns.set(font_scale=1.8) | |
| sns.set_style('white') | |
| # generate some suitably weird random data | |
| pdfsize = 1000000 |
| # ------------------------------------------------------- | |
| # Script to find close pairs in the CANDELS catalog | |
| # By: Kartheik Iyer [Oct 22, 2020] | |
| # ------------------------------------------------------- | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from astropy.cosmology import FlatLambdaCDM | |
| cosmo = FlatLambdaCDM(H0=70, Om0=0.3) | |
| from astropy import units as u |
| #------------------------------------------------------------------------------- | |
| import matplotlib.pyplot as plt | |
| import matplotlib | |
| # set font and figure sizes here - change these according to your preference | |
| ticksize = 18 | |
| labelsize = 24 | |
| legendsize = 18 | |
| matplotlib.rc('xtick', labelsize=ticksize) | |
| matplotlib.rc('ytick', labelsize=ticksize) |
| # get the dispersion function from: | |
| # https://jwst-docs.stsci.edu/jwst-near-infrared-spectrograph/nirspec-instrumentation/nirspec-dispersers-and-filters | |
| # and put it in the _data_path folder | |
| from astropy.table import Table | |
| from sedpy.smoothing import smoothspec | |
| _data_path = 'disp_curves/' | |
| grating = 'prism' | |
| disp = Table.read(f'{_data_path}jwst_nirspec_{grating}_disp.fits') |
| import scipy.stats | |
| # given an SedFit() object from dense basis, this code allows you to sample from the z-M* posterior | |
| # and can be adapted to more general cases as needed | |
| def sample_from_2d_dist(atlas, sedfit, nsamples, zbins = np.linspace(0, 3, 201), massbins = np.linspace(6,12,201)): | |
| zbin_centers = zbins[0:-1] + np.mean(np.diff(zbins))/2 | |
| massbin_centers = massbins[0:-1] + np.mean(np.diff(massbins))/2 | |
| hist = np.histogram2d(atlas['mstar']+np.log10(sedfit.norm_fac), | |
| atlas['zval'].ravel(), |
module load python
module load jupyter-kernels
module load fi-utils
VENVDIR=/mnt/home/kiyer/jhive/
python -m venv --system-site-packages $VENVDIR/jhive_env
source $VENVDIR/jhive_env/bin/activate
| #----------------------- | |
| def make_smooth_plot(truevals, predvals, lb, ub, nbins = 10, force_bw = True, bw = 0.3): | |
| xgrid = np.linspace(lb, ub, nbins) | |
| if force_bw == True: | |
| xbw = (ub-lb) * bw | |
| else: | |
| xbw = np.mean(np.diff(xgrid)) |
2024-09-26 09:14:44:
Headline: From Stellar Explosions to Quantum Black Holes: Unraveling the Mysteries of the Cosmos
Recent advancements in astrophysics and cosmology have unveiled exciting insights into the universe, ranging from the dynamics of supernovae to the enigmatic behavior of black holes. This column highlights several groundbreaking studies that push the boundaries of our understanding.
Neutrino Transport and Supernova Dynamics A significant leap in modeling core-collapse supernovae has been achieved by Santos-Pérez et al. (2024), who introduced a minimally implicit Runge-Kutta method for the numerical integration of neutrino transport equations. This innovative approach addresses the computational challenges posed by stiff equations in optically thick environments, enhancing the accuracy and efficiency of simulations. By applying this method to realistic supernova models, the authors provide a clearer picture of neutrino interactions with matter, w
2024-09-26 09:17:04:
Headline: From Machine Learning to Gravitational Waves: A New Era in Astrophysics Unfolds
Recent advancements in astrophysics and cosmology are reshaping our understanding of the universe, driven by innovative methodologies and cutting-edge technology. This month, a series of papers highlight significant breakthroughs in areas ranging from the discovery of ultracool dwarfs to the detection of gravitational waves, showcasing the power of machine learning and experimental techniques in modern astronomy.
Machine Learning and Stellar Discoveries: Unveiling Ultracool Dwarfs and Exoplanets
In a groundbreaking study, Brooks et al. (2024) have harnessed the power of machine learning to identify 118 new ultracool dwarf candidates using the SMDET tool, significantly enhancing the efficiency of data analysis from the Wide-field Infrared Survey Explorer (WISE). This advancement builds on previous efforts that relied on manual classification, allowing