source: trunk/imports/G2img_Rigaku.py @ 2054

Last change on this file since 2054 was 2054, checked in by toby, 8 years ago

fix silly bug

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1# -*- coding: utf-8 -*-
2########### SVN repository information ###################
3# $Date: 2014-12-27 11:14:59 -0600 (Sat, 27 Dec 2014) $
4# $Author: $
5# $Revision: $
6# $URL: $
7# $Id: $
8########### SVN repository information ###################
9'''
10*Module G2img_Rigaku: .stl image file*
11--------------------------------------
12
13Routine to read a Rigaku R-Axis IV image file
14
15'''
16
17import sys
18import os
19import GSASIIIO as G2IO
20import GSASIIpath
21GSASIIpath.SetVersionNumber("$Revision: $")
22class Rigaku_ReaderClass(G2IO.ImportImage):
23    def __init__(self):
24        super(self.__class__,self).__init__( # fancy way to self-reference
25            extensionlist=('.stl',),
26            strictExtension=True,
27            formatName = 'Rigaku image',
28            longFormatName = 'Read Rigaku R-Axis IV image file'
29            )
30
31    def ContentsValidator(self, filepointer):
32       
33        '''Does the file size make sense?
34        '''
35        fileSize = os.stat(filepointer.name).st_size
36        Npix = (fileSize-6000)/2
37        if Npix == 9000000 or Npix == 2250000 or Npix == 36000000:
38            return True
39        return False # not valid size
40       
41    def Reader(self,filename,filepointer, ParentFrame=None, **unused):
42        '''Read using Bob's routine
43        '''
44
45        self.Comments,self.Data,self.Npix,self.Image = G2IO.GetRigaku(filename)
46        if self.Npix == 0 or not self.Comments:
47            return False
48        self.LoadImage(ParentFrame,filename)
49        return True
Note: See TracBrowser for help on using the repository browser.