Skip to content

Commit

Permalink
Merge pull request #37 from swagnercarena/notebook_fixes
Browse files Browse the repository at this point in the history
made small tweaks to notebooks
  • Loading branch information
swagnercarena authored Jul 20, 2022
2 parents da5b634 + 489ee81 commit 112a4a5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions notebooks/Understanding_Pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
" 'amp_s2','R_sersic_s2','n_sersic_s2','e1_s2','e2_s2','center_x_s2','center_y_s2',\n",
" 'z_source']\n",
"\n",
" # The __init__ function is inherited from SourceBase, but let's be explicit here just to remind ourselves\n",
" # what's going into our class\n",
" def __init__(self,cosmology_parameters,source_parameters):\n",
" super().__init__(cosmology_parameters,source_parameters)\n",
" \n",
" # Our light model list and light kwargs are fairly simple, so we can pull them straight from our\n",
" # source_parameters.\n",
" def draw_source(self):\n",
Expand Down Expand Up @@ -154,6 +159,38 @@
"source": [
"For this relatively easy example, all we had to do was add the required parameters and then pull those parameters corectly from the `source_parameters` dict. We could then import `DoubleSersicSource` into a config dict and use it to draw the sources of our training set. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's make some dummy source_parameters and cosmology_parameters just to make sure everything works as planned."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# We'll set some pretty boring values for our source parameters. \n",
"source_pamarameters = {'amp_s1':1.0,'R_sersic_s1':1.0,'n_sersic_s1':1.0,'e1_s1':0.0,'e2_s1':0.0,'center_x_s1':0.0,\n",
" 'center_y_s1':0.0,'amp_s2':1.0,'R_sersic_s2':1.0,'n_sersic_s2':1.0,'e1_s2':0.0,'e2_s2':0.0,\n",
" 'center_x_s2':0.0,'center_y_s2':0.0,'z_source':0.0}\n",
"\n",
"# There are a few ways to specify cosmology parameters, but the easiest is to use a cosmology name from this list:\n",
"# https://bdiemer.bitbucket.io/colossus/cosmology_cosmology.html#standard-cosmologies\n",
"cosmology_parameters = 'planck18'\n",
"\n",
"dss = DoubleSersicSource(cosmology_parameters=cosmology_parameters,source_parameters=source_parameters)\n",
"model_list, kwargs_list = dss.draw_source()\n",
"\n",
"# Let's make a verbose print statement\n",
"print('There are %d models in the list'%(len(model_list)))\n",
"for ml, kl in zip(model_list,kwargs_list):\n",
" print('For model %s kwargs are:'%(ml))\n",
" print(kl)"
]
}
],
"metadata": {
Expand Down
4 changes: 3 additions & 1 deletion notebooks/papers/2203_00690/Figures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### __To generate all of the figures in this notebook, you will have to download data.zip [from this zenodo submission](https://zenodo.org/record/6326743#.YiIt_xPML9E) and expand it into this folder.__"
"### __To generate all of the figures in this notebook, you will have to download data.zip [from this zenodo submission](https://zenodo.org/record/6326743#.YiIt_xPML9E) and expand it into this folder.__\n",
"\n",
"### __This notebook is built to work with paltas version 0.0.4. Later versions may not work with this code.__"
]
},
{
Expand Down

0 comments on commit 112a4a5

Please sign in to comment.