How to use the cdflib.epochs_astropy.CDFAstropy function in cdflib

To help you get started, we’ve selected a few cdflib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MAVENSDC / cdflib / tests / test_astropy_epochs.py View on Github external
def test_parse_cdftt2000():
    x = "2004-03-01 12:24:22.351793238"
    parsed = cdfepoch.parse(x)
    assert parsed == [131415926535793232]

    assert cdfepoch.to_datetime(parsed) == [datetime(2004, 3, 1, 12, 25, 26, 535793)]
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def findepochrange(epochs, starttime=None, endtime=None):  # @NoSelf
        if isinstance(starttime, list):
            start = CDFAstropy.compute(starttime)
        if isinstance(endtime, list):
            end = CDFAstropy.compute(endtime)

        epochs = CDFAstropy.convert_to_astropy(epochs)

        epochs_as_np = epochs.value
        indices = np.where((epochs_as_np >= start) & (epochs_as_np <= end))
        return min(indices[0]), max(indices[0])
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def getVersion():
        """
        Prints the code version.
        """
        print('epochs version:', str(CDFAstropy.version) + '.' +
              str(CDFAstropy.release) + '.'+str(CDFAstropy.increment))
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def getVersion():
        """
        Prints the code version.
        """
        print('epochs version:', str(CDFAstropy.version) + '.' +
              str(CDFAstropy.release) + '.'+str(CDFAstropy.increment))
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def breakdown(epochs, to_np: bool = False):
        # Returns either a single array, or a array of arrays depending on the input
        epochs = CDFAstropy.convert_to_astropy(epochs)
        if epochs.format == 'cdf_tt2000':
            return CDFAstropy.breakdown_tt2000(epochs, to_np)
        elif epochs.format == 'cdf_epoch':
            return CDFAstropy.breakdown_epoch(epochs, to_np)
        elif epochs.format == 'cdf_epoch16':
            return CDFAstropy.breakdown_epoch16(epochs, to_np)
        raise TypeError('Not sure how to handle type {}'.format(type(epochs)))
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def findepochrange(epochs, starttime=None, endtime=None):  # @NoSelf
        if isinstance(starttime, list):
            start = CDFAstropy.compute(starttime)
        if isinstance(endtime, list):
            end = CDFAstropy.compute(endtime)

        epochs = CDFAstropy.convert_to_astropy(epochs)

        epochs_as_np = epochs.value
        indices = np.where((epochs_as_np >= start) & (epochs_as_np <= end))
        return min(indices[0]), max(indices[0])
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def breakdown(epochs, to_np: bool = False):
        # Returns either a single array, or a array of arrays depending on the input
        epochs = CDFAstropy.convert_to_astropy(epochs)
        if epochs.format == 'cdf_tt2000':
            return CDFAstropy.breakdown_tt2000(epochs, to_np)
        elif epochs.format == 'cdf_epoch':
            return CDFAstropy.breakdown_epoch(epochs, to_np)
        elif epochs.format == 'cdf_epoch16':
            return CDFAstropy.breakdown_epoch16(epochs, to_np)
        raise TypeError('Not sure how to handle type {}'.format(type(epochs)))
github MAVENSDC / cdflib / cdflib / epochs_astropy.py View on Github external
def breakdown(epochs, to_np: bool = False):
        # Returns either a single array, or a array of arrays depending on the input
        epochs = CDFAstropy.convert_to_astropy(epochs)
        if epochs.format == 'cdf_tt2000':
            return CDFAstropy.breakdown_tt2000(epochs, to_np)
        elif epochs.format == 'cdf_epoch':
            return CDFAstropy.breakdown_epoch(epochs, to_np)
        elif epochs.format == 'cdf_epoch16':
            return CDFAstropy.breakdown_epoch16(epochs, to_np)
        raise TypeError('Not sure how to handle type {}'.format(type(epochs)))