Skip to content

Commit

Permalink
chore: add zenodo entry
Browse files Browse the repository at this point in the history
chore: add zenodo entry
  • Loading branch information
lgrcia authored Mar 18, 2024
2 parents 2c9717a + 39d3e5d commit 6a44557
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
36 changes: 36 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"creators": [
{
"orcid": "0000-0002-4296-2246",
"affiliation": "Center for Computational Astrophysics, Flatiron Institute, New York, NY, USA",
"name": "Lionel Garcia"
},
{
"orcid": "0000-0002-9328-5652",
"affiliation": "Center for Computational Astrophysics, Flatiron Institute, New York, NY, USA",
"name": "Daniel Foreman-Mackey"
},
{
"orcid": "0000-0001-8504-5862",
"affiliation": "Department of Astrophysical and Planetary Sciences, University of Colorado Boulder, Boulder, CO, USA",
"name": "Catriona Murray"
},
{
"orcid": "0000-0003-1453-0574",
"affiliation": "Sub-department of Astrophysics, Department of Physics, University of Oxford, Oxford, UK",
"name": "Suzanne Aigrain"
},
{
"orcid": "0000-0002-2457-7889",
"affiliation": "American Museum of Natural History, New York, NY, USA",
"name": "Dax Feliz"
},
{
"orcid": "0000-0003-1572-7707",
"affiliation": "Instituto de Astrofísica de Andalucía, Granada, Spain",
"name": "Francisco Pozuelos"
}
],
"license": "MIT",
"title": "nuance: Efficient detection of planets transiting active stars"
}
14 changes: 7 additions & 7 deletions nuance/nuance.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Nuance:
error: np.ndarray = None
"""Flux error time series"""
gp: GaussianProcess = None
"""Gaussian process instance"""
"""tinygp.GaussianProcess instance"""
X: np.ndarray = None
"""Design matrix"""
compute: bool = True
Expand Down Expand Up @@ -306,7 +306,7 @@ def depth(self, t0: float, D: float, P: float = None):
model depth, depth error
"""
w, v = self.solve(t0, D, P)
return w[-1], np.sqrt(v[-1, -1])
return w[-1], jnp.sqrt(v[-1, -1])

def snr(self, t0: float, D: float, P: float = None):
"""SNR of the model linearly solved for epoch `t0` and duration `D` (and period `P` for a periodic model).
Expand All @@ -326,7 +326,7 @@ def snr(self, t0: float, D: float, P: float = None):
model snr
"""
w, dw = self.depth(t0, D, P=P)
return np.max([0, w / dw])
return jnp.max(jnp.array([0, w / dw]))

def linear_search(
self,
Expand Down Expand Up @@ -474,10 +474,10 @@ def mask_model(self, t0: float, D: float, P: float):
ph = utils.phase(search_data.t0s, t0, P)
t0_mask = np.abs(ph) > 2 * D

if np.count_nonzero(t0_mask) == len(search_data.t0s):
raise ValueError("Mask covers all data points")
elif len(t0_mask) == 0:
raise ValueError("No data to mask")
# if np.count_nonzero(t0_mask) == len(search_data.t0s):
# raise ValueError("Mask covers all data points")
# elif len(t0_mask) == 0:
# raise ValueError("No data to mask")

search_data.llv = None
search_data.llc = None
Expand Down

0 comments on commit 6a44557

Please sign in to comment.