Ejemplo n.º 1
0
    def extend(self, minutes=15, **kwargs):
        """Requests subsequent files from the server. If minutes is negative,
        retrieve preceding files. """
        if len(self.instruments) != 1:
            raise ValueError

        instrument = next(iter(self.instruments))
        if minutes > 0:
            data = CallistoSpectrogram.from_range(
                instrument, self.end,
                self.end + datetime.timedelta(minutes=minutes))
        else:
            data = CallistoSpectrogram.from_range(
                instrument, self.start - datetime.timedelta(minutes=-minutes),
                self.start)

        data = data.clip_freq(self.freq_axis[-1], self.freq_axis[0])
        return CallistoSpectrogram.join_many([self, data], **kwargs)
Ejemplo n.º 2
0
    def extend(self, minutes=15, **kwargs):
        """Requests subsequent files from the server. If minutes is negative,
        retrieve preceding files. """
        if len(self.instruments) != 1:
            raise ValueError

        instrument = next(iter(self.instruments))
        if minutes > 0:
            data = CallistoSpectrogram.from_range(
                instrument,
                self.end, self.end + datetime.timedelta(minutes=minutes)
            )
        else:
            data = CallistoSpectrogram.from_range(
                instrument,
                self.start - datetime.timedelta(minutes=-minutes), self.start
            )

        data = data.clip_freq(self.freq_axis[-1], self.freq_axis[0])
        return CallistoSpectrogram.join_many([self, data], **kwargs)
Ejemplo n.º 3
0
def test_entries_from_file_withoutwaveunit():
    # does not raise `WaveunitNotFoundError`, because no wavelength information
    # is present in this file
    next(entries_from_file(RHESSI_IMAGE))
    with pytest.raises(WaveunitNotFoundError):
        next(entries_from_file(EIT_195_IMAGE))
Ejemplo n.º 4
0
def test_entries_from_file_withoutwaveunit():
    # does not raise `WaveunitNotFoundError`, because no wavelength information
    # is present in this file
    next(entries_from_file(RHESSI_IMAGE))
    with pytest.raises(WaveunitNotFoundError):
        next(entries_from_file(EIT_195_IMAGE))
Ejemplo n.º 5
0
    def to_be_removed(self):
        """Return the least recently used key and its corresponding value as a
        tuple.

        """
        return six.next(self.iteritems())