Skip to content

Commit

Permalink
ne_sw derivatives
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Nov 11, 2024
1 parent 8c8b126 commit 4917a34
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pint/models/dispersion_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ def validate(self):
)

def DM_derivative_unit(self, n):
return "pc cm^-3/yr^%d" % n if n else "pc cm^-3"
return f"pc cm^-3/yr^{n}" if n != 0 else "pc cm^-3"

def DM_derivative_description(self, n):
return "%d'th time derivative of the dispersion measure" % n
return f"{n}'th time derivative of the dispersion measure"

def get_DM_terms(self):
"""Return a list of the DM term values in the model: [DM, DM1, ..., DMn]"""
Expand Down
17 changes: 17 additions & 0 deletions src/pint/models/solar_wind_dispersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,17 @@ def __init__(self):
tcb2tdb_scale_factor=(const.c * DMconst),
)
)
self.add_param(
floatParameter(
name="NE_SW1",
units="cm^-3",
value=0.0,
description="Derivative of Solar Wind density at 1 AU",
unit_template=self.NE_SW_derivative_unit,
description_template=self.NE_SW_derivative_description,
tcb2tdb_scale_factor=(const.c * DMconst),
)
)
self.add_param(
floatParameter(
name="SWP",
Expand Down Expand Up @@ -329,6 +340,12 @@ def setup(self):
self.register_dm_deriv_funcs(self.d_dm_d_swp, "SWP")
self.register_deriv_funcs(self.d_delay_d_swp, "SWP")

def NE_SW_derivative_unit(self, n):
return f"cm^-3/yr^{n}" if n != 0 else "cm^-3"

def NE_SW_derivative_description(self, n):
return f"{n}'th time derivative of the Solar Wind density at 1 AU"

def solar_wind_geometry(self, toas):
"""Return the geometry of solar wind dispersion.
Expand Down

0 comments on commit 4917a34

Please sign in to comment.