-
Notifications
You must be signed in to change notification settings - Fork 3
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
poorly constrained fit in example PS observation #174
Comments
what's your astropy version? |
5.3.2 |
when upgraded to 6.0.0 I still get the warning. |
I can reproduce this with 0.2.0b. Fitting needs to work regardless of what exclude region(s) are chosen and what units the axis are in. |
if the fitting is done in straight Hz, the X axis will be around 1.4e9, so the matrix to be inverted will have huge numbers that are all very positive. Better would be to have numbers scaled, like doppler velocities, or simply the mean of the freq's subtracted, and added back later when needed.. Normally one would say rounding errors can become important, but the matrix is probably hard to invert. |
It was found rescaling the freq. axis works (e.g. by first freq) Using model=chebyshev' it also works, since they need a rescaled freq The differences are quite huge, I put a model 2nd order that went from 0 to 4 at the edge, and the returned spectral still had almost half of that left. A little experimentation showed that normalizing to 1e9, 1e8, 1e7 worked, but already by 1e6 the fitted spectrum had rounding problems. This is for order=2, and is likely worse for higher orders. @todo This also implies we should at least check what happens if the freq. axis is not regular @todo model= is not using minimum match, but the docs say there are 2 options, but the error messages when picking something incorrect is ['polynomial', 'chebyshev', 'legendre', 'hermite'] |
Although this is basically fixed, #260 is throwing a wrench in this, as the normalization in channel space will not correctly understand any other WCS specification. |
Describe the bug
Executing the example positionswitch I get this warning when a baseline fit is done
Perhaps the freq axis was not "normalized", it claims it runs in the 1,400,000,000 band, so if the units used are Hz, I could imagine this error. Probably better to do the fit in km/s space, or even better, pick a center freq (or km/s) and fit around that such that the matrix is better behaved?
How to Reproduce
The cell with ta[0].baseline does a baseline fit, and gives this warning.
Environment
The text was updated successfully, but these errors were encountered: