コード例 #1
0
    def __init__(self, lc=None, norm='frac', gti=None):
        """
        Make a Periodogram (power spectrum) from a (binned) light curve.
        Periodograms can be Leahy normalized or fractional rms normalized.
        You can also make an empty Periodogram object to populate with your
        own fourier-transformed data (this can sometimes be useful when making
        binned periodograms).

        Parameters
        ----------
        lc: lightcurve.Lightcurve object, optional, default None
            The light curve data to be Fourier-transformed.

        norm: {"leahy" | "frac" | "abs" | "none" }, optional, default "frac"
            The normaliation of the periodogram to be used. Options are
            "leahy", "frac", "abs" and "none", default is "frac".

        Other Parameters
        ----------------
        gti: 2-d float array
            [[gti0_0, gti0_1], [gti1_0, gti1_1], ...] -- Good Time intervals.
            This choice overrides the GTIs in the single light curves. Use with
            care!

        Attributes
        ----------
        norm: {"leahy" | "frac" | "abs" | "none"}
            the normalization of the periodogram

        freq: numpy.ndarray
            The array of mid-bin frequencies that the Fourier transform samples

        power: numpy.ndarray
            The array of normalized squared absolute values of Fourier
            amplitudes

        power_err: numpy.ndarray
            The uncertainties of `power`.
            An approximation for each bin given by "power_err= power/Sqrt(m)".
            Where `m` is the number of power averaged in each bin (by frequency
            binning, or averaging powerspectrum). Note that for a single
            realization (m=1) the error is equal to the power.

        df: float
            The frequency resolution

        m: int
            The number of averaged powers in each bin

        n: int
            The number of data points in the light curve

        nphots: float
            The total number of photons in the light curve

        """

        Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
        self.nphots = self.nphots1
コード例 #2
0
ファイル: powerspectrum.py プロジェクト: pabell/stingray
    def __init__(self, lc=None, norm='frac', gti=None):
        """
        Make a Periodogram (power spectrum) from a (binned) light curve.
        Periodograms can be Leahy normalized or fractional rms normalized.
        You can also make an empty Periodogram object to populate with your
        own fourier-transformed data (this can sometimes be useful when making
        binned periodograms).

        Parameters
        ----------
        lc: lightcurve.Lightcurve object, optional, default None
            The light curve data to be Fourier-transformed.

        norm: {"leahy" | "frac" | "abs" | "none" }, optional, default "frac"
            The normaliation of the periodogram to be used. Options are
            "leahy", "frac", "abs" and "none", default is "frac".

        Other Parameters
        ----------------
        gti: 2-d float array
            [[gti0_0, gti0_1], [gti1_0, gti1_1], ...] -- Good Time intervals.
            This choice overrides the GTIs in the single light curves. Use with
            care!

        Attributes
        ----------
        norm: {"leahy" | "frac" | "abs" | "none"}
            the normalization of the periodogram

        freq: numpy.ndarray
            The array of mid-bin frequencies that the Fourier transform samples

        power: numpy.ndarray
            The array of normalized squared absolute values of Fourier
            amplitudes

        power_err: numpy.ndarray
            The uncertainties of `power`.
            An approximation for each bin given by "power_err= power/Sqrt(m)".
            Where `m` is the number of power averaged in each bin (by frequency
            binning, or averaging powerspectrum). Note that for a single
            realization (m=1) the error is equal to the power.

        df: float
            The frequency resolution

        m: int
            The number of averaged powers in each bin

        n: int
            The number of data points in the light curve

        nphots: float
            The total number of photons in the light curve

        """

        Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
        self.nphots = self.nphots1
コード例 #3
0
    def __init__(self, data=None, norm="frac", gti=None,
                 dt=None, lc=None):
        if lc is not None:
            warnings.warn("The lc keyword is now deprecated. Use data "
                          "instead", DeprecationWarning)
        if data is None:
            data = lc

        Crossspectrum.__init__(self, data1=data, data2=data, norm=norm, gti=gti,
                               dt=dt)
        self.nphots = self.nphots1
        self.dt = dt
