Dear Mantid group,
I’m trying to fit Crystal field parameters, from both inelastic neutron scattering data and specific heat (heat capacity/Cp) simultaneously.
However, when I try to load the Cp data by the way of “ws_cp = Load(‘Ho111-Cp.xye’)”, the unit of x axis was automatically given as meV. On the other hand, I also tried to load manually to the work-space, and call the file directly from workspace in the script by “InputWorkspace=ws_cp”. The call dose not work neither.
May I kindly ask for some solutions?
it doesn’t matter what the units of the workspace for the heat capacity is - the crystal field fitting function ignores this and always treats the data in units of Kelvin for the x-axis (and J/mol/K for y). So as long as your xye data has x in Kelvin it should be fine. If you have it in another unit you’ll have to use the ScaleX algorithm to convert it to Kelvin.
If you’ve manually loaded the file into a workspace with the name ws_cp then you need to use InputWorkspace=mtd['ws_cp'] because ws_cp is the name of the workspace and not a variable name (pointer to the workspace).
sorry it looks not straightforward for me. I use Mantid 4.1 and all data were read in unit of meV for x-axs and strange ‘meV-1’ for y.
'- the crystal field fitting function ignores this and always treats the data in units of Kelvin for the x-axis (and J/mol/K for y). ’
First, I don’t understand why the unit in y axis comes ‘meV-1’. The same thing happens when I try to read heat capacity data manually, and set x as ‘Temperature’. The y axis will be given as ‘K-1’ automatically.
Mantid is set up to handle neutron intensity data by default and doesn’t handle other types of data very well. The neutron data is usually binned into histograms. Mantid can either display these as the number of counts within a bin or as a distribution - the number of counts per bin-axis unit. In your case the data has been set as a distribution so it thinks that it should be counts per K. You have to run ConvertFromDistribution to convert it to “counts”. The reason Mantid does this is that in many cases the bin widths are not uniform so the data looks nicer when plotted as a distribution. If the bin widths are uniform it doesn’t really matter.
But actually this doesn’t matter anyway for the crystal field fitting, because the crystal field function ignores any units in the data and just takes the raw numbers from the data workspace. So as long as the text file you read in using Load has the data in Kelvin and J/mol/K then it should be find - it doesn’t matter what other parts of Mantid thinks the units are, because the crystal field function will ignore the normal Mantid units. This is, as I mentioned about, because Mantid is designed for neutron data and getting all the unit conversion etc to work properly for heat capacity / magnetisation / susceptibility etc data is just too much hassle, so I just ignore the units.
Just try to do the fit - maybe with with MaxIterations=0 so it just simulates with your initial crystal field parameters and see if you get anything sensible.