Ignore:
Timestamp:
Mar 31, 2018 8:40:02 AM (5 years ago)
Author:
vondreele
Message:

modify Bruker image import to keep "TARGET" and use it in SaveIntegration? to put Ka1/Ka2 wavelengths into PWDR Instrument Parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2img_SFRM.py

    r3327 r3330  
    1717import GSASIIobj as G2obj
    1818import GSASIIpath
    19 import struct as st
    2019import numpy as np
    21 import unpack_cbf as cbf
    2220GSASIIpath.SetVersionNumber("$Revision: 3207 $")
    2321class SFRM_ReaderClass(G2obj.ImportImage):
     
    2927            strictExtension=True,
    3028            formatName = 'SFRM image',
    31             longFormatName = 'SFRM Binary Data Format image file'
     29            longFormatName = 'Bruker SFRM Binary Data Format image file'
    3230            )
    3331
     
    3836       
    3937    def Reader(self,filename, ParentFrame=None, **unused):
    40         '''Read using Bob's routine :func:`GetCbfData`
     38        '''Read using Bob's routine :func:`GetSFRMData`
    4139        '''
    4240        self.Comments,self.Data,self.Npix,self.Image = GetSFRMData(self,filename)
     
    7371        if 'TARGET' in line:
    7472            wave = meanwaves[fields[0]]
     73            target = fields[0].capitalize()
    7574        elif 'DISTANC' in line:
    7675            dist = float(fields[0])*10.
    77 #        elif 'Pixel_size' in line:
    78 #            pixSize = [float(fields[2])*1.e6,float(fields[5])*1.e6]
    7976        elif 'CENTER' in line:
    8077            cent = [float(fields[0]),float(fields[1])]
     
    116113    image = np.reshape(img,(sizexy[1],sizexy[0]))
    117114    print ('import time: %.3f'%(time.time()-time0))
    118     data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,'size':sizexy}
     115    data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,'size':sizexy,'target':target}
    119116    Npix = sizexy[0]*sizexy[1]
    120117   
Note: See TracChangeset for help on using the changeset viewer.