Skip to content

Commit

Permalink
Merge pull request #76 from deshima-dev/astropenguin/issue74
Browse files Browse the repository at this point in the history
Release v0.4.0
  • Loading branch information
astropenguin authored Feb 4, 2022
2 parents 6a954de + 381abab commit 557fdc2
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 89 deletions.
4 changes: 4 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"affiliation": "Delft University of Technology",
"orcid": "0000-0001-7507-6948"
},
{
"name": "Joris Tiebosch",
"affiliation": "Delft University of Technology"
},
{
"name": "Yohei Togami",
"affiliation": "Nagoya University"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Click the budge below to open it in [Google colaboratory](http://colab.research.

### Stable version (recommended)

[![open stable version in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deshima-dev/deshima-sensitivity/blob/v0.3.0/sensitivity.ipynb)
[![open stable version in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deshima-dev/deshima-sensitivity/blob/v0.4.0/sensitivity.ipynb)

### Latest version

Expand Down
2 changes: 1 addition & 1 deletion deshima_sensitivity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""
# flake8: noqa
__version__ = "0.3.0"
__version__ = "0.4.0"


# modules
Expand Down
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 docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
project = "deshima-sensitivity"
copyright = "2020 DESHIMA software team"
author = "Akira Endo"
release = "0.3.0"
release = "0.4.0"


# General configuration
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
144 changes: 82 additions & 62 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "deshima-sensitivity"
version = "0.3.0"
version = "0.4.0"
description = "Sensitivity calculator for DESHIMA-type spectrometers"
authors = ["Akira Endo <a.endo@tudelft.nl>"]
maintainers = [
Expand All @@ -9,6 +9,7 @@ maintainers = [
"Keiichi Matsuda <matsuda@a.phys.nagoya-u.ac.jp>",
"Masato Hagimoto <hagimoto@a.phys.nagoya-u.ac.jp>",
"Stefanie Brackenhoff <s.a.brackenhoff@student.tudelft.nl>",
"Joris Tiebosch <j.p.tiebosch@student.tudelft.nl>",
]
license = "MIT"
readme = "README.md"
Expand All @@ -25,8 +26,8 @@ pandas = "^1.1"
scipy = "^1.4"

[tool.poetry.dev-dependencies]
black = "^21.12b"
ipykernel = "^6.7"
black = "^22.1"
ipykernel = "^6.8"
ipython = "^7.31"
myst-parser = "^0.16"
pydata-sphinx-theme = "^0.8"
Expand Down
2 changes: 1 addition & 1 deletion sensitivity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install -q \"deshima-sensitivity==0.3.0\""
"!pip install -q \"deshima-sensitivity==0.4.0\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "0.3.0"
assert __version__ == "0.4.0"
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 557fdc2

Please sign in to comment.