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_MAR: MAR image files* |
---|
11 | -------------------------------------- |
---|
12 | |
---|
13 | Routine to read several MAR formats, .mar3450,.mar2300,.mar2560 |
---|
14 | |
---|
15 | ''' |
---|
16 | |
---|
17 | import sys |
---|
18 | import os |
---|
19 | import GSASIIIO as G2IO |
---|
20 | import GSASIIpath |
---|
21 | GSASIIpath.SetVersionNumber("$Revision: $") |
---|
22 | class MAR_ReaderClass(G2IO.ImportImage): |
---|
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 |
---|
38 | ''' |
---|
39 | filepointer.close() # close the file, since it will be reopened below. |
---|
40 | filepointer = None |
---|
41 | self.Comments,self.Data,self.Npix,self.Image = G2IO.GetMAR345Data(filename) |
---|
42 | if self.Npix == 0 or not self.Comments: |
---|
43 | return False |
---|
44 | return True |
---|