Labels

Wednesday, July 10, 2019

Tricks on ploting figure with matplotlib

plot error-bar and upper limit

# lower & upper limits of the error
lolims = np.array([0, 0, 1, 0, 1, 0, 0, 0, 1, 0], dtype=bool)
uplims = np.array([0, 1, 0, 0, 0, 1, 0, 0, 0, 1], dtype=bool)

ax.errorbar(x, y + 2.1, xerr=xerr, yerr=yerr,
            xlolims=xlolims, xuplims=xuplims,
            uplims=uplims, lolims=lolims,
            marker='o', markersize=8,
            linestyle='none')



plt.legend(frameon=False)









Reference:
https://matplotlib.org/3.1.0/gallery/statistics/errorbar_limits.html

Friday, July 5, 2019

Build scientific environment with Termux in Chromebook

bashrc
/data/data/com.termux/files/usr/etc/bash.bashrc

open new session
ctrl alt c

to next session
ctrl alt n

download file from google drive
curl gdrive.sh | sh -s https://drive.google.com/open?id=YOUR_SHARE_ID

Google Drive client for the commandline
https://github.com/odeke-em/drive

SSH login without password
a@A:~> ssh-keygen -t rsa
a@A:~> ssh b@B mkdir -p .ssh
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'

add user
sudo adduser mpiu --uid 999

Setting up SSH host shortnames
https://www.howtogeek.com/75007/stupid-geek-tricks-use-your-ssh-config-file-to-create-aliases-for-hosts/


/data/data/com.termux/files/usr/etc/bash.bashrc
show color for different extension
LS_COLORS=$LS_COLORS:'di=1;34:*.c=01;32:*.tex=01,31:*.py=01;35:*.c=01;32:*.pdf=0;36:'
export LS_COLORS

change font color in vim
edit in .vimrc
colo desert
syntax on

Thursday, July 4, 2019

Install latex in termux

1) pdflatex: can not found pdflatex.fmt
    texconfig rehash
2) not found  xx.sty
    tlmgr search --global --file xx.sty
    tlmgr install package_name
3) metric file not found
    tlmgr install collection-fontsrecommended

Thursday, May 23, 2019

Notes on emission from SNR

Disentangling hadronic from leptonic emission in G326.3−1.8
https://www.aanda.org/articles/aa/pdf/2018/09/aa33008-18.pdf
Assuming the sedov phase, we can derive the kinetic energy released by the supernova.
It is depended on the gas density.
Can the density be determined by observations.
We describe the electron population as a broken power-law spectrum with an exponential cutoff.
The break is assumed to be due to cooling, therefore we set $\Gamma_2=\Gamma_1+1$, while the cutoff defines the maximum attainable energy if the particles.
We report the range of permitted values of free parameters, such as the total energy and electron-proton ratio $K_{ep}$.
Since the maximum energy of protons is always higher than that of electrons, which suffer synchrotron losses and other losses, we used the maximum value of maximum electron energy as a lower limit.
For the source discussed in the paper, the leptonic model requires too much energy and results in the $K_{ep}$ too large.
From the derived relation between $\tau_{syn},t_{acc},B,u_{sh}$ et al., we can derive the break energy $E_b(\tau_{syn}=t_{age})$ (???) and maximum energy E_{max}(t_{acc}=min(\tau_{syn},t_{age})).

https://www.aanda.org/articles/aa/pdf/2019/03/aa33985-18.pdf


Non-thermal emission from the reverse shock of the youngest galactic Supernova remnant G1.9+0.3
 thermal-leakage injection model.
thermal leakage can not be the only injection mechanism for electrons. The shock thickness is commensurate with the gyro radius of the incoming protons, and only particles with Larmor radii a few times that see the shock as a discontinuity and can be accelerated by DSA. For typical SNR shock speeds, electrons would only get injected into the DSA process if their momentum is above a few tens of MeV/c.

However, a fraction of the electrons might be pre-accelerated at the shock, for instance by shock-surfing acceleration or shock drift acceleration.

we consider two realizations of the diffusion coefficient. The first option is to assume Bohm diffusion close to the shock and in the downstream region, and to have a transition to the galactic diffusion coefficient further upstream.


 Alternatively the amplification of Alfvenic turbulence can be explicitely treated by solving a sep- ´ arate wave transport equation and thus calculating the diffusion coefficient self-consistently (Brose et al. 2016).

