Skip to content

Luminosity

Protostellar photospheric and accretion luminosities.

LuminosityObject

Zero-age main sequence and accretion luminosities for a protostar.

Implements ZAMS mass-luminosity and mass-radius fits, combined with an accretion model, to compute a protostar's total (photospheric + accretion) luminosity and its FUV-band fraction.

Parameters:

Name Type Description Default
accObj object

Accretion model instance (e.g. PowerLawAccrete) exposing an acc method.

required

Attributes:

Name Type Description
accObj object

See Parameters.

Source code in src/ocotillopmf/luminosity.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
class LuminosityObject:
    """Zero-age main sequence and accretion luminosities for a protostar.

    Implements ZAMS mass-luminosity and mass-radius fits, combined with
    an accretion model, to compute a protostar's total (photospheric +
    accretion) luminosity and its FUV-band fraction.

    Parameters
    ----------
    accObj : object
        Accretion model instance (e.g.
        [`PowerLawAccrete`][ocotillopmf.accretion.PowerLawAccrete]) exposing an
        ``acc`` method.

    Attributes
    ----------
    accObj : object
        See Parameters.
    """

    # PARAMETERS
    RSUN = 6.957e10
    LSUN = 3.848e33
    ALPHA = 0.39704170
    BETA = 8.52762600
    GAMMA = 0.00025546
    DELTA = 5.43288900
    EPSILON = 5.56357900
    ZETA = 0.78866060
    ETA = 0.00586685
    THETA = 1.71535900
    IOTA = 6.59778800
    KAPPA = 10.08855000
    LAMBDA = 1.01249500
    MU = 0.07490166
    NU = 0.01077422
    XI = 3.08223400
    UPSILON = 17.84778000
    PI = 0.00022582
    G = 6.67259e-8
    MSUN = 1.988e33

    accObj: PowerLawAccrete | None = None

    def lZAMS(self, m: ArrayLike) -> float | np.ndarray:
        """Zero-age main sequence luminosity fit.

        Parameters
        ----------
        m : float or array_like
            Stellar mass, in Msun.

        Returns
        -------
        float or ndarray
            ZAMS luminosity, in Lsun.
        """
        LZAMS = (self.ALPHA * m**5.5 + self.BETA * m**11) / (
            self.GAMMA
            + m**3
            + self.DELTA * m**5
            + self.EPSILON * m**7
            + self.ZETA * m**8
            + self.ETA * m**9.5
        )
        return LZAMS

    def rZAMS(self, m: ArrayLike) -> float | np.ndarray:
        """Zero-age main sequence radius fit.

        Parameters
        ----------
        m : float or array_like
            Stellar mass, in Msun.

        Returns
        -------
        float or ndarray
            ZAMS radius, in Rsun.
        """
        RZAMS = (
            self.THETA * m**2.5
            + self.IOTA * m**6.5
            + self.KAPPA * m**11
            + self.LAMBDA * m**19
            + self.MU * m**19.5
        ) / (
            self.NU
            + self.XI * m**2
            + self.UPSILON * m**8.5
            + m**18.5
            + self.PI * m**19.5
        )
        return RZAMS

    def LZAMS(self, m: ArrayLike, mf: ArrayLike) -> float | np.ndarray:
        """Zero-age main sequence luminosity, in cgs units.

        Parameters
        ----------
        m : float or array_like
            Current stellar mass, in Msun.
        mf : float or array_like
            Final stellar mass, in Msun. Unused; kept for a consistent
            ``(m, mf)`` call signature across luminosity methods.

        Returns
        -------
        float or ndarray
            ZAMS luminosity, in erg/s.
        """
        LZ = self.lZAMS(m) * self.LSUN
        return LZ

    def LACC(
        self, m: ArrayLike, mf: ArrayLike, r: ArrayLike
    ) -> float | np.ndarray:  # All in solar units
        """Accretion luminosity.

        Parameters
        ----------
        m : float or array_like
            Current stellar mass, in Msun.
        mf : float or array_like
            Final stellar mass, in Msun.
        r : float or array_like
            Stellar radius, in Rsun.

        Returns
        -------
        float or ndarray
            Accretion luminosity, in erg/s.
        """
        solarAcc_to_cgs = 6.305286e25  # to g/s
        LA = (self.G * (m * self.MSUN) * self.accObj.acc(m, mf) * solarAcc_to_cgs) / (
            r * self.RSUN
        )
        return LA

    def FUV_Frac(self, L: ArrayLike, r: ArrayLike) -> float | np.ndarray:
        """Fraction of luminosity emitted in the FUV band.

        Estimates an effective temperature from `L` and `r`, then looks
        up the corresponding FUV fraction from a tabulated blackbody
        FUV-fraction curve.

        Parameters
        ----------
        L : float or array_like
            Luminosity, in erg/s.
        r : float or array_like
            Radius, in cm.

        Returns
        -------
        float or ndarray
            Fraction of `L` emitted in the FUV band, in [0, 1].
        """
        SIGMA = 5.6704e-5
        Teff = (L / (4.0 * np.pi * r * r * SIGMA)) ** (0.25)
        x_arr = [
            3.0,
            3.11111111111,
            3.22222222222,
            3.33333333333,
            3.44444444444,
            3.55555555556,
            3.66666666667,
            3.77777777778,
            3.88888888889,
            4.0,
            4.07142857143,
            4.14285714286,
            4.21428571429,
            4.28571428571,
            4.35714285714,
            4.42857142857,
            4.5,
            4.57142857143,
            4.64285714286,
            4.71428571429,
            4.78571428571,
            4.85714285714,
            4.92857142857,
            5.0,
            5.11111111111,
            5.22222222222,
            5.33333333333,
            5.44444444444,
            5.55555555556,
            5.66666666667,
            5.77777777778,
            5.88888888889,
            6.0,
        ]
        f_arr = [
            0.0,
            1.36770358435e-16,
            8.61653258138e-15,
            5.26258146666e-11,
            3.70098840631e-08,
            5.0568717347e-06,
            0.000195192270093,
            0.00284793494426,
            0.0197126224006,
            0.0772881806527,
            0.147011634854,
            0.240578127358,
            0.345971543508,
            0.444191207643,
            0.515303033114,
            0.54557500541,
            0.532074541579,
            0.482402999901,
            0.410347804342,
            0.330421281869,
            0.253964856801,
            0.187726633597,
            0.134328849088,
            0.0935685411832,
            0.0510859708182,
            0.0267964291578,
            0.0136432190711,
            0.00679353459533,
            0.00332675938709,
            0.00160869232546,
            0.000770502283946,
            0.000366365690472,
            0.000173237354368,
        ]
        frac = si.interp1d(x_arr, f_arr, kind="linear")
        try:
            ff = []
            for ti in Teff:
                if (np.log10(ti) < 3) or (np.log10(ti) > 6):
                    ff.append(0.0)
                else:
                    ff.append(frac(np.log10(ti)))
            return np.array(ff)
        except TypeError:
            if (np.log10(Teff) < 3) or (np.log10(Teff) > 6):
                return 0.0
            else:
                return frac(np.log10(Teff))

    def FUV_LUM(
        self, m: ArrayLike, mf: ArrayLike, r: ArrayLike
    ) -> float | np.ndarray:
        """Total FUV luminosity, combining ZAMS and accretion components.

        Parameters
        ----------
        m : float or array_like
            Current stellar mass, in Msun.
        mf : float or array_like
            Final stellar mass, in Msun.
        r : float or array_like
            Stellar radius, in Rsun.

        Returns
        -------
        float or ndarray
            Combined ZAMS + accretion FUV luminosity, in erg/s.
        """
        lz = self.LZAMS(m, mf)
        la = self.LACC(m, mf, r)
        lzfuv = lz * self.FUV_Frac(lz, r * self.RSUN)
        lafuv = la * self.FUV_Frac(la, r * self.RSUN)
        return lzfuv + lafuv

    def __init__(self, accObj: PowerLawAccrete) -> None:
        self.accObj = accObj

