Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New phase class #695

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pint/mcmc_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def get_event_phases(self):
"""
Return pulse phases based on the current model
"""
phases = self.model.phase(self.toas)[1]
phases = self.model.phase(self.toas)['frac']
# ensure all positive
return np.where(phases < 0.0, phases + 1.0, phases)

Expand Down Expand Up @@ -637,10 +637,11 @@ def get_event_phases(self, index=None):
If index is None, then it will return phases for all TOAs
"""
if index is None:
phases = self.model.phase(self.toas)[1]
phases = self.model.phase(self.toas)['frac']
print("Showing all %d phases" % len(phases))
else:
phases = self.model.phase(self.toas_list[index])[1]
phases = self.model.phase(self.toas_list[index])['frac']
phases = phases.to(u.cycle).value
return np.where(phases < 0.0, phases + 1.0, phases)

def get_template_vals(self, phases, index):
Expand Down
14 changes: 7 additions & 7 deletions src/pint/models/timing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def map_component(self, component):
----------
component: str or `Component` object
Component name or component object.

Returns
-------
comp: `Component` object
Expand Down Expand Up @@ -504,8 +504,8 @@ def add_component(self, component, order=DEFAULT_ORDER, force=False, validate=Tr
self.validate()

def remove_component(self, component):
""" Remove one component from the timing model.
""" Remove one component from the timing model.

Parameters
----------
component: str or `Component` object
Expand Down Expand Up @@ -571,7 +571,7 @@ def get_components_by_category(self):

def add_param_from_top(self, param, target_component, setup=False):
""" Add a parameter to a timing model component.

Parameters
----------
param: str
Expand All @@ -580,7 +580,7 @@ def add_param_from_top(self, param, target_component, setup=False):
Parameter host component name. If given as "" it would add
parameter to the top level `TimingModel` class
setup: bool, optional
Flag to run setup() function.
Flag to run setup() function.
"""
if target_component == "":
setattr(self, param.name, param)
Expand Down Expand Up @@ -1077,7 +1077,7 @@ def designmatrix(

def compare(self, othermodel, nodmx=True):
"""Print comparison with another model

Parameters
----------
othermodel
Expand All @@ -1087,7 +1087,7 @@ def compare(self, othermodel, nodmx=True):

Returns
-------
str
str
Human readable comparison, for printing
"""

Expand Down
Loading