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
Carefully document which fields are used by your function or method.
42
42
43
43
* Dictionary-like objects may be allowed for user input, but should be internally converted to a ``DataClass`` object with the `~sbpy.data.dataclass_input` decorator:
44
44
45
-
.. code-block:: python
45
+
.. code-block:: python
46
46
47
-
@dataclass_input(eph=Ephem)
48
-
defH11(eph):
49
-
...
47
+
@dataclass_input(eph=Ephem)
48
+
defH11(eph):
49
+
...
50
50
51
51
The same, but using function annotations:
52
52
53
-
.. code-block:: python
53
+
.. code-block:: python
54
54
55
-
@dataclass_input
56
-
defH11(eph: Ephem):
57
-
...
55
+
@dataclass_input
56
+
defH11(eph: Ephem):
57
+
...
58
58
59
59
* Exceptions are allowed when only one parameter is needed, e.g., ``phase_func(phase)``. But instead consider using the relevant ``DataClass`` object, and decorating the function with `~sbpy.data.quantity_to_dataclass`:
60
60
61
-
.. code-block:: python
61
+
.. code-block:: python
62
62
63
-
@quantity_to_dataclass(eph=(Ephem, 'phase'))
64
-
defphase_func(eph):
65
-
...
63
+
@quantity_to_dataclass(eph=(Ephem, 'phase'))
64
+
defphase_func(eph):
65
+
...
66
66
67
67
The decorator may be stacked with``dataclass_input``for maximum
68
68
flexibility:
69
69
70
-
.. code-block:: python
70
+
.. code-block:: python
71
71
72
-
@dataclass_input
73
-
@quantity_to_dataclass(eph=(Ephem, 'phase'))
74
-
defphase_func(eph):
75
-
...
72
+
@dataclass_input
73
+
@quantity_to_dataclass(eph=(Ephem, 'phase'))
74
+
def phase_func(eph):
75
+
...
76
76
77
77
78
78
Append fields to ``DataClass`` at the user's request
@@ -94,11 +94,11 @@ Cite relevant works
94
94
95
95
* Citations may be executed internally with :func:`sbpy.bib.register`, or via the `~sbpy.bib.cite` decorator:
96
96
97
-
.. code-block:: python
97
+
.. code-block:: python
98
98
99
-
@cite({'method': '1687pnpm.book.....N'})
100
-
defforce(mass, acceleration):
101
-
return mass * acceleration
99
+
@cite({'method': '1687pnpm.book.....N'})
100
+
def force(mass, acceleration):
101
+
return mass * acceleration
102
102
103
103
* Labels describing references (``'method'``in the above example) are
104
104
required to start with the following strings: ``'method'`` (for
The *Afρ* parameter of A'Hearn et al (1984) is based on observations of idealized cometary dust comae. It is proportional to the observed flux density within a circular aperture. The quantity is the product of dust albedo, dust filling factor, and the radius of the aperture at the distance of the comet. It carries the units of *ρ* (length), and under certain assumptions is proportional to the dust production rate of the comet:
10
10
11
-
.. math::
11
+
.. math::
12
12
13
-
Afρ = \frac{4 Δ^2 r_h^2}{ρ}\frac{F_c}{F_⊙}
13
+
Afρ = \frac{4 Δ^2 r_h^2}{ρ}\frac{F_c}{F_⊙}
14
14
15
15
where *Δ* and *ρ* have the same (linear) units, but :math:`r_h` is in units of au. :math:`F_c` * is the flux density of the comet in the aperture, and :math:`F_⊙` is that of the Sun at 1 au in the same units. See A'Hearn et al. (1984) and Fink & Rubin (2012) for more details.
16
16
17
17
The *εfρ* parameter is the thermal emission counterpart to *Afρ*, replacing albedo with IR emissivity, *ε*, and the solar spectrum with the Planck function, *B*:
18
18
19
-
.. math::
19
+
.. math::
20
20
21
-
εfρ = \frac{F_c Δ^2}{π ρ B(T_c)}
21
+
εfρ = \frac{F_c Δ^2}{π ρ B(T_c)}
22
22
23
23
where :math:`T_c` is the spectral temperature of the continuum (Kelley et al. 2013).
0 commit comments