asteroid_spinprops 1.3.6__py3-none-any.whl → 1.3.8__py3-none-any.whl

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.
File without changes
File without changes
@@ -173,7 +173,7 @@ def get_fit_params(
173
173
  etime = t2 - t1
174
174
  SOCCA_opt["invtime"] = etime
175
175
  return SOCCA_opt
176
- except (IndexError, ValueError):
176
+ except Exception:
177
177
  SOCCA_opt = {"Failed at bootsrap sampling": 1}
178
178
  if time_me:
179
179
  t2 = time.time()
@@ -188,9 +188,23 @@ def get_fit_params(
188
188
  rms = []
189
189
  model = []
190
190
 
191
- period_scan = np.linspace(
192
- period_sy - 20 / (24 * 60 * 60), period_sy + 20 / (24 * 60 * 60), 20
193
- )
191
+ # Add heliocentric distance mean
192
+ sma = data["Dhelio"].values[0].mean() # in AU
193
+
194
+ W = utils.period_range(sma, period_sy * 24) / 24 # in days
195
+ N = utils.Nintervals(sma)
196
+
197
+ Pmin = period_sy - W
198
+ Pmax = period_sy + W
199
+
200
+ period_scan = np.linspace(Pmin, Pmax, N)
201
+
202
+ if not np.isclose(period_scan, period_sy).any():
203
+ period_scan = np.sort(np.append(period_scan, period_sy))
204
+
205
+ # period_scan = np.linspace(
206
+ # period_sy - 20 / (24 * 60 * 60), period_sy + 20 / (24 * 60 * 60), 20
207
+ # )
194
208
 
195
209
  ra0, dec0 = shg1g2_params["alpha0"], shg1g2_params["delta0"]
196
210
 
@@ -257,7 +257,7 @@ def get_multiterm_period_estimate(
257
257
  residuals_dataframe["sigma"].values,
258
258
  normalization="standard",
259
259
  fit_mean=True,
260
- nterms_base=k_val,
260
+ nterms_base=int(k_val),
261
261
  nterms_band=1,
262
262
  )
263
263
  frequency, power = model.autopower(
@@ -380,11 +380,15 @@ def perform_residual_resampling(resid_df, p_min, p_max, k=1):
380
380
  Pog = 24 / Ptmp
381
381
  Pbs = np.zeros(25)
382
382
  for n in range(25):
383
- BS_df = resid_df.sample(n=len(resid_df), replace=True)
384
- Ptmp, _, _, _, _ = get_multiterm_period_estimate(
385
- BS_df, p_min=p_min, p_max=p_max, k_free=False, k_val=k
386
- )
387
- Pbs[n] = 24 / Ptmp
383
+ try:
384
+ BS_df = resid_df.sample(n=len(resid_df), replace=True)
385
+ Ptmp, _, _, _, _ = get_multiterm_period_estimate(
386
+ BS_df, p_min=p_min, p_max=p_max, k_free=False, k_val=k
387
+ )
388
+ Pbs[n] = 24 / Ptmp
389
+ except Exception:
390
+ Ptmp = 2 * Pog
391
+ Pbs[n] = 24 / Ptmp
388
392
  cond = np.abs(Pog - Pbs) / Pog < 1e-2
389
393
  Nbs = np.sum(np.ones(25)[cond])
390
394
  return BS_df, Nbs
File without changes
@@ -492,3 +492,40 @@ def trumpet(peak_diff_1, f_feat, f_obs):
492
492
  return -2 * f_feat
493
493
 
494
494
  return 0.0
495
+
496
+
497
+ def Nintervals(a):
498
+ """
499
+ Estimate the number of sampling intervals for period estimation
500
+ as a function of semi major axis a.
501
+ Parameters
502
+ ----------
503
+ a : float
504
+ Semi major axis in AU.
505
+ Returns
506
+ -------
507
+ int
508
+ Estimated number of intervals.
509
+ """
510
+ Na = 71.073 * np.exp(-1.21 * a) + 2.528
511
+ return int(Na)
512
+
513
+
514
+ def period_range(a, Psyn):
515
+ """
516
+ Compute the allowed period range around a reference synodic period.
517
+
518
+ Parameters
519
+ ----------
520
+ a : float
521
+ Semi major axis in AU.
522
+ Psyn : float
523
+ Reference synodic period in hours.
524
+ Returns
525
+ -------
526
+ float
527
+ Period range width in hours.
528
+ """
529
+ g = 1.69 * np.exp(-0.338 * a) - 5.069
530
+ W = 10 ** (2 * np.log10(Psyn) + g)
531
+ return W
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asteroid_spinprops
3
- Version: 1.3.6
3
+ Version: 1.3.8
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
@@ -57,10 +57,11 @@ The package maps common input columns to Fink-style fields:
57
57
  | `ra` | Right ascension (deg) |
58
58
  | `dec` | Declination (deg) |
59
59
  | `Phase` | Solar phase angle (deg) |
60
+ | `Dhelio` | Heliocentric distance (AU) |
60
61
 
61
- ### Additional columns created during preprocessing
62
+ ### Additional columns to be created during preprocessing
62
63
 
63
- The preprocessing step also adds the following fields:
64
+ The preprocessing step requires the following fields:
64
65
 
65
66
  - **`cmred` — Reduced magnitude**
66
67
 
@@ -70,11 +71,12 @@ The preprocessing step also adds the following fields:
70
71
  $$
71
72
  \mathrm{cmred} = \mathrm{cmagpsf} - 5\log_{10}\!\left(\frac{r\,\Delta}{\mathrm{AU}^2}\right)
72
73
  $$
74
+
73
75
  where `Obj_Sun_LTC_km` = \(r\) and `Range_LTC_km` = \(\Delta\).
74
76
 
75
77
  - **`jd_ltc` — Light-time–corrected Julian Date**
76
78
 
77
- First converts MJD → JD (`+ 2400000.5`), then applies the correction
79
+ First convert MJD → JD (`+ 2400000.5`), then apply the correction
78
80
 
79
81
  $$
80
82
  JD_\mathrm{ltc} = JD - \frac{\Delta}{c},
@@ -150,7 +152,8 @@ SOCCA_params = modelfit.get_fit_params(
150
152
  pole_blind=False,
151
153
  period_blind=True,
152
154
  period_in=None,
153
- period_quality_flag=True
155
+ period_quality_flag=True,
156
+ terminator=True
154
157
  )
155
158
 
156
159
 
@@ -167,7 +170,7 @@ residuals_dataframe = modelfit.make_residuals_df(
167
170
  )
168
171
 
169
172
  # --- Estimate rotation period ---
170
- p_in, k_val, p_rms, signal_peak, window_peak = periodest.get_multiband_period_estimate(
173
+ p_in, k_val, p_rms, signal_peak, window_peak = periodest.get_multiterm_period_estimate(
171
174
  residuals_dataframe,
172
175
  k_free=True,
173
176
  )
@@ -188,7 +191,8 @@ SOCCA_params = modelfit.get_fit_params(
188
191
  period_blind=False,
189
192
  pole_blind=False,
190
193
  period_in=p_in,
191
- period_quality_flag=False
194
+ period_quality_flag=False,
195
+ terminator=True
192
196
  )
193
197
  ```
194
198
 
@@ -0,0 +1,10 @@
1
+ asteroid_spinprops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ asteroid_spinprops/ssolib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ asteroid_spinprops/ssolib/dataprep.py,sha256=7PfkVNpLjPERkhr8dZQfN8haFCFmoeXB3fWuTSBLVuc,7848
4
+ asteroid_spinprops/ssolib/modelfit.py,sha256=hXNm_enW1MJ5p3bSmyzAZsL3QuM1-Fh8gtOjGGMngiI,23244
5
+ asteroid_spinprops/ssolib/periodest.py,sha256=iS--fVORQ5MzreN86cWu-b-WoWEg_5KetT1HS8jP-YE,13572
6
+ asteroid_spinprops/ssolib/ssptools.py,sha256=DlSgYtXenztRAtEV9d4itzp5OZMjkbXkW2yZ_Qumu4U,4490
7
+ asteroid_spinprops/ssolib/utils.py,sha256=G_vlSW9i_TDOU1-SP7crNPVWHN1ySRNjJYpgJvkVaYQ,14106
8
+ asteroid_spinprops-1.3.8.dist-info/METADATA,sha256=YoLQ1OfwR9parQ8MWnxFoX2tsVRpOy2nW_D2CKQhBSA,6239
9
+ asteroid_spinprops-1.3.8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
10
+ asteroid_spinprops-1.3.8.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- asteroid_spinprops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- asteroid_spinprops/ssolib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- asteroid_spinprops/ssolib/dataprep.py,sha256=7PfkVNpLjPERkhr8dZQfN8haFCFmoeXB3fWuTSBLVuc,7848
4
- asteroid_spinprops/ssolib/modelfit.py,sha256=NaGNChjeH6r2cpZOPB2ur3LQHDRPVLyok89gwx1ioOg,22745
5
- asteroid_spinprops/ssolib/periodest.py,sha256=dAKytw-Oelb35ZjDXHuxGe5L5H8UPVCX42eU1I0jTIo,13434
6
- asteroid_spinprops/ssolib/ssptools.py,sha256=DlSgYtXenztRAtEV9d4itzp5OZMjkbXkW2yZ_Qumu4U,4490
7
- asteroid_spinprops/ssolib/utils.py,sha256=kbe69JxyCnbMebqkObuMS-0DFulnlgLNHxHNbP_U9J4,13334
8
- asteroid_spinprops-1.3.6.dist-info/METADATA,sha256=ox6b-kZ6Vb48AX9h8OtDbbeArM9sBBFxZG7j8W2wXmM,6143
9
- asteroid_spinprops-1.3.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
10
- asteroid_spinprops-1.3.6.dist-info/RECORD,,