-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from ISISComputingGroup/38_generate_files_cont…
…aining_fit_results 38 generate files containing fit results
- Loading branch information
Showing
15 changed files
with
382 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Fitting Files Callback | ||
## Fitting Files | ||
|
||
The callback ({py:obj}`ibex_bluesky_core.callbacks.fitting.livefit_logger.LiveFitLogger`) exists to write all fitting metrics from `LiveFit` to file. These are designed to be human readable files rather than machine readable. | ||
|
||
This callback provides you with useful metrics such as `R-squared` and `chi-square`, then providing you with a table of the raw collected data included modelled `y` data and `y` uncertainty. | ||
|
||
### Example | ||
An example of using this could be: | ||
|
||
```{code} python | ||
def some_plan() -> Generator[Msg, None, None]: | ||
... # Set up prefix, reducers, controllers etc. here | ||
@subs_decorator( | ||
[ | ||
LiveFitLogger( | ||
lf, # LiveFit | ||
y=reducer.intensity.name, | ||
x=block.name, | ||
output_dir=Path(f"C:\\Instrument\\Var\\logs\\bluesky\\fitting"), | ||
postfix="bob" # Make sure to have different postfixes if using | ||
# more than 1 LiveFitLogger per run | ||
yerr=reducer.intensity_stddev.name, # Not required | ||
) | ||
... # Other callbacks ie. live table/plot here - you can use multiple! | ||
] | ||
) | ||
def _inner() -> Generator[Msg, None, None]: | ||
... # Continue to plan | ||
``` | ||
|
||
This will put the all fitting data collected over the run into a `.csv` file, named after the `uid` of the scan, in the `C:\\Instrument\\Var\\logs\\bluesky\\fitting` path provided to the callback. You should provide a `postfix` to append to the end of the filename to disambiguate different fits and to avoid overwriting fitting files- it is only one file per fit completed. | ||
|
||
If you provide a signal name for the `yerr` argument then an extra column for `y uncertainty` will be displayed in the fitting file. You have the option to not provide anything for this argument if you do not want to have uncertainty information in your fitting file. Keep in mind that even if you provide `yerr` in `LiveFitLogger`, you will still need to provide `yerr` in `LiveFit` if you want uncertainty/weight per point to influence the fit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.