Chentao Yang's page

Codes for Astronomy

RADEX + emcee (Python code)

Perform non-LTE modeling with MCMC (emcee+RADEX). This code combines emcee and RADEX, performing MCMC sampling on the RADEX-parameters space without predefined grids, which leads to faster convergence time and a better sampling of the parameter space.

Fork here.

Extract spectra from uvfit/image files (GILDAS script)

These two scripts are intended for extracting the velocity, flux, and flux error in each channel from the current *.UVFIT file after performing uvfit, or from the selected region under "go view" in GILDAS. The resulting spectra will be stored in an ASCII file.

Download uvfit2txt.map and spec2txt.map.

Plotting radial integrated profile from FITS images (IDL)

Sometimes, you need to know the total power in a particular radius of a FITS image and the growth of this total power along the radius you choose. This is very useful for checking whether the object is extended or contains some ring or disk structures. Therefore, this script could be beneficial for those kinds of quick checks.

Download radial_power.pro.

Filling histogram-style (psym=10) spectral plot with colors (IDL)

It can be difficult when plotting the spectra with IDL with the area between the "flux" and continuum filled in some color. I first tried the POLYFILL but failed with the PSYM. Namely, I was unable to set PSYM=10 if using POLYFILL directly. Then I tried to search for any .pro file written by others for this purpose but it turned out to be nothing. So this pro could be useful when plotting some spectrum (e.g., CO, HCN, CS) and filling them with some color, yellow, for instance.

Download fillspec.pro.