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
Create a <phoebe.parameters.ParameterSet> for a spot feature.
123
+
124
+
Generally, this will be used as an input to the kind argument in
125
+
<phoebe.frontend.bundle.Bundle.add_feature>. If attaching through
126
+
<phoebe.frontend.bundle.Bundle.add_feature>, all `**kwargs` will be
127
+
passed on to set the values as described in the arguments below. Alternatively,
128
+
see <phoebe.parameters.ParameterSet.set_value> to set/change the values
129
+
after creating the Parameters.
130
+
131
+
Allowed to attach to:
132
+
* components with kind: star
133
+
* datasets: not allowed
134
+
135
+
Arguments
136
+
----------
137
+
* `colat` (float/quantity, optional): colatitude of the center of the spot
138
+
wrt spin axis.
139
+
* `long` (float/quantity, optional): longitude of the center of the spot wrt
140
+
spin axis.
141
+
* `radius` (float/quantity, optional): angular radius of the spot.
142
+
* `relteff` (float/quantity, optional): temperature of the spot relative
143
+
to the intrinsic temperature.
144
+
145
+
Returns
146
+
--------
147
+
* (<phoebe.parameters.ParameterSet>, list): ParameterSet of all newly created
148
+
<phoebe.parameters.Parameter> objects and a list of all necessary
149
+
constraints.
150
+
"""
151
+
params= []
152
+
params+= [FloatParameter(qualifier="colat", value=kwargs.get('colat', 0.0), default_unit=u.deg, description='Colatitude of the center of the spot wrt spin axis')]
153
+
params+= [FloatParameter(qualifier="long", value=kwargs.get('long', 0.0), default_unit=u.deg, description='Longitude of the center of the spot wrt spin axis')]
154
+
params+= [FloatParameter(qualifier='radius', value=kwargs.get('radius', 1.0), default_unit=u.deg, description='Angular radius of the spot')]
155
+
params+= [FloatParameter(qualifier='relteff', value=kwargs.get('relteff', 1.0), limits=(0.,None), default_unit=u.dimensionless_unscaled, description='Temperature of the spot relative to the intrinsic temperature')]
Generally, this will be used as an input to the kind argument in
58
+
<phoebe.frontend.bundle.Bundle.add_feature>. If attaching through
59
+
<phoebe.frontend.bundle.Bundle.add_feature>, all `**kwargs` will be
60
+
passed on to set the values as described in the arguments below. Alternatively,
61
+
see <phoebe.parameters.ParameterSet.set_value> to set/change the values
62
+
after creating the Parameters.
63
+
64
+
Allowed to attach to:
65
+
* components: not allowed
66
+
* datasets with kind: lc
67
+
68
+
If `compute_times` or `compute_phases` is used: the underlying model without
69
+
gaussian_processes will be computed at the given times/phases but will then
70
+
be interpolated into the times of the underlying dataset to include the
71
+
contribution of gaussian processes and will be exposed at the dataset
72
+
times (with a warning in the logger and in
73
+
<phoebe.frontend.bundle.Bundle.run_checks_compute>). If the system is
74
+
time-dependent without GPs
75
+
(see <phoebe.parameters.HierarchyParameter.is_time_dependent>), then
76
+
the underlying model will need to cover the entire dataset or an error
77
+
will be raised by <phoebe.frontend.bundle.Bundle.run_checks_compute>.
78
+
79
+
80
+
Arguments
81
+
----------
82
+
* `kernel` (string, optional, default='white'): Kernel for the gaussian
83
+
process (see https://scikit-learn.org/stable/modules/gaussian_process.html#kernels-for-gaussian-processes)
84
+
* `constant_value` (float, optional, default=1.0): only applicable if `kernel` is
85
+
'constant'.
86
+
* `noise_level` (float, optional, default=1.0): only applicable if `kernel` is 'white'.
87
+
* `length_scale` (float, optional, default=1.0): only applicable if `kernel` is 'rbf', 'rational_quadratic',
88
+
'exp_sine_squared' or 'matern'.
89
+
* `nu` (float, optional, default=1.5): only applicable if `kernel` is 'matern'.
90
+
* `alpha` (float, optional, default=1.0): only applicable if `kernel` is 'rational_quadratic'.
91
+
* `periodicity` (float, optional, default=1.0): only applicable if `kernel` is 'exp_sine_sqaured'.
92
+
* `sigma_0` (float, optional, default=1.0): only applicable if `kernel` is 'sigma_0'.
93
+
* `alg_operation` (string, default='sum'): algebraic operation for the kernel with previously added ones.
94
+
95
+
Returns
96
+
--------
97
+
* (<phoebe.parameters.ParameterSet>, list): ParameterSet of all newly created
98
+
<phoebe.parameters.Parameter> objects and a list of all necessary
99
+
constraints.
100
+
"""
101
+
params= []
102
+
params+= [ChoiceParameter(qualifier='kernel', value=kwargs.get('kernel', 'white'), choices=['constant', 'white', 'rbf', 'matern', 'rational_quadratic', 'exp_sine_squared', 'dot_product'], description='Kernel for the gaussian process (see https://scikit-learn.org/stable/modules/gaussian_process.html)')]
103
+
104
+
# sklearn kernel parameters
105
+
params+= [FloatParameter(visible_if='kernel:constant', qualifier='constant_value', value=kwargs.get('constant_value', 1.0), default_unit=u.dimensionless_unscaled, description='Value of the constant kernel')]
106
+
params+= [FloatParameter(visible_if='kernel:white', qualifier='noise_level', value=kwargs.get('noise_level', 1.0), default_unit=u.dimensionless_unscaled, description='Noise level of the white kernel')]
107
+
params+= [FloatParameter(visible_if='kernel:rbf|rational_quadratic|exp_sine_squared|matern', qualifier='length_scale', value=kwargs.get('length_scale', 1.0), default_unit=u.dimensionless_unscaled, description='Length scale of the kernel')]
108
+
params+= [FloatParameter(visible_if='kernel:matern', qualifier='nu', value=kwargs.get('nu', 1.5), default_unit=u.dimensionless_unscaled, description='Smoothness factor of the Matern kernel')]
109
+
params+= [FloatParameter(visible_if='kernel:rational_quadratic', qualifier='alpha', value=kwargs.get('alpha', 1.0), default_unit=u.dimensionless_unscaled, description='Scale mixture parameter of the RationalQuadratic kernel')]
110
+
params+= [FloatParameter(visible_if='kernel:exp_sine_squared', qualifier='periodicity', value=kwargs.get('periodicity', 1.0), default_unit=u.dimensionless_unscaled, description='Periodicity parameter of the ExpSineSquared kernel')]
111
+
params+= [FloatParameter(visible_if='kernel:dot_product', qualifier='sigma_0', value=kwargs.get('sigma_0', 1.0), default_unit=u.dimensionless_unscaled, description='Constant factor of the DotProduct kernel')]
112
+
113
+
params+= [StringParameter(visible_if='kernel:constant', qualifier='constant_value_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Value bounds of the constant kernel')]
114
+
params+= [StringParameter(visible_if='kernel:white', qualifier='noise_level_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Noise level bounds of the white kernel')]
115
+
params+= [StringParameter(visible_if='kernel:rbf|rational_quadratic|exp_sine_squared|matern', qualifier='length_scale_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Length scale bounds of the kernel')]
116
+
params+= [StringParameter(visible_if='kernel:matern', qualifier='nu_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Smoothness factor bounds of the Matern kernel')]
117
+
params+= [StringParameter(visible_if='kernel:rational_quadratic', qualifier='alpha_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Scale mixture parameter bounds of the RationalQuadratic kernel')]
118
+
params+= [StringParameter(visible_if='kernel:exp_sine_squared', qualifier='periodicity_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Periodicity parameter bounds of the ExpSineSquared kernel')]
119
+
params+= [StringParameter(visible_if='kernel:dot_product', qualifier='sigma_0_bounds', value='fixed', default_unit=u.dimensionless_unscaled, description='Constant factor bounds of the DotProduct kernel')]
120
+
121
+
# additional parameters for GPs
122
+
params+= [ChoiceParameter(qualifier='alg_operation', value='sum', choices=['sum', 'product'], default_unit=u.dimensionless_unscaled, description='Algebraic operation of this kernel with previous ones. Can be one of [sum, product]')]
123
+
124
+
returnParameterSet(params), []
125
+
126
+
defmodify_model(self, b, model_ps):
127
+
# GPS are handled separately and all simultaneously
Generally, this will be used as an input to the kind argument in
145
+
<phoebe.frontend.bundle.Bundle.add_feature>. If attaching through
146
+
<phoebe.frontend.bundle.Bundle.add_feature>, all `**kwargs` will be
147
+
passed on to set the values as described in the arguments below. Alternatively,
148
+
see <phoebe.parameters.ParameterSet.set_value> to set/change the values
149
+
after creating the Parameters.
150
+
151
+
Allowed to attach to:
152
+
* components: not allowed
153
+
* datasets with kind: lc
154
+
155
+
If `compute_times` or `compute_phases` is used: the underlying model without
156
+
gaussian_processes will be computed at the given times/phases but will then
157
+
be interpolated into the times of the underlying dataset to include the
158
+
contribution of gaussian processes and will be exposed at the dataset
159
+
times (with a warning in the logger and in
160
+
<phoebe.frontend.bundle.Bundle.run_checks_compute>). If the system is
161
+
time-dependent without GPs
162
+
(see <phoebe.parameters.HierarchyParameter.is_time_dependent>), then
163
+
the underlying model will need to cover the entire dataset or an error
164
+
will be raised by <phoebe.frontend.bundle.Bundle.run_checks_compute>.
165
+
166
+
167
+
Arguments
168
+
----------
169
+
* `kernel` (string, optional, default='sho'): Kernel for the gaussian
170
+
process (see https://celerite2.readthedocs.io/en/stable/api/python/#celerite2.terms)
171
+
* `rho` (float, optional, default=1.0): only applicable if `kernel` is
172
+
'sho' or 'matern32'.
173
+
* `tau` (float, optional, default=1.0): only applicable if `kernel` is
174
+
'sho'.
175
+
* `sigma` (float, optional, default=1.0)
176
+
* `period` (float, optional, default=1.0): only applicable if `kernel` is
177
+
'rotation'.
178
+
* `Q0` (float, optional, default=1.0): only applicable if `kernel` is
179
+
'rotation'.
180
+
* `dQ` (float, optional, default=1.0): only applicable if `kernel` is
181
+
'rotation'.
182
+
* `f` (float, optional, default=1.0): only applicable if `kernel` is
183
+
'rotation'.
184
+
* `eps` (float, optional, default=1e-5): only applicable if `kernel` is
185
+
'sho' or 'matern32'.
186
+
* `alg_operation` (string, default='sum'): algebraic operation for the kernel with previously added ones.
187
+
188
+
Returns
189
+
--------
190
+
* (<phoebe.parameters.ParameterSet>, list): ParameterSet of all newly created
191
+
<phoebe.parameters.Parameter> objects and a list of all necessary
192
+
constraints.
193
+
"""
194
+
195
+
params= []
196
+
params+= [ChoiceParameter(qualifier='kernel', value=kwargs.get('kernel', 'sho'), choices=['sho', 'rotation', 'matern32'], description='Kernel for the gaussian process')]
197
+
198
+
# celerite2 kernel parameters
199
+
params+= [FloatParameter(visible_if='kernel:sho|matern32', qualifier='rho', value=kwargs.get('rho', 1.0), default_unit=u.dimensionless_unscaled, description='Periodicity of the SHO kernel.')]
200
+
params+= [FloatParameter(visible_if='kernel:sho', qualifier='tau', value=kwargs.get('tau', 1.0), default_unit=u.dimensionless_unscaled, description='Damping timescale of the SHO kernel.')]
201
+
params+= [FloatParameter(visible_if='kernel:sho|rotation|matern32', qualifier='sigma', value=kwargs.get('sigma', 1.0), default_unit=u.dimensionless_unscaled, description='Standard deviation of the process.')]
202
+
params+= [FloatParameter(visible_if='kernel:rotation', qualifier='period', value=kwargs.get('period', 1.0), default_unit=u.dimensionless_unscaled, description='The primary period of variability of the rotation kernel.')]
203
+
params+= [FloatParameter(visible_if='kernel:rotation', qualifier='Q0', value=kwargs.get('Q0', 1.0), default_unit=u.dimensionless_unscaled, description='The quality factor for the secondary oscillation.')]
204
+
params+= [FloatParameter(visible_if='kernel:rotation', qualifier='dQ', value=kwargs.get('dQ', 1.0), default_unit=u.dimensionless_unscaled, description='The difference between the quality factors of the first and the second modes.')]
205
+
params+= [FloatParameter(visible_if='kernel:rotation', qualifier='f', value=kwargs.get('f', 1.0), default_unit=u.dimensionless_unscaled, description='The fractional amplitude of the secondary mode compared to the primary.')]
206
+
params+= [FloatParameter(visible_if='kernel:sho|matern32', qualifier='eps', value=kwargs.get('eps', 1e-5), default_unit=u.dimensionless_unscaled, description='A regularization parameter used for numerical stability.')]
207
+
208
+
# additional parameters for GPs
209
+
params+= [ChoiceParameter(qualifier='alg_operation', value='sum', choices=['sum', 'product'], default_unit=u.dimensionless_unscaled, description='Algebraic operation of this kernel with previous ones. Can be one of [sum, product]')]
210
+
211
+
returnParameterSet(params), []
212
+
213
+
defmodify_model(self, b, model_ps):
214
+
# GPS are handled separately and all simultaneously
0 commit comments