Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in fitspec #98

Closed
mducle opened this issue Jul 28, 2022 · 0 comments
Closed

Bugs in fitspec #98

mducle opened this issue Jul 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mducle
Copy link
Member

mducle commented Jul 28, 2022

A user (K. Richardson / ANSTO) found some bugs and emailed me about them:


I think I found a couple of very small bugs in the spinw.fitspec method.

The first of these relates to updating the redX2 variable in each consecutive fitting run. I think it might be the case that lines 267 and 273, which read;

redX2(idx) = output.redX2;

Should instead read;

redX2(idx) = output(idx).redX2;

Which would make them the same as line 280. Before these changes the fitspec function was returning a column vector with nRun elements of identical values, whereas after these changes the redX2 output correctly provides different values corresponding to each fitting run.

The second of these is related to displaying the legend in the output plot. Line 451 currently reads;

legend(pHandle(1:2),'simulation','data')

Which was causing two black lines to display in the legend for my data. Changing this line to the following fixed this issue for me.

legend([pHandle(end-6), pHandle(end-4)],'simulation','data')
@mducle mducle added the bug Something isn't working label Jul 28, 2022
@mducle mducle mentioned this issue Apr 25, 2024
mducle added a commit that referenced this issue May 20, 2024
* Fix bug where imag always plots in auto mode #172

* Allow row vector for hkl for single point #179

* Fix inverted user colormap #131

* Refactor sw_plotspec to avoid recursive calls #132

* Add fitspec fixes suggested by K Richardson #98

* Add spinw obj to spec for twin cases in fitspec #158

* Fix spec spinw object issues in fitmode

spinwave() now creates a .obj field regardless
  When fitmode=true, this a barebones struct
  When fitmode=false, this is a full spinw object
Fix issue with sw_plotspec when using fastmode/fitmode
Add basic test for fitspec() to check twins handling

* Fix bug in sw_plotspec 'fastmode' handling

* Fix issues from review. Add change log.
@mducle mducle closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant