Skip to content

Commit

Permalink
add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-baier committed Dec 30, 2024
1 parent 621e5e8 commit 13c8d03
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions hasasia/sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ class Pulsar(object):
theta : float
Ecliptic latitude of pulsar [rad].
name: str
name of pulsar. attempts to name pulsar based off phi, theta.
default is 'J0000+0000'.
designmatrix : array
Design matrix for pulsar's timing model. N_TOA x N_param.
Expand Down Expand Up @@ -339,7 +343,7 @@ def __init__(self, toas, toaerrs, phi=None, theta=None, name=None,
except:
self.name = 'J0000+0000'
else:
self.name = name
self.name = str(name)

if N is None:
self.N = np.diag(toaerrs**2) #N ==> weights
Expand Down Expand Up @@ -387,9 +391,9 @@ def change_cadence(self, start_time=0, end_time=1_000_000,
Parameters
==========
start_time - float
MJD at which to begin altared cadence.
MJD at which to begin altered cadence.
end_time - float
MJD at which to end altared cadence.
MJD at which to end altered cadence.
cadence - float
cadence for the modified campaign [toas/year]
cadence_facter - float
Expand Down Expand Up @@ -440,7 +444,7 @@ def change_cadence(self, start_time=0, end_time=1_000_000,
campaign_toas += np.random.uniform(-dt, dt, size=campaign_Ntoas)
self.toas = np.concatenate([old_toas[mask_before], campaign_toas, old_toas[mask_after]])
campaign_toaerrs = np.median(old_toaerrs)*np.ones(campaign_Ntoas)
# FIXME can only use a fixed toaerr for the duration of the campaign
# TODO can only use a fixed toaerr for the duration of the campaign
#self.toaerrs = np.concatenate([old_toaerrs[mask_before], campaign_toaerrs, old_toaerrs[mask_after]])
self.toaerrs = np.ones(len(self.toas))*old_toaerrs[0]
print(f"old: {len(old_toaerrs)}, new: {len(self.toaerrs)}")
Expand Down Expand Up @@ -469,11 +473,11 @@ def change_sigma(self, start_time=0, end_time=1_000_000,
Parameters
==========
start_time - float
MJD at which to begin altared cadence.
MJD at which to begin altered toa errors.
end_time - float
MJD at which to end altared cadence.
MJD at which to end altered toa errors.
new_sigma - float
unvertainty of toas for the modified campaign [microseconds]
uncertainty of toas for the modified campaign [microseconds]
sigma_facter - float
(instead of sigmas) factor by which to modify the campaign sigmas.
uneven - bool
Expand Down

0 comments on commit 13c8d03

Please sign in to comment.