source: trunk/imports/G2img_MAR.py @ 2133

Last change on this file since 2133 was 2133, checked in by toby, 7 years ago

fix svn settings for revisions & line ends

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Author Revision URL Id
File size: 1.3 KB
Line 
1# -*- coding: utf-8 -*-
2########### SVN repository information ###################
3# $Date: 2016-01-22 19:05:12 +0000 (Fri, 22 Jan 2016) $
4# $Author: toby $
5# $Revision: 2133 $
6# $URL: trunk/imports/G2img_MAR.py $
7# $Id: G2img_MAR.py 2133 2016-01-22 19:05:12Z toby $
8########### SVN repository information ###################
9'''
10*Module G2img_MAR: MAR image files*
11--------------------------------------
12
13'''
14
15import sys
16import os
17import GSASIIIO as G2IO
18import GSASIIpath
19GSASIIpath.SetVersionNumber("$Revision: 2133 $")
20class MAR_ReaderClass(G2IO.ImportImage):
21    '''Routine to read several MAR formats, .mar3450,.mar2300,.mar2560
22    '''
23    def __init__(self):
24        super(self.__class__,self).__init__( # fancy way to self-reference
25            extensionlist=('.mar3450','.mar2300','.mar2560'),
26            strictExtension=True,
27            formatName = 'MAR image',
28            longFormatName = 'MAR Research 345, 230 and 256 image files'
29            )
30
31    def ContentsValidator(self, filepointer):
32        '''no test at this time
33        '''
34        return True
35       
36    def Reader(self,filename,filepointer, ParentFrame=None, **unused):
37        '''Read using Bob's routine :func:`GSASIIIO.GetMAR345Data`
38        (to be moved to this file, eventually)
39        '''
40        self.Comments,self.Data,self.Npix,self.Image = G2IO.GetMAR345Data(filename)
41        if self.Npix == 0 or not self.Comments:
42            return False
43        self.LoadImage(ParentFrame,filename)
44        return True
Note: See TracBrowser for help on using the repository browser.