Changeset 2452


Ignore:
Timestamp:
Aug 25, 2016 9:49:23 PM (5 years ago)
Author:
toby
Message:

read Rigaku 2 column files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2pwd_rigaku.py

    r2414 r2452  
    1515class Rigaku_ReaderClass(G2IO.ImportPowderData):
    1616    '''Routines to import powder data from a Rigaku .txt file with an angle and
    17     then 11(!) intensity values on the line. The example file is proceeded
     17    then 1 or 11(!) intensity values on the line. The example file is proceeded
    1818    with 10 of blank lines, but I have assumed they could be any sort of text.
    19     This code should work with an angle and any number of intensity values/line > 3
     19    This code should work with an angle and any number of intensity values/line
    2020    as long as the number is the same on each line. The step size may not change. The
    2121    number of comment lines can also change, but should not appear to be intensity
     
    2424    def __init__(self):
    2525        super(self.__class__,self).__init__( # fancy way to self-reference
    26             extensionlist=('.txt',),
    27             strictExtension=False,
     26            extensionlist=('.txt','.TXT'),
     27            strictExtension=True,
    2828            formatName = 'Rigaku .txt exported',
    2929            longFormatName = 'Rigaku powder data exported as .txt'
     
    5454                        break
    5555                if err: continue
    56                 if vals < 4: continue
     56                if vals < 1: continue
    5757                header = False # found first non-header line
    58             if vals < 4:
    59                 print('Two few values for Rigaku .txt file')
     58            if vals < 2:
     59                print('Too few values for Rigaku .txt file')
    6060                return False
    6161            if self.vals is None:
Note: See TracChangeset for help on using the changeset viewer.