asteroid_spinprops 1.2.2__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asteroid_spinprops
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: Collection of tools used for fitting sHG1G2 and SOCCA photometric models to sparse asteroid photometry
5
5
  License: MIT
6
6
  Author: Odysseas
@@ -225,14 +225,14 @@ def get_fit_params(
225
225
  )
226
226
 
227
227
  for ra, dec in zip(ra_init, dec_init):
228
- for period_in in period_scan:
228
+ for period_sc in period_scan:
229
229
  p_in = [
230
230
  shg1g2_params[H_key],
231
231
  0.15,
232
232
  0.15, # G1,2
233
233
  np.radians(ra),
234
234
  np.radians(dec),
235
- period_in, # in days
235
+ period_sc, # in days
236
236
  shg1g2_params["a_b"],
237
237
  shg1g2_params["a_c"],
238
238
  0.1,
@@ -268,8 +268,9 @@ def get_fit_params(
268
268
  SOCCA_opt["Nbs"] = Nbs
269
269
  except Exception:
270
270
  SOCCA_opt["Period_class"] = -1 # Classification error
271
- SOCCA_opt["prms"] = p_rms
272
- SOCCA_opt["k_terms"] = k_val
271
+ if period_in is None:
272
+ SOCCA_opt["prms"] = p_rms
273
+ SOCCA_opt["k_terms"] = k_val
273
274
  except Exception:
274
275
  SOCCA_opt = {"Failed at SOCCA inversion": 1}
275
276
  return SOCCA_opt
@@ -210,7 +210,8 @@ def get_multiterm_period_estimate(
210
210
 
211
211
  rms = np.sqrt(np.mean(residuals**2))
212
212
  n_params = 2 * k + 1 + 3 * len(bands)
213
- dof = len(residuals) - n_params
213
+ dof = n_params
214
+ N = len(residuals)
214
215
 
215
216
  results.append((k, f_best, rms, dof, n_params))
216
217
 
@@ -219,13 +220,13 @@ def get_multiterm_period_estimate(
219
220
  for i in range(len(results) - 1):
220
221
  k, f_best, rss, dof, n_params = results[i]
221
222
  k_next, f_best_next, rss_next, dof_next, n_params_next = results[i + 1]
222
- F = ((rss - rss_next) / (dof - dof_next)) / (rss_next / dof_next)
223
+ F = ((rss**2/rss_next**2) - 1) * ((N - dof_next) / (dof_next - dof))
223
224
 
224
225
  # Here crit = Fstat value for which model_2 (more complex) is in fact better than model_1 (less complex)
225
226
  crit = ftest.ppf(
226
227
  q=0.99,
227
228
  dfn=n_params_next - n_params,
228
- dfd=len(residuals) - n_params_next,
229
+ dfd=N - n_params_next,
229
230
  )
230
231
 
231
232
  model_comparison.loc[i, "k"] = k
@@ -233,7 +234,7 @@ def get_multiterm_period_estimate(
233
234
  model_comparison.loc[i, "f_best"] = f_best
234
235
  model_comparison.loc[i, "Fstat"] = F
235
236
  model_comparison.loc[i, "alpha_crit"] = crit
236
- model_comparison.loc[i, "rms"] = rms
237
+ model_comparison.loc[i, "rms"] = rss
237
238
 
238
239
  cond = model_comparison["Fstat"] > model_comparison["alpha_crit"]
239
240
  model_comparison = model_comparison[
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "asteroid_spinprops"
3
- version = "1.2.2"
3
+ version = "1.2.4"
4
4
  description = "Collection of tools used for fitting sHG1G2 and SOCCA photometric models to sparse asteroid photometry"
5
5
  authors = [
6
6
  {name = "Odysseas",email = "odysseas.xenos@proton.me"}