lZAMS(m)

Zero-age main sequence luminosity fit.

Parameters:

Name Type Description Default
m float or array_like

Stellar mass, in Msun.

required

Returns:

Type Description
float or ndarray

ZAMS luminosity, in Lsun.

Source code in src/ocotillopmf/luminosity.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def lZAMS(self, m: ArrayLike) -> float | np.ndarray:
    """Zero-age main sequence luminosity fit.

    Parameters
    ----------
    m : float or array_like
        Stellar mass, in Msun.

    Returns
    -------
    float or ndarray
        ZAMS luminosity, in Lsun.
    """
    LZAMS = (self.ALPHA * m**5.5 + self.BETA * m**11) / (
        self.GAMMA
        + m**3
        + self.DELTA * m**5
        + self.EPSILON * m**7
        + self.ZETA * m**8
        + self.ETA * m**9.5
    )
    return LZAMS

rZAMS(m)

Zero-age main sequence radius fit.

Parameters:

Name Type Description Default
m float or array_like

Stellar mass, in Msun.

required

Returns:

Type Description
float or ndarray

ZAMS radius, in Rsun.

Source code in src/ocotillopmf/luminosity.py
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
def rZAMS(self, m: ArrayLike) -> float | np.ndarray:
    """Zero-age main sequence radius fit.

    Parameters
    ----------
    m : float or array_like
        Stellar mass, in Msun.

    Returns
    -------
    float or ndarray
        ZAMS radius, in Rsun.
    """
    RZAMS = (
        self.THETA * m**2.5
        + self.IOTA * m**6.5
        + self.KAPPA * m**11
        + self.LAMBDA * m**19
        + self.MU * m**19.5
    ) / (
        self.NU
        + self.XI * m**2
        + self.UPSILON * m**8.5
        + m**18.5
        + self.PI * m**19.5
    )
    return RZAMS