コード例 #4
0
ファイル: powerspectrum.py プロジェクト: evandromr/stingray
    def __init__(self, lc=None, norm='frac', gti=None):
        """
        Make a Periodogram (power spectrum) from a (binned) light curve.
        Periodograms can be Leahy normalized or fractional rms normalized.
        You can also make an empty Periodogram object to populate with your
        own fourier-transformed data (this can sometimes be useful when making
        binned periodograms).

        Parameters
        ----------
        lc: lightcurve.Lightcurve object, optional, default None
            The light curve data to be Fourier-transformed.

        norm: {"leahy" | "rms"}, optional, default "rms"
            The normaliation of the periodogram to be used. Options are
            "leahy" or "rms", default is "rms".

        Other Parameters
        ----------------
        gti: 2-d float array
            [[gti0_0, gti0_1], [gti1_0, gti1_1], ...] -- Good Time intervals.
            This choice overrides the GTIs in the single light curves. Use with
            care!

        Attributes
        ----------
        norm: {"leahy" | "rms"}
            the normalization of the periodogram

        freq: numpy.ndarray
            The array of mid-bin frequencies that the Fourier transform samples

        power: numpy.ndarray
            The array of normalized squared absolute values of Fourier
            amplitudes

        df: float
            The frequency resolution

        m: int
            The number of averaged powers in each bin

        n: int
            The number of data points in the light curve

        nphots: float
            The total number of photons in the light curve

        """
        Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
        self.nphots = self.nphots1
コード例 #5
0
    def __init__(self, lc=None, norm='frac', gti=None):
        """
        Make a Periodogram (power spectrum) from a (binned) light curve.
        Periodograms can be Leahy normalized or fractional rms normalized.
        You can also make an empty Periodogram object to populate with your
        own fourier-transformed data (this can sometimes be useful when making
        binned periodograms).

        Parameters
        ----------
        lc: lightcurve.Lightcurve object, optional, default None
            The light curve data to be Fourier-transformed.

        norm: {"leahy" | "rms"}, optional, default "rms"
            The normaliation of the periodogram to be used. Options are
            "leahy" or "rms", default is "rms".

        Other Parameters
        ----------------
        gti: 2-d float array
            [[gti0_0, gti0_1], [gti1_0, gti1_1], ...] -- Good Time intervals.
            This choice overrides the GTIs in the single light curves. Use with
            care!

        Attributes
        ----------
        norm: {"leahy" | "rms"}
            the normalization of the periodogram

        freq: numpy.ndarray
            The array of mid-bin frequencies that the Fourier transform samples

        power: numpy.ndarray
            The array of normalized squared absolute values of Fourier
            amplitudes

        df: float
            The frequency resolution

        m: int
            The number of averaged powers in each bin

        n: int
            The number of data points in the light curve

        nphots: float
            The total number of photons in the light curve

        """
        Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
        self.nphots = self.nphots1
コード例 #6
0
ファイル: powerspectrum.py プロジェクト: abigailStev/stingray
    def __init__(self, data=None, norm="frac", gti=None,
                 dt=None, lc=None, skip_checks=False, legacy=False):

        self._type = None
        if lc is not None:
            warnings.warn("The lc keyword is now deprecated. Use data "
                          "instead", DeprecationWarning)
        if data is None:
            data = lc

        good_input = True
        if not skip_checks:
            good_input = self.initial_checks(
                data1=data,
                data2=data,
                norm=norm,
                gti=gti,
                lc1=lc,
                lc2=lc,
                dt=dt
            )

        norm = norm.lower()
        self.norm = norm
        self.dt = dt

        if not good_input:
            return self._initialize_empty()

        if not legacy and data is not None:
            return self._initialize_from_any_input(data, dt=dt, norm=norm)

        Crossspectrum.__init__(self, data1=data, data2=data, norm=norm, gti=gti,
                               dt=dt, skip_checks=True, legacy=legacy)
        self.nphots = self.nphots1
        self.dt = dt
コード例 #7
0
ファイル: powerspectrum.py プロジェクト: fjhzwl/stingray
 def __init__(self, lc=None, norm='frac', gti=None):
     Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
     self.nphots = self.nphots1
コード例 #8
0
ファイル: powerspectrum.py プロジェクト: abigailStev/stingray
 def __init__(self, lc=None, norm='frac', gti=None):
     Crossspectrum.__init__(self, lc1=lc, lc2=lc, norm=norm, gti=gti)
     self.nphots = self.nphots1