Here we assumed Bohm-like diffusion in the downstream and in the upstream of the remnant up to a radius of 1.1 · Rsh. From 2 · Rsh we used the galactic diffusion coefficient, and an exponential profile connects the two regimes in the intermediate range.

Usually, just a few per cent of the thermal energy of the plasma are assumed to be transformed to magnetic-field energy - otherwise the evolution of SNRs should considerably deviate from purely hydrodynamical predictions.

The strong synchrotron cooling also has effects on the morphology of the remnant. In the emission profiles, the X-ray peak is always close behind the forward shock, as only recently accelerated electrons have sufficient energy to emit X-ray photons. Radio photons, on the other hand, can be emitted by all previously accelerated electrons in the downstream

---------
https://www.aanda.org/articles/aa/pdf/2009/37/aa11948-09.pdf

Resource-Astro


arXiver
bringing you the latest astronomy papers uploaded to astro-ph with figure

Kassiopeia: A Modern, Extensible C++ ParticleTracking Package



Women In Astronomy
https://womeninastronomy.blogspot.com/


The solution of cosmic rays propagation equation
http://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1982A%26A...116...10L&data_type=PDF_HIGH&whole_paper=YES&type=PRINTER&filetype=.pdf

cosmic rays diffusion coefficient in 2R_sun to 3au.
https://iopscience.iop.org/article/10.3847/1538-4365/aa74d2/pdf


solution of propagation and cosmic rays escape from galaxy
https://www.aanda.org/articles/aa/full/2008/13/aa8645-07/aa8645-07.right.html


inspiring discussion on B/C
COSMIC-RAY PROPAGATION IN THE GALAXY AND IN THE HELIOSPHERE: THE PATH-LENGTH DISTRIBUTION AT LOW ENERGY


Lecture Notes and Exercises on Astrophysical Gas Dynamics



Solving the inhomogeneous cosmic rays diffusion equation
Secondary cosmic positrons in an inhomogeneous diffusion model


High Energy Astrophysics and Astrophysical Gas Dynamics and Magnetohydrodynamics http://www.mso.anu.edu.au/~geoff/


Time-dependent escape of cosmic rays from supernova remnants, and their interaction with dense media


High Energy Observations of Galactic Supernova Remnants catalog


The evolution of SNR
https://www.astro.umd.edu/~richard/ASTR480/A480_supernova_remnants_2016_lec3.pdf


Extract data from figure
https://automeris.io/WebPlotDigitizer/tutorial.html


Cosmic ray acceleration by shocks
https://arxiv.org/pdf/1906.12240.pdf

Electron proton ratio from simulation
https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.114.085003


What is the best website to search for scholarships and research jobs?

two-fluid cosmic ray model implemented in Enzo





CosmicRays/Chang_Cooper
Improved Fokker-Planck code
SDE
PDE

extract data from figures 

Finite volume methods for compressible MHD


Tuesday, May 21, 2019

Few concepts in astrophysics radiation

Luminosity:
Power that the source emits in radiation
$[L]=erg/s=10^{-7}W$
$E = \int Ldt$

Flux:
Power received per unit area $\phi = L/(4\pi d^2)$
$[\phi] = W/{m^2}$
$E=\int_{all area} dtdA$

Flux density/ specific density (specific refers to $Hz^{-1}$)
Power received per unit area and unit frequency
Flux is the integrate of  flux density $\phi = \int F_{\nu}d\nu$
Astronomers often say flux when they mean flux density
$[F_{\nu}]=W/m^2/Hz$
$Jy=10^{-26}W/m^2/Hz$
$E=\int F_{\nu}d\nu dAdt$

Surface luminosity/ specific intensity
Power received or emitted per unit are per unit frequency per unit solid angle
$dF_{\nu}=I_{\nu} \cos(\theta)d\Omega$
Specific intensity is independent on the distance ?
mean specific intensity $J_{\nu}=\frac{1}{4\pi}\int I_{\nu}d\Omega$
$[I_{\nu}= W/m^2/sr/Hz]$
The perceived measurement area orthogonal to the incident flux is significantly reduced at oblique angles, causing energy to be spread out over a wider area than it would if it was falling perpendicular to the surface.