LZAMS(m, mf)

Zero-age main sequence luminosity, in cgs units.

Parameters:

Name Type Description Default
m float or array_like

Current stellar mass, in Msun.

required
mf float or array_like

Final stellar mass, in Msun. Unused; kept for a consistent (m, mf) call signature across luminosity methods.

required

Returns:

Type Description
float or ndarray

ZAMS luminosity, in erg/s.

Source code in src/ocotillopmf/luminosity.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
def LZAMS(self, m: ArrayLike, mf: ArrayLike) -> float | np.ndarray:
    """Zero-age main sequence luminosity, in cgs units.

    Parameters
    ----------
    m : float or array_like
        Current stellar mass, in Msun.
    mf : float or array_like
        Final stellar mass, in Msun. Unused; kept for a consistent
        ``(m, mf)`` call signature across luminosity methods.

    Returns
    -------
    float or ndarray
        ZAMS luminosity, in erg/s.
    """
    LZ = self.lZAMS(m) * self.LSUN
    return LZ

LACC(m, mf, r)

Accretion luminosity.

Parameters:

Name Type Description Default
m float or array_like

Current stellar mass, in Msun.

required
mf float or array_like

Final stellar mass, in Msun.

required
r float or array_like

Stellar radius, in Rsun.

required

Returns:

Type Description
float or ndarray

Accretion luminosity, in erg/s.

Source code in src/ocotillopmf/luminosity.py
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
def LACC(
    self, m: ArrayLike, mf: ArrayLike, r: ArrayLike
) -> float | np.ndarray:  # All in solar units
    """Accretion luminosity.

    Parameters
    ----------
    m : float or array_like
        Current stellar mass, in Msun.
    mf : float or array_like
        Final stellar mass, in Msun.
    r : float or array_like
        Stellar radius, in Rsun.

    Returns
    -------
    float or ndarray
        Accretion luminosity, in erg/s.
    """
    solarAcc_to_cgs = 6.305286e25  # to g/s
    LA = (self.G * (m * self.MSUN) * self.accObj.acc(m, mf) * solarAcc_to_cgs) / (
        r * self.RSUN
    )
    return LA

FUV_Frac(L, r)

Fraction of luminosity emitted in the FUV band.

Estimates an effective temperature from L and r, then looks up the corresponding FUV fraction from a tabulated blackbody FUV-fraction curve.

Parameters:

Name Type Description Default
L float or array_like

Luminosity, in erg/s.

required
r float or array_like

Radius, in cm.

required

Returns:

Type Description
float or ndarray

