Changeset 2716


Ignore:
Timestamp:
Feb 20, 2017 3:45:19 PM (5 years ago)
Author:
vondreele
Message:

import polarization for tif files from metadata file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2img_1TIF.py

    r2687 r2716  
    8989    wavelength = None
    9090    distance = None
     91    polarization = None
    9192    try:
    9293        Meta = open(filename+'.metadata','Ur')
     
    103104                elif 'distance' == keyword.lower():
    104105                    distance = float(line.split('=')[1])
     106                elif 'polarization' == keyword.lower():
     107                    polarization = float(line.split('=')[1])
    105108            except:
    106109                print('error reading metadata: '+line)
     
    304307    wavelength = (not wavelength) and 0.10 or wavelength
    305308    distance = (not distance) and 100.0 or distance
    306     data = {'pixelSize':pixy,'wavelength':wavelength,'distance':distance,'center':center,'size':sizexy,'setdist':distance}
     309    polarization = (not polarization) and 0.99 or polarization
     310    data = {'pixelSize':pixy,'wavelength':wavelength,'distance':distance,'center':center,'size':sizexy,
     311            'setdist':distance,'PolaVal':[polarization,False]}
    307312    File.close()   
    308313    return head,data,Npix,image
Note: See TracChangeset for help on using the changeset viewer.