asteroid_spinprops 1.0.0__tar.gz → 1.0.1__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.
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/PKG-INFO +93 -8
- asteroid_spinprops-1.0.1/README.md +157 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/pyproject.toml +12 -8
- asteroid_spinprops-1.0.0/README.md +0 -76
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/__init__.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/__init__.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/dataprep.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/modelfit.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/periodest.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/ssptools.py +0 -0
- {asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/utils.py +0 -0
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: asteroid_spinprops
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
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
|
|
7
7
|
Author-email: odysseas.xenos@proton.me
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
-
Requires-Dist: astropy (
|
|
16
|
-
Requires-Dist: fink-utils (
|
|
17
|
-
Requires-Dist: nifty-ls (
|
|
18
|
-
Requires-Dist: pandas (
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
17
|
+
Requires-Dist: astropy (>=6.0)
|
|
18
|
+
Requires-Dist: fink-utils (>=0.47.0)
|
|
19
|
+
Requires-Dist: nifty-ls (>=1.1.0)
|
|
20
|
+
Requires-Dist: pandas (>=2.3)
|
|
21
|
+
Requires-Dist: pyarrow (>=18.1)
|
|
22
|
+
Requires-Dist: sbpy (>=0.5.0)
|
|
23
|
+
Requires-Dist: scipy (>=1.10)
|
|
24
|
+
Requires-Dist: tqdm (>=4.67)
|
|
21
25
|
Project-URL: Homepage, https://gitlab.com/odysseas_xenos/asteroid-spinprops
|
|
22
26
|
Project-URL: Repository, https://gitlab.com/odysseas_xenos/asteroid-spinprops
|
|
23
27
|
Description-Content-Type: text/markdown
|
|
@@ -37,6 +41,87 @@ Install the package via pip:
|
|
|
37
41
|
pip install asteroid_spinprops
|
|
38
42
|
```
|
|
39
43
|
|
|
44
|
+
## Input column requirements and preprocessing
|
|
45
|
+
|
|
46
|
+
`asteroid_spinprops` expects photometric measurements to follow the **Fink alert schema**.
|
|
47
|
+
If your DataFrame uses different column names, they must be renamed to the standard format before analysis.
|
|
48
|
+
|
|
49
|
+
The package maps common input columns to Fink-style fields:
|
|
50
|
+
|
|
51
|
+
| Expected name | Description |
|
|
52
|
+
|---------------|-------------|
|
|
53
|
+
| `cjd` | Observation time (JD) |
|
|
54
|
+
| `cmagpsf` | PSF magnitude |
|
|
55
|
+
| `csigmapsf` | Magnitude uncertainty |
|
|
56
|
+
| `cfid` | Filter identifier |
|
|
57
|
+
| `ra` | Right ascension (deg) |
|
|
58
|
+
| `dec` | Declination (deg) |
|
|
59
|
+
| `Phase` | Solar phase angle (deg) |
|
|
60
|
+
|
|
61
|
+
### Additional columns created during preprocessing
|
|
62
|
+
|
|
63
|
+
The preprocessing step also adds the following fields:
|
|
64
|
+
|
|
65
|
+
- **`cmred` — Reduced magnitude**
|
|
66
|
+
|
|
67
|
+
Computed from the heliocentric and observer-centric distances:
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
$$
|
|
71
|
+
\mathrm{cmred} = \mathrm{cmagpsf} - 5\log_{10}\!\left(\frac{r\,\Delta}{\mathrm{AU}^2}\right)
|
|
72
|
+
$$
|
|
73
|
+
where `Obj_Sun_LTC_km` = \(r\) and `Range_LTC_km` = \(\Delta\).
|
|
74
|
+
|
|
75
|
+
- **`jd_ltc` — Light-time–corrected Julian Date**
|
|
76
|
+
|
|
77
|
+
First converts MJD → JD (`+ 2400000.5`), then applies the correction
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
JD_\mathrm{ltc} = JD - \frac{\Delta}{c},
|
|
81
|
+
$$
|
|
82
|
+
|
|
83
|
+
using the one-way light-travel time in days.
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
pdf.rename(
|
|
87
|
+
columns={
|
|
88
|
+
"Your_JD_column": "cjd",
|
|
89
|
+
"Your_magnitudes_column": "cmagpsf",
|
|
90
|
+
"Your_phase_angle_column": "Phase",
|
|
91
|
+
"Your_RA_column": "ra",
|
|
92
|
+
"Your_Dec_column": "dec",
|
|
93
|
+
"Your_magnitude_uncertainty_column": "csigmapsf",
|
|
94
|
+
"Your_filter_column": "cfid",
|
|
95
|
+
},
|
|
96
|
+
inplace=True,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# Add missing columns
|
|
100
|
+
pdf["cmred"] = pdf["cmagpsf"] - 5 * np.log10(
|
|
101
|
+
pdf["Observer_SSO_distance_column"] * pdf["Sun_SSO_distance_column"] / (au**2)
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# LT correction
|
|
105
|
+
pdf["cjd"] = pdf["cjd"] + 2400000.5 # MJD to JD
|
|
106
|
+
pdf["jd_ltc"] = pdf["cjd"] - pdf["Observer_SSO_distance_column"] / c_kmday # light time correction
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Required inputs
|
|
111
|
+
|
|
112
|
+
Your input DataFrame must therefore include:
|
|
113
|
+
|
|
114
|
+
- time of observation
|
|
115
|
+
- PSF magnitude and uncertainty
|
|
116
|
+
- filter ID
|
|
117
|
+
- RA, Dec
|
|
118
|
+
- phase angle
|
|
119
|
+
- heliocentric distance (`Obj_Sun_LTC_km`)
|
|
120
|
+
- observer-centric distance (`Range_LTC_km`)
|
|
121
|
+
|
|
122
|
+
The preprocessing step renames these fields to the Fink schema, computes reduced magnitudes, and applies the light-time correction to the observation timestamps.
|
|
123
|
+
|
|
124
|
+
|
|
40
125
|
## Quick Start
|
|
41
126
|
```python
|
|
42
127
|
import numpy as np
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# asteroid-spinprops
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
**asteroid-spinprops** is a Python package providing tools to fit SHG1G2 and SOCCA photometric models to sparse asteroid photometry.
|
|
5
|
+
It supports multiband modeling, residual analysis and shape, period and pole orientation estimation for small solar system objects.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
Install the package via pip:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install asteroid_spinprops
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Input column requirements and preprocessing
|
|
17
|
+
|
|
18
|
+
`asteroid_spinprops` expects photometric measurements to follow the **Fink alert schema**.
|
|
19
|
+
If your DataFrame uses different column names, they must be renamed to the standard format before analysis.
|
|
20
|
+
|
|
21
|
+
The package maps common input columns to Fink-style fields:
|
|
22
|
+
|
|
23
|
+
| Expected name | Description |
|
|
24
|
+
|---------------|-------------|
|
|
25
|
+
| `cjd` | Observation time (JD) |
|
|
26
|
+
| `cmagpsf` | PSF magnitude |
|
|
27
|
+
| `csigmapsf` | Magnitude uncertainty |
|
|
28
|
+
| `cfid` | Filter identifier |
|
|
29
|
+
| `ra` | Right ascension (deg) |
|
|
30
|
+
| `dec` | Declination (deg) |
|
|
31
|
+
| `Phase` | Solar phase angle (deg) |
|
|
32
|
+
|
|
33
|
+
### Additional columns created during preprocessing
|
|
34
|
+
|
|
35
|
+
The preprocessing step also adds the following fields:
|
|
36
|
+
|
|
37
|
+
- **`cmred` — Reduced magnitude**
|
|
38
|
+
|
|
39
|
+
Computed from the heliocentric and observer-centric distances:
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
$$
|
|
43
|
+
\mathrm{cmred} = \mathrm{cmagpsf} - 5\log_{10}\!\left(\frac{r\,\Delta}{\mathrm{AU}^2}\right)
|
|
44
|
+
$$
|
|
45
|
+
where `Obj_Sun_LTC_km` = \(r\) and `Range_LTC_km` = \(\Delta\).
|
|
46
|
+
|
|
47
|
+
- **`jd_ltc` — Light-time–corrected Julian Date**
|
|
48
|
+
|
|
49
|
+
First converts MJD → JD (`+ 2400000.5`), then applies the correction
|
|
50
|
+
|
|
51
|
+
$$
|
|
52
|
+
JD_\mathrm{ltc} = JD - \frac{\Delta}{c},
|
|
53
|
+
$$
|
|
54
|
+
|
|
55
|
+
using the one-way light-travel time in days.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
pdf.rename(
|
|
59
|
+
columns={
|
|
60
|
+
"Your_JD_column": "cjd",
|
|
61
|
+
"Your_magnitudes_column": "cmagpsf",
|
|
62
|
+
"Your_phase_angle_column": "Phase",
|
|
63
|
+
"Your_RA_column": "ra",
|
|
64
|
+
"Your_Dec_column": "dec",
|
|
65
|
+
"Your_magnitude_uncertainty_column": "csigmapsf",
|
|
66
|
+
"Your_filter_column": "cfid",
|
|
67
|
+
},
|
|
68
|
+
inplace=True,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Add missing columns
|
|
72
|
+
pdf["cmred"] = pdf["cmagpsf"] - 5 * np.log10(
|
|
73
|
+
pdf["Observer_SSO_distance_column"] * pdf["Sun_SSO_distance_column"] / (au**2)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# LT correction
|
|
77
|
+
pdf["cjd"] = pdf["cjd"] + 2400000.5 # MJD to JD
|
|
78
|
+
pdf["jd_ltc"] = pdf["cjd"] - pdf["Observer_SSO_distance_column"] / c_kmday # light time correction
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Required inputs
|
|
83
|
+
|
|
84
|
+
Your input DataFrame must therefore include:
|
|
85
|
+
|
|
86
|
+
- time of observation
|
|
87
|
+
- PSF magnitude and uncertainty
|
|
88
|
+
- filter ID
|
|
89
|
+
- RA, Dec
|
|
90
|
+
- phase angle
|
|
91
|
+
- heliocentric distance (`Obj_Sun_LTC_km`)
|
|
92
|
+
- observer-centric distance (`Range_LTC_km`)
|
|
93
|
+
|
|
94
|
+
The preprocessing step renames these fields to the Fink schema, computes reduced magnitudes, and applies the light-time correction to the observation timestamps.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Quick Start
|
|
98
|
+
```python
|
|
99
|
+
import numpy as np
|
|
100
|
+
import pandas as pd
|
|
101
|
+
from asteroid_spinprops.ssolib import dataprep, periodest, modelfit
|
|
102
|
+
|
|
103
|
+
# Suppose `pdf` is your initial asteroid DataFrame
|
|
104
|
+
# Ensure all columns are converted to the required single row format.
|
|
105
|
+
pdf_s = pd.DataFrame({col: [np.array(pdf[col])] for col in pdf.columns})
|
|
106
|
+
|
|
107
|
+
# Convert filter IDs to numeric
|
|
108
|
+
unique_vals, inv = np.unique(pdf_s["cfid"].values[0], return_inverse=True)
|
|
109
|
+
numeric_filter = inv + 1
|
|
110
|
+
pdf_s["cfid"].values[0] = numeric_filter
|
|
111
|
+
|
|
112
|
+
# --- Data cleaning and filtering ---
|
|
113
|
+
clean_data, errorbar_rejects = dataprep.errorbar_filtering(data=pdf_s, mlimit=0.7928)
|
|
114
|
+
clean_data, projection_rejects = dataprep.projection_filtering(data=clean_data)
|
|
115
|
+
clean_data, iterative_rejects = dataprep.iterative_filtering(data=clean_data)
|
|
116
|
+
|
|
117
|
+
# --- Fit SHG1G2 model ---
|
|
118
|
+
shg1g2_params = modelfit.get_fit_params(
|
|
119
|
+
data=clean_data,
|
|
120
|
+
flavor="SHG1G2",
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# Compute residuals for period analysis
|
|
124
|
+
residuals_dataframe = modelfit.make_residuals_df(
|
|
125
|
+
clean_data, model_parameters=shg1g2_params
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# --- Estimate rotation period ---
|
|
129
|
+
p_in, k_val, p_rms, signal_peak, window_peak = periodest.get_multiband_period_estimate(
|
|
130
|
+
residuals_dataframe,
|
|
131
|
+
k_free=True,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Assess period robustness via bootstrap resampling
|
|
135
|
+
_, Nbs = periodest.perform_residual_resampling(
|
|
136
|
+
resid_df=residuals_dataframe,
|
|
137
|
+
p_min=0.03,
|
|
138
|
+
p_max=2,
|
|
139
|
+
k=int(k_val)
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# --- Fit SSHG1G2 (spin + multiband) model ---
|
|
143
|
+
SOCCA_params = modelfit.get_fit_params(
|
|
144
|
+
data=clean_data,
|
|
145
|
+
flavor="SSHG1G2",
|
|
146
|
+
shg1g2_constrained=True,
|
|
147
|
+
blind_scan=True,
|
|
148
|
+
period_in=p_in,
|
|
149
|
+
)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Models
|
|
153
|
+
Photometric models from Carry et al.(2024) {2024A&A...687A..38C}
|
|
154
|
+
and https://github.com/astrolabsoftware
|
|
155
|
+
|
|
156
|
+
## Project status
|
|
157
|
+
Under development
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "asteroid_spinprops"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.1"
|
|
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"}
|
|
7
7
|
]
|
|
8
8
|
license = {text = "MIT"}
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
|
|
11
12
|
dependencies = [
|
|
12
|
-
"astropy
|
|
13
|
-
"fink-utils
|
|
14
|
-
"nifty-ls
|
|
15
|
-
"pandas
|
|
16
|
-
"scipy
|
|
17
|
-
"tqdm
|
|
13
|
+
"astropy >=6.0",
|
|
14
|
+
"fink-utils >=0.47.0",
|
|
15
|
+
"nifty-ls >=1.1.0",
|
|
16
|
+
"pandas >=2.3",
|
|
17
|
+
"scipy >=1.10",
|
|
18
|
+
"tqdm >=4.67",
|
|
19
|
+
"sbpy >=0.5.0",
|
|
20
|
+
"pyarrow >=18.1"
|
|
18
21
|
]
|
|
19
22
|
|
|
20
23
|
[tool.poetry]
|
|
@@ -30,3 +33,4 @@ repository = "https://gitlab.com/odysseas_xenos/asteroid-spinprops"
|
|
|
30
33
|
[build-system]
|
|
31
34
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
32
35
|
build-backend = "poetry.core.masonry.api"
|
|
36
|
+
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# asteroid-spinprops
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
**asteroid-spinprops** is a Python package providing tools to fit SHG1G2 and SOCCA photometric models to sparse asteroid photometry.
|
|
5
|
-
It supports multiband modeling, residual analysis and shape, period and pole orientation estimation for small solar system objects.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
Install the package via pip:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
pip install asteroid_spinprops
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Quick Start
|
|
17
|
-
```python
|
|
18
|
-
import numpy as np
|
|
19
|
-
import pandas as pd
|
|
20
|
-
from asteroid_spinprops.ssolib import dataprep, periodest, modelfit
|
|
21
|
-
|
|
22
|
-
# Suppose `pdf` is your initial asteroid DataFrame
|
|
23
|
-
# Ensure all columns are converted to the required single row format.
|
|
24
|
-
pdf_s = pd.DataFrame({col: [np.array(pdf[col])] for col in pdf.columns})
|
|
25
|
-
|
|
26
|
-
# Convert filter IDs to numeric
|
|
27
|
-
unique_vals, inv = np.unique(pdf_s["cfid"].values[0], return_inverse=True)
|
|
28
|
-
numeric_filter = inv + 1
|
|
29
|
-
pdf_s["cfid"].values[0] = numeric_filter
|
|
30
|
-
|
|
31
|
-
# --- Data cleaning and filtering ---
|
|
32
|
-
clean_data, errorbar_rejects = dataprep.errorbar_filtering(data=pdf_s, mlimit=0.7928)
|
|
33
|
-
clean_data, projection_rejects = dataprep.projection_filtering(data=clean_data)
|
|
34
|
-
clean_data, iterative_rejects = dataprep.iterative_filtering(data=clean_data)
|
|
35
|
-
|
|
36
|
-
# --- Fit SHG1G2 model ---
|
|
37
|
-
shg1g2_params = modelfit.get_fit_params(
|
|
38
|
-
data=clean_data,
|
|
39
|
-
flavor="SHG1G2",
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
# Compute residuals for period analysis
|
|
43
|
-
residuals_dataframe = modelfit.make_residuals_df(
|
|
44
|
-
clean_data, model_parameters=shg1g2_params
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# --- Estimate rotation period ---
|
|
48
|
-
p_in, k_val, p_rms, signal_peak, window_peak = periodest.get_multiband_period_estimate(
|
|
49
|
-
residuals_dataframe,
|
|
50
|
-
k_free=True,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
# Assess period robustness via bootstrap resampling
|
|
54
|
-
_, Nbs = periodest.perform_residual_resampling(
|
|
55
|
-
resid_df=residuals_dataframe,
|
|
56
|
-
p_min=0.03,
|
|
57
|
-
p_max=2,
|
|
58
|
-
k=int(k_val)
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
# --- Fit SSHG1G2 (spin + multiband) model ---
|
|
62
|
-
SOCCA_params = modelfit.get_fit_params(
|
|
63
|
-
data=clean_data,
|
|
64
|
-
flavor="SSHG1G2",
|
|
65
|
-
shg1g2_constrained=True,
|
|
66
|
-
blind_scan=True,
|
|
67
|
-
period_in=p_in,
|
|
68
|
-
)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Models
|
|
72
|
-
Photometric models from Carry et al.(2024) {2024A&A...687A..38C}
|
|
73
|
-
and https://github.com/astrolabsoftware
|
|
74
|
-
|
|
75
|
-
## Project status
|
|
76
|
-
Under development
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asteroid_spinprops-1.0.0 → asteroid_spinprops-1.0.1}/asteroid_spinprops/ssolib/periodest.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|