Fraction of L emitted in the FUV band, in [0, 1].

Source code in src/ocotillopmf/luminosity.py
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
def FUV_Frac(self, L: ArrayLike, r: ArrayLike) -> float | np.ndarray:
    """Fraction of luminosity emitted in the FUV band.

    Estimates an effective temperature from `L` and `r`, then looks
    up the corresponding FUV fraction from a tabulated blackbody
    FUV-fraction curve.

    Parameters
    ----------
    L : float or array_like
        Luminosity, in erg/s.
    r : float or array_like
        Radius, in cm.

    Returns
    -------
    float or ndarray
        Fraction of `L` emitted in the FUV band, in [0, 1].
    """
    SIGMA = 5.6704e-5
    Teff = (L / (4.0 * np.pi * r * r * SIGMA)) ** (0.25)
    x_arr = [
        3.0,
        3.11111111111,
        3.22222222222,
        3.33333333333,
        3.44444444444,
        3.55555555556,
        3.66666666667,
        3.77777777778,
        3.88888888889,
        4.0,
        4.07142857143,
        4.14285714286,
        4.21428571429,
        4.28571428571,
        4.35714285714,
        4.42857142857,
        4.5,
        4.57142857143,
        4.64285714286,
        4.71428571429,
        4.78571428571,
        4.85714285714,
        4.92857142857,
        5.0,
        5.11111111111,
        5.22222222222,
        5.33333333333,
        5.44444444444,
        5.55555555556,
        5.66666666667,
        5.77777777778,
        5.88888888889,
        6.0,
    ]
    f_arr = [
        0.0,
        1.36770358435e-16,
        8.61653258138e-15,
        5.26258146666e-11,
        3.70098840631e-08,
        5.0568717347e-06,
        0.000195192270093,
        0.00284793494426,
        0.0197126224006,
        0.0772881806527,
        0.147011634854,
        0.240578127358,
        0.345971543508,
        0.444191207643,
        0.515303033114,
        0.54557500541,
        0.532074541579,
        0.482402999901,
        0.410347804342,
        0.330421281869,
        0.253964856801,
        0.187726633597,
        0.134328849088,
        0.0935685411832,
        0.0510859708182,
        0.0267964291578,
        0.0136432190711,
        0.00679353459533,
        0.00332675938709,
        0.00160869232546,
        0.000770502283946,
        0.000366365690472,
        0.000173237354368,
    ]
    frac = si.interp1d(x_arr, f_arr, kind="linear")
    try:
        ff = []
        for ti in Teff:
            if (np.log10(ti) < 3) or (np.log10(ti) > 6):
                ff.append(0.0)
            else:
                ff.append(frac(np.log10(ti)))
        return np.array(ff)
    except TypeError:
        if (np.log10(Teff) < 3) or (np.log10(Teff) > 6):
            return 0.0
        else:
            return frac(np.log10(Teff))

FUV_LUM(m, mf, r)

Total FUV luminosity, combining ZAMS and accretion components.

Parameters:

Name Type Description Default
m float or array_like

Current stellar mass, in Msun.

required
mf float or array_like

Final stellar mass, in Msun.

required
r float or array_like

Stellar radius, in Rsun.

required

Returns:

Type Description
float or ndarray

Combined ZAMS + accretion FUV luminosity, in erg/s.

Source code in src/ocotillopmf/luminosity.py
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
def FUV_LUM(
    self, m: ArrayLike, mf: ArrayLike, r: ArrayLike
) -> float | np.ndarray:
    """Total FUV luminosity, combining ZAMS and accretion components.

    Parameters
    ----------
    m : float or array_like
        Current stellar mass, in Msun.
    mf : float or array_like
        Final stellar mass, in Msun.
    r : float or array_like
        Stellar radius, in Rsun.

    Returns
    -------
    float or ndarray
        Combined ZAMS + accretion FUV luminosity, in erg/s.
    """
    lz = self.LZAMS(m, mf)
    la = self.LACC(m, mf, r)
    lzfuv = lz * self.FUV_Frac(lz, r * self.RSUN)
    lafuv = la * self.FUV_Frac(la, r * self.RSUN)
    return lzfuv + lafuv