Skip to content

Commit

Permalink
Update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tbmiller-astro committed Jan 8, 2024
1 parent 3406778 commit a7de9f6
Show file tree
Hide file tree
Showing 6 changed files with 2,484 additions and 2,482 deletions.
3 changes: 1 addition & 2 deletions examples/API-Summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"- `set_prior(parameter,distribution)`: directly set the prior of a parameter using a numpyro distribution. \n",
"- `sample()`: sample; see api for all args. sets the `sampling_results` attribute. \n",
"- `find_MAP()`: use optimizer to find \"best fit\" model. \n",
"- `estimate_posterior()`: non-sampling methods of estimating posterior, uaing methods `laplace` or `svi-flow`; see the paper for more details. \n",
"- `estimate_posterior()`: non-sampling methods of estimating posterior, uaing methods `laplace`, `svi-mvn` or `svi-flow`; see the paper for more details. \n",
"- \n",
"\n",
"### FitSingle(BaseFitter)\n",
Expand Down Expand Up @@ -195,7 +195,6 @@
"\n",
"#### Methods Summary \n",
"- `summary()`: returns `az.summary(self.idata)`; i.e., the summary data frame. \n",
"- `get_median_model()`: get the median model of the posterior draw. Returns a tuple of the params of that model, plus the actual model image. \n",
"- `corner()`: wrapper around `corner.py` for plotting a corner plot of the results. (returns the corner fig).\n",
"- `retrieve_param_quantiles(quantiles,return_dataframe)`: returns a dict, or if specified, dataframe of the quantiles on each parameter. Quantiles are provided as a list-like, in decimal form (e.g., by default [0.16,0.5,0.84]). \n",
"- `retrieve_med_std()`: similar but for returning the median and std around the median for the properties. \n",
Expand Down
1,035 changes: 506 additions & 529 deletions examples/example-fit.ipynb

Large diffs are not rendered by default.

130 changes: 64 additions & 66 deletions examples/manual-priors.ipynb

Large diffs are not rendered by default.

3,563 changes: 1,792 additions & 1,771 deletions examples/multi-source-fitting.ipynb

Large diffs are not rendered by default.

226 changes: 117 additions & 109 deletions examples/multiband-example.ipynb

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions pysersic/priors.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ def __init__(self, sky_type = 'none',sky_guess=None,sky_guess_err=None, suffix =
elif self.sky_type == 'tilted-plane':
self.sky_prior = TiltedPlaneSkyPrior(sky_guess=sky_guess, sky_guess_err=sky_guess_err, suffix = suffix)


@property
def param_names(self):
return list(self.dist_dict.keys())
Expand Down Expand Up @@ -469,14 +468,14 @@ def check_vars(self, verbose = False) -> bool:
True if all variable for given type are present with no extra, False otherwise
"""
missing = []

for var in self.param_names:
param_names = base_profile_params[self.profile_type]
for var in param_names:
if not var in self.dist_dict.keys():
missing.append(var)

extra = []
for (name, descrip) in self.repr_dict.items():
if (name not in self.param_names) and ('sky' not in name):
for (name, descrip) in self.dist_dict.items():
if (name not in param_names) and ('sky' not in name):
extra.append(name)
if verbose:
print ("Missing params for profile: ", missing)
Expand Down

0 comments on commit a7de9f6

Please sign in to comment.