Skip to content

Commit

Permalink
Docs fixes (#285)
Browse files Browse the repository at this point in the history
* removed get_best_fit_spectrum: not robust enough and not needed if set_spectrum_to_match is called

* robust linear solver when components are degenerate (closes #282)

* refactored src and obs loops

* closes #254

* notebook fixes, closes #271

* it's 2024 now..
  • Loading branch information
pmelchior authored May 1, 2024
1 parent 2d1f022 commit 93e2547
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
10 changes: 5 additions & 5 deletions docs/0-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"cell_type": "markdown",
"source": [
"sources = []\n",
"for k,center in enumerate(centers):\n",
Expand All @@ -256,7 +253,10 @@
"\n",
"for k, src in enumerate(sources):\n",
" print (f\"{k}: {src.__class__.__name__}\")"
]
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

# General information about the project.
project = "scarlet"
copyright = "2018-2021, Fred Moolekamp and Peter Melchior"
copyright = "2018-2024, Fred Moolekamp and Peter Melchior"
author = "Fred Moolekamp and Peter Melchior"

# The version info for the project you're documenting, acts as replacement for
Expand Down
9 changes: 0 additions & 9 deletions docs/tutorials/lite.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@
"for k, blend in blends.items():\n",
" display.show_scene(\n",
" blend,\n",
" observation,\n",
" show_model=False,\n",
" show_rendered=True,\n",
" show_observed=True,\n",
Expand All @@ -547,7 +546,6 @@
" # Show the scene again with the reweighted flux\n",
" display.show_scene(\n",
" blend,\n",
" observation,\n",
" show_model=False,\n",
" show_rendered=True,\n",
" show_observed=True,\n",
Expand Down Expand Up @@ -593,13 +591,6 @@
"source": [
"display.compare_spectra(**sources)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/wavelet_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@
"outputs": [],
"source": [
"# find all sources with very similar colors to the Starlet source of the diffuse emission\n",
"spectrum = sources[-1].spectrum\n",
"spectrum = sources[-1].spectrum.get_parameter(0)\n",
"C = np.zeros(len(sources))\n",
"for j, src in enumerate(sources):\n",
" spectrum_ = src.spectrum\n",
" spectrum_ = src.spectrum.get_parameter(0)\n",
" # cosine similarity\n",
" C[j] = spectrum @ spectrum_ / np.sqrt(spectrum @ spectrum) / np.sqrt(spectrum_ @ spectrum_)\n",
"\n",
Expand Down
9 changes: 5 additions & 4 deletions scarlet/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def init_all_sources(
model will be kept, otherwise one component is removed and the source reinitialized.
If a source cannot be initialized, its index is returned in `skipped`.
See `~init_sources` for a description of the arguments
See `~init_source` for a description of the arguments
Parameters
----------
Expand Down Expand Up @@ -404,8 +404,7 @@ def init_source(
The `Observation` that contains the images, weights, and PSF
used to generate the model.
thresh : `float`
Fraction of the background to use as a threshold for
each pixel in the initialization
Multiple of the backround RMS used as a flux cutoff for morphology initialization
max_components : int
The maximum number of components in a source.
If `fallback` is `True` then when
Expand All @@ -417,7 +416,9 @@ def init_source(
The minimum number of components in a source.
Only relevent for `fallback=True`.
min_snr: float
Mininmum SNR per component to accept the source.
Mininmum SNR per component of a multi-component source.
If fallback=True, every component needs to have at least min_snr, otherwise the component number will be reduced
At last resort, the component is initialized with a PointSource morphology
shifting : bool
Whether or not to fit the position of a source.
This is an expensive operation and is typically only used when
Expand Down

0 comments on commit 93e2547

Please sign in to comment.