Skip to content

Commit

Permalink
#74 Reformat codes using non-beta Black
Browse files Browse the repository at this point in the history
  • Loading branch information
astropenguin committed Feb 3, 2022
1 parent eb1b618 commit 43c4797
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions deshima_sensitivity/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def eta_atm_func(
Atmospheric tranmsmission. Units: None.
"""
if np.average(F) > 10.0 ** 9:
F = F / 10.0 ** 9
if np.average(F) > 10.0**9:
F = F / 10.0**9

# give F a length if it is an integer.
if not hasattr(F, "__len__"):
Expand Down
16 changes: 8 additions & 8 deletions deshima_sensitivity/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def eta_filter_lorentzian(
Units: None.
"""

if np.average(F) < 10.0 ** 9:
F = F * 10.0 ** 9
FWHM = FWHM * 10.0 ** 9
if np.average(F) < 10.0**9:
F = F * 10.0**9
FWHM = FWHM * 10.0**9

# give F a length if it is an integer.
if not hasattr(F, "__len__"):
Expand Down Expand Up @@ -165,8 +165,8 @@ def eta_filter_csv(

F_int = eta_filter_df.columns.values.astype(float)

if np.average(F_int) < 10.0 ** 9:
F_int = F_int * 10.0 ** 9
if np.average(F_int) < 10.0**9:
F_int = F_int * 10.0**9
eta_filter_df.columns = F_int

# Fit to lorentzian model
Expand Down Expand Up @@ -265,9 +265,9 @@ def expand_F(
"""

if np.average(F) < 10.0 ** 9:
F = F * 10.0 ** 9
FHWM = FHWM * 10 ** 9
if np.average(F) < 10.0**9:
F = F * 10.0**9
FHWM = FHWM * 10**9

N = len(F)
if N > 1:
Expand Down
2 changes: 1 addition & 1 deletion deshima_sensitivity/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ def co_luminosity(z, d_l, f_obs, int):
c2 = 1.04e-03

# Lp = c1 * int * d_l**2 / (f_obs**2 * (1 + z)**3 )
return c2 * int * d_l ** 2 * f_obs
return c2 * int * d_l**2 * f_obs
2 changes: 1 addition & 1 deletion deshima_sensitivity/instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


# constants
Delta_Al = 188.0 * 10 ** -6 * e # gap energy of Al
Delta_Al = 188.0 * 10**-6 * e # gap energy of Al
eta_pb = 0.4 # Pair breaking efficiency
eta_Al_ohmic_850 = 0.9975 # Ohmic loss of an Al surface at 850 GHz.
# Shitov+, ISSTT2008. https://www.nrao.edu/meetings/isstt/papers/2008/2008263266.pdf
Expand Down
6 changes: 3 additions & 3 deletions deshima_sensitivity/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@


# constants
h = 6.62607004 * 10 ** -34 # Planck constant
k = 1.38064852 * 10 ** -23 # Boltzmann constant
e = 1.60217662 * 10 ** -19 # electron charge
h = 6.62607004 * 10**-34 # Planck constant
k = 1.38064852 * 10**-23 # Boltzmann constant
e = 1.60217662 * 10**-19 # electron charge
c = 299792458.0 # velocity of light


Expand Down
4 changes: 2 additions & 2 deletions deshima_sensitivity/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def MDLF_simple(
ax.set_ylabel(r"Minimum Detectable Line Flux ($\mathrm{W\, m^{-2}}$)")
ax.set_yscale("log")
ax.set_xlim(200, 460)
ax.set_ylim([10 ** -20, 10 ** -17])
ax.set_ylim([10**-20, 10**-17])
ax.tick_params(direction="in", which="both")
ax.grid(True)
ax.set_title(
Expand Down Expand Up @@ -197,7 +197,7 @@ def MS_simple(F: ArrayLike, pwv: float = 0.5, EL: float = 60.0) -> HTML:
ax.set_ylabel(r"Mapping Speed ($\mathrm{arcmin^2\, mJy^{-2}\, h^{-1}}$)")
ax.set_yscale("log")
ax.set_xlim(200, 460)
ax.set_ylim([10 ** -5, 10 ** -2])
ax.set_ylim([10**-5, 10**-2])
ax.tick_params(direction="in", which="both")
ax.grid(True)
ax.set_title(
Expand Down
2 changes: 1 addition & 1 deletion deshima_sensitivity/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def spectrometer_sensitivity(

# Collect efficiencies at the same temperature
eta_M1 = eta_M1_ohmic * eta_M1_spill
eta_wo = eta_Al_ohmic ** n_wo_mirrors * eta_wo_spill
eta_wo = eta_Al_ohmic**n_wo_mirrors * eta_wo_spill

# Forward efficiency: does/should not include window loss
# because it is defined as how much power out of
Expand Down
2 changes: 1 addition & 1 deletion tests/test_physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def test_johnson_nyquist_psd():
expected = 1.34778 * 10 ** -21
expected = 1.34778 * 10**-21
output = physics.johnson_nyquist_psd(1e11, 100)
assert isclose(output, expected, rel_tol=0.01)

Expand Down

0 comments on commit 43c4797

Please sign in to comment.