Skip to content

Commit

Permalink
add inverse
Browse files Browse the repository at this point in the history
  • Loading branch information
autocorr committed Feb 27, 2015
1 parent 6505b33 commit 306dc98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions besl/bgps_fwhm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Compute BGPS FWHM sizes and fluxes.
"""
from __future__ import division
import numpy as np
from scipy.ndimage import (binary_closing, watershed_ift)
import catalog
Expand Down Expand Up @@ -226,6 +227,7 @@ def _calc_values(self):
self.df['sangled'] = np.pi * self.df['eqangled']**2
self.df['fwhm_sangled'] = np.pi * self.df['fwhm_eqangled']**2
self.df['fwhm_sangled_ratio'] = self.df['fwhm_sangled'] / self.df['sangled']
self.df['fwhm_sangled_ratio_inv'] = 1 / self.df['fwhm_sangled_ratio']

def beam_subtract(self, theta_eq):
if theta_eq > self.theta_mb:
Expand Down
8 changes: 5 additions & 3 deletions besl/bplot/dpdf_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ def write_all_hists():
flux = evo.query('1e-2 < flux_40')
fwhm = catalog.read_cat('bgps_v210_fwhm').set_index('v210cnum')
fwhm = evo.merge(fwhm.loc[:, 'npix':], left_index=True, right_index=True)
fwhm_res = fwhm[fwhm.fwhm_eqangled.notnull()]
amm = evo.query('6 < nh3_tkin < 100')
hco = evo.query('mol_hco_f in [1,2,3]')
nnh = evo.query('mol_nnh_f in [1,2,3]')
Expand All @@ -417,10 +418,11 @@ def write_all_hists():
# FWHM properties
PlotData('fwhm_flux', r'$S^{\rm FWHM}_{1.1} \ \ [{\rm Jy}]$', fwhm),
PlotData('eqangled', r'$\theta^{\rm Total}_{\rm eq} \ \ [{\rm arcsec}]$', fwhm),
PlotData('fwhm_eqangled', r'$\theta^{\rm FWHM}_{\rm eq} \ \ [{\rm arcsec}]$', fwhm),
PlotData('sangled', r'$\Omega^{\rm Total} \ \ [{\rm sq. \ arcsec}]$', fwhm),
PlotData('fwhm_sangled', r'$\Omega^{\rm FWHM} \ \ [{\rm sq. \ arcsec}]$', fwhm),
PlotData('fwhm_sangled_ratio', r'$\Omega^{\rm FWHM} / \Omega^{\rm Total}$', fwhm, left_label=True),
PlotData('fwhm_eqangled', r'$\theta^{\rm FWHM}_{\rm eq} \ \ [{\rm arcsec}]$', fwhm_res),
PlotData('fwhm_sangled', r'$\Omega^{\rm FWHM} \ \ [{\rm sq. \ arcsec}]$', fwhm_res),
PlotData('fwhm_sangled_ratio', r'$\Omega^{\rm FWHM} / \Omega^{\rm Total}$', fwhm_res, left_label=True),
PlotData('fwhm_sangled_ratio_inv', r'$\Omega^{\rm Total} / \Omega^{\rm FWHM}$', fwhm_res),
# NH3
PlotData('nh3_tkin', r'$T_{\rm K} \ \ [{\rm K}]$', amm),
PlotData('nh3_gbt_pk11', r'$T_{\rm pk}({\rm NH_3 \ (1,1)}) \ \ [{\rm K}]$', amm),
Expand Down
2 changes: 1 addition & 1 deletion besl/bplot/sf_frac.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def __init__(self, od):
self.od = od

def make_fig(self):
fig, ax = plt.subplots(figsize=(6, 2.5))
fig, ax = plt.subplots(figsize=(8, 2.5))
ax.set_xscale('log')
ax.set_xlabel(self.od.xlabel)
ax.set_xlim(self.od.xmin, self.od.xmax)
Expand Down

0 comments on commit 306dc98

Please sign in to comment.