Skip to content

Commit

Permalink
Merge pull request #64 from tsunhopang/load_psd_naming
Browse files Browse the repository at this point in the history
Renaming psd-related variables to avoid confusion
  • Loading branch information
kazewong authored Jan 28, 2024
2 parents a1908dc + 37927de commit 9ed508f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jimgw/single_event/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
DEG_TO_RAD = jnp.pi / 180

# TODO: Need to expand this list. Currently it is only O3.
psd_file_dict = {
asd_file_dict = {
"H1": "https://dcc.ligo.org/public/0169/P2000251/001/O3-H1-C01_CLEAN_SUB60HZ-1251752040.0_sensitivity_strain_asd.txt",
"L1": "https://dcc.ligo.org/public/0169/P2000251/001/O3-L1-C01_CLEAN_SUB60HZ-1240573680.0_sensitivity_strain_asd.txt",
"V1": "https://dcc.ligo.org/public/0169/P2000251/001/O3-V1_sensitivity_strain_asd.txt",
Expand Down Expand Up @@ -412,13 +412,13 @@ def load_psd(
) -> Float[Array, " n_sample"]:
if psd_file == "":
print("Grabbing GWTC-2 PSD for " + self.name)
url = psd_file_dict[self.name]
url = asd_file_dict[self.name]
data = requests.get(url)
open(self.name + ".txt", "wb").write(data.content)
f, asd_vals = np.loadtxt(self.name + ".txt", unpack=True)
psd_vals = asd_vals**2
else:
f, asd_vals = np.loadtxt(psd_file, unpack=True)
psd_vals = asd_vals**2
f, psd_vals = np.loadtxt(psd_file, unpack=True)

psd = interp1d(f, psd_vals, fill_value=(psd_vals[0], psd_vals[-1]))(freqs) # type: ignore
psd = jnp.array(psd)
Expand Down

0 comments on commit 9ed508f

Please sign in to comment.