[AstroPy] Tying model bounds to other parameters in compound models
Azalee Bostroem
abostroem at gmail.com
Mon Oct 4 15:14:12 EDT 2021
Hi,
I am trying to fit the [OI] doublet at 6300, 6364 A as a compound model (Const1D+Gaussian1D+Gaussian1D). This doublet has a known ratio range of 1:1 to 1:3 and I would like fix the bounds of the amplitude of the second gaussian to be between 1/3 and 1 times the amplitude of the first gaussian. I know its possible to tie model parameters to each other (e.g.
def fix_offset(oi_emission):
mean_2 = oi_emission.mean_1 + 64
return mean_2
emission_model.mean_2.tied = fix_offset
) and to set bounds on parameters (e.g.
emission_model.amplitude_1.min = 0
). Is it possible to tie bounds to other parameters? My naive approach of
def fixed_amp_ratio(oi_emission):
amplitude_2.min = 0.3*oi_emission.amplitude_1
return amplitude2.min
emission_model.amplitude_2.min.tied = fixed_amp_ratio
Didn’t work because min has no attribute tied.
Please let me know if I’ve missed anything,
Thanks,
Azalee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20211004/1cd33b5d/attachment.html>
More information about the AstroPy
mailing list