Useful stuff 2

This is a list of stuff (the kind of stuff that gets tossed onto myriad post-it notes or scribbled on my hand and eventually lost. Context may need inferring. Using MathJax to render equations, so enable Javascript.

Conversions

Tools

Catalogs and things

Some Galactic SNRs (excluding PWNe)

Notable soft X-ray lines above 1 keV-ish

Some of my notes on soft X-ray lines relevant to SNRs, link and a nice write-up with plots of several SNe (Cas A, 0102-72.3 in SMC, Kepler, 1987A) by J. Kolena.

More thorough catalogs: Bearden catalog of X-ray lines/energies (1967, Rev. Mod. Phys.) and AtomDB. List of K and L-shell lines, for non-ionized atoms (link, link 2 [pdf]).

Synchrotron radiation, constants and stuff

Equations in CGS (see Pacholczyk, 1970 and NRAO ERA)
Diffusion (Bohm), \(C_D = c/3e = 2.083 \times 10^{19}\)

From \(\left\langle dE/dt \right\rangle = bB^2E^2\) we have \[ \tau_{\mathrm{synch}} = \frac{1}{bB^2E} . \] Here, \[ b = \frac{2}{3} \cdot \frac{2 e^4}{3 m^4 c^7} = 1.57 \times 10^{-3} . \] Left factor \(2/3\) arises from \(\sin^2\vartheta\) (average over solid angle), right factor is Pacholczyk's "\(c_2\)". See Pacholczyk (3.32), Condon/Ransom (5B9, 5B10).

Critical frequency: \[ c_1 = \frac{3e}{4\pi m^3 c^5} = 6.27 \times 10^{18} \] Used for \(y = \nu / (c_1 E^2 B)\), scaled electron emissivity freq.

Peak frequency: \(\nu_m = c_m E^2 B\), where \(c_m = 1.82 \times 10^{18}\)
\[ \mathrm{E}(\nu_m) = (22.8\;\mathrm{TeV}) \left(\frac{h\nu_m}{1\;\mathrm{keV}}\right)^{1/2} \left(\frac{B}{100\;\mathrm{\mu G}}\right)^{-1/2} \] Note that \(c_m \approx 0.29 c_1\). Critical frequency for the \(\delta\)-approx. (?) Here \(c_m\) corresponds to peak radiated power.

Gyrofrequency of an electron: \[ \nu_{\mathrm{G}} = \frac{eB}{2\pi m c} \] Critical frequency (Condon/Ransom (5C2)) \[ \nu_c = \frac{3}{2} \gamma^2 \sin\alpha \;\nu_{\mathrm{G}} = \left(\frac{3}{2} \sin\alpha \frac{e}{2\pi m^3 c^5}\right) E^2 B \]

Useful numbers

Preferably those that don't already show up on standard cheat sheets (Planck's constant and what have you).
20 cm3 sphere = 3.37 cm diameter
60 cm3 sphere = 4.86 cm diameter

Useful snippets

Perl one-liner to filter-and-print: perl -lne 'print "$1" if /^(\d{5})/;' file.txt. Here -l does nice newline handling (chomp input, make print act like say). -n is similar to -p (wraps command in while(⟨⟩) loop) but doesn't have the continue print block (-p could be more succinct if we weren't filtering). Finally, -e is just executes the code string... This particular example extracts obsids (5-digit numbers) from all strings prefixed with obsids in the file.

Trim trailing whitespace in Vim: %s/\s\+$//gc. I.e., + must be escaped but $ is not (which I often forget). Other vim whitespace troubleshooting:

Add new word to Vim spellfile: 'zg'; undo with 'zug'.

Plotting unfolded spectra in XSPEC is dangerous. One workaround: set model to unity by freezing powerlaw with normalization 1 and slope 0. Then the plotted data are simply data / response. Source: slides by M. Nowak, and trick in turn by S. Vaughan.

Local pip install: pip install --user [package], pushed to ~/.local/[...]. Add ~/.local/bin/ to $PATH if needed.

ipynb users: nbstripout. Using git filter (clean/smudge) helps with diffs. TODO: twiddle hooks to preserve outputs in your working copy?

https://github.com/trimstray/the-book-of-secret-knowledge

Vim search and replace in ALL buffers (from Vim Tips wiki): :bufdo %s/pattern/replace/gc

UNIX find command: find . -name fname

GDB cheatsheet: