You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to apply SHExpandLSQ to a complex valued array. I have understood that SHExpandLSQ only takes real input, so I'm doing separate fits on the real and imaginary parts.
However I assumed that I could just combine the returned coefficient arrays and get the same results when for expand, but this doesn't work:
deviation_real for real: min = 1.8123470792164031e-07, max = 0.02399276818309759, mean = 0.0015879964062471847, chi = 0.13405475009741488
deviation_imag for imag: min = 1.4086760584397506e-08, max = 0.025954209358143007, mean = 0.001817595279754483,
deviation_to_separate: min = 0.0, max = 0.2844782293230475, mean = 0.07088919414456854, chi = (2.6888420851680928+32.486839201184736j)
I expected that deviation_to_separate is zero (or at least very, very close to).
What is the right way to combine these two sets of coefficients into a single set of coefficients for the complex function?
The text was updated successfully, but these errors were encountered:
Direct addition of the raw coefficient arrays does not work, because converting the coefficient arrays from real to complex is a nontrivial step.
You need to make use of the builtin capabilities of the SHCoeffs class:
I'm not quite sure where to document this. Do you have any ideas?
The best solution to this problem would be add a new fortran function that deals with complex data. I am all for someone contributing this! I rarely work with complex data, so this is not high on priority list.
A hacky solution would be to add a new python function that wraps the intermediate steps you used. It's not ideal, but at least it would work.
For info, I've made some improvements to the least squares inversion routines: #463.
I didn't yet implement complex coefficients, but this should be easier to do now than before (the changes would go in the new function shlsq). I would welcome a PR on this as I don't have time to look into this now.
Hi,
I want to apply SHExpandLSQ to a complex valued array. I have understood that SHExpandLSQ only takes real input, so I'm doing separate fits on the real and imaginary parts.
However I assumed that I could just combine the returned coefficient arrays and get the same results when for
expand
, but this doesn't work:which gives
I expected that
deviation_to_separate
is zero (or at least very, very close to).What is the right way to combine these two sets of coefficients into a single set of coefficients for the complex function?
The text was updated successfully, but these errors were encountered: