Changeset 2068 for trunk/imports/G2img_SumG2.py
- Timestamp:
- Nov 24, 2015 12:39:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/imports/G2img_SumG2.py ¶
r2065 r2068 8 8 ########### SVN repository information ################### 9 9 ''' 10 *Module G2img_G2: Python pickled image* 11 --------------------------------------- 12 13 Routine to read an image that has been pickled in Python. Images 14 in this format are created by the "Sum image data" command. 10 *Module G2img_SumG2: Python pickled image* 11 ------------------------------------------ 15 12 16 13 ''' … … 23 20 GSASIIpath.SetVersionNumber("$Revision: $") 24 21 class G2_ReaderClass(G2IO.ImportImage): 22 '''Routine to read an image that has been pickled in Python. Images 23 in this format are created by the "Sum image data" command. At least for 24 now, only one image is permitted per file. 25 ''' 25 26 def __init__(self): 26 27 super(self.__class__,self).__init__( # fancy way to self-reference … … 32 33 33 34 def ContentsValidator(self, filepointer): 34 ''' no test at this time35 '''test by trying to unpickle (should be quick) 35 36 ''' 37 try: 38 Fp = open(filename,'rb') 39 cPickle.load(Fp) 40 except: 41 return False 36 42 return True 37 43 38 44 def Reader(self,filename,filepointer, ParentFrame=None, **unused): 39 '''Read using scipy PNG reader45 '''Read using cPickle 40 46 ''' 41 47 import scipy.misc
Note: See TracChangeset
for help on using the changeset viewer.