Ejemplo n.º 1
0
def xoppy_loadspec(fileName, verbose=1, index=None):
    """
    gets the data block of the last spec scan
    :param fileName:
    :param verbose:
    :return:
    """

    sf = SpecFile(fileName)

    if verbose:
        print("Number of scans found %d" % (len(sf)))
        print(sf.list())
        print(type(sf.list()))

    if index == None:  #go trought all scane
        for index in range(len(sf)):
            s1 = sf[index]
            if verbose:
                print("\ndata shape: ", (s1.data.shape))

            h = s1.header
            for j in range(len(h)):
                if verbose: print("           %s" % h[j])

    else:
        s1 = sf[index]

    return s1.data
Ejemplo n.º 2
0
    def list(self):
        """Return a string representation of a list of scan numbers.

        The scans numbers are listed in the order in which they appear
        in the file. Continuous ranges of scan numbers are represented
        as ``first:last``.

        For instance, let's assume our specfile contains following scans:
        *1, 2, 3, 4, 5, 684, 685, 687, 688, 689, 700, 688, 688*.
        This method will then return::

            "1:5,684:685,687:689,700,688,688"
        """
        number_list = SpecFile.list(self)
        return _format_number_list(number_list)
Ejemplo n.º 3
0
    def list(self):
        """Return a string representation of a list of scan numbers.

        The scans numbers are listed in the order in which they appear
        in the file. Continuous ranges of scan numbers are represented
        as ``first:last``.

        For instance, let's assume our specfile contains following scans:
        *1, 2, 3, 4, 5, 684, 685, 687, 688, 689, 700, 688, 688*.
        This method will then return::

            "1:5,684:685,687:689,700,688,688"
        """
        number_list = SpecFile.list(self)
        return _format_number_list(number_list)