Changeset 2290 for trunk/GSASIIIO.py


Ignore:
Timestamp:
May 25, 2016 3:39:41 PM (6 years ago)
Author:
vondreele
Message:

complex problem - fix summing of GE images; needed new item in Image Controls to save which reader was used. Change to OnImportGeneric? to keep self.formatName; GetImageData? put it in the call & check it with the available readers & GetImageZ to get it out of the Image Controls & apply it in GetImageData?.
Add a test on file size for GE files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2289 r2290  
    345345    G2frame.Image = Id
    346346
    347 def GetImageData(G2frame,imagefile,imageOnly=False,ImageTag=None):
     347def GetImageData(G2frame,imagefile,imageOnly=False,ImageTag=None,FormatName=''):
    348348    '''Read a single image with an image importer.
    349349
     
    354354    :param int/str ImageTag: specifies a particular image to be read from a file.
    355355      First image is read if None (default).
     356    :param str formatName: the image reader formatName
    356357
    357358    :returns: an image as a numpy array or a list of four items:
     
    367368            secondaryReaders.append(rd)
    368369        elif flag:
    369             primaryReaders.append(rd)
     370            if not FormatName:
     371                primaryReaders.append(rd)
     372            elif FormatName == rd.formatName:
     373                primaryReaders.append(rd)
    370374    if len(secondaryReaders) + len(primaryReaders) == 0:
    371375        print('Error: No matching format for file '+filename)
Note: See TracChangeset for help on using the changeset viewer.