Changeset 3841


Ignore:
Timestamp:
Mar 7, 2019 1:50:32 PM (3 years ago)
Author:
vondreele
Message:

fix problem if image calibrant isn't in local calibration files
fix future problem with a logical '-' line 878 og G2image.py
show image intensity range at start of integration
change id to pid in G2plot in places (id is a special fxn in python)
add print of saved gpx file name to SaveDictToProjFile?
set image integration blkSize=1028 (default was 128)

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r3830 r3841  
    567567    skip = data['calibskip']
    568568    dmin = data['calibdmin']
     569    if data['calibrant'] not in calFile.Calibrants:
     570        print(' %s not in local copy of image calibrants file'%data['calibrant'])
     571        return []
    569572    Bravais,SGs,Cells = calFile.Calibrants[data['calibrant']][:3]
    570573    HKL = []
     
    876879    if frame:
    877880        tam = ma.mask_or(tam,ma.make_mask(pm.polymask(nI*nJ,tax,
    878             tay,len(frame),frame,tamp)[:nI*nJ])-True)
     881            tay,len(frame),frame,tamp)[:nI*nJ])^True)
    879882    polygons = masks['Polygons']
    880883    for polygon in polygons:
     
    953956    'Integrate an image; called from OnIntegrateAll and OnIntegrate in G2imgGUI'    #for q, log(q) bins need data['binType']
    954957    import histogram2d as h2d
    955     print ('Begin image integration')
     958    print ('Begin image integration; image range: %d %d'%(np.min(image),np.max(image)))
    956959    CancelPressed = False
    957960    LUtth = np.array(data['IOtth'])
     
    10261029                    numAzms,numChans,LRazm,lutth,Dazm,dtth,NST,H0)
    10271030            times[3] += time.time()-t0
    1028 #            del tax; del tay; del taz; del tad; del tabs
     1031#            print('done block %d %d %d %d %d %d %d %d'%(iBlk,iBeg,iFin,jBlk,jBeg,jFin,np.min(Block),np.max(Block)))
    10291032    print('End integration loops')
    10301033    t0 = time.time()
  • trunk/GSASIIimgGUI.py

    r3815 r3841  
    217217                    Mid = G2gd.GetGPXtreeItemId(G2frame,G2frame.Image,'Masks')
    218218                    Masks = G2frame.GPXtree.GetItemPyData(Mid)
    219                     vals,varyList,sigList,parmDict = G2img.ImageRecalibrate(
    220                         G2frame,G2frame.ImageZ,Data,Masks)
     219                    result = G2img.ImageRecalibrate(G2frame,G2frame.ImageZ,Data,Masks)
     220                    if not len(result):
     221                        print('calibrant missing from local image calibrants files')
     222                        return
     223                    vals,varyList,sigList,parmDict = result
    221224                    sigList = list(sigList)
    222225                    if 'dist' not in varyList:
  • trunk/GSASIIplot.py

    r3839 r3841  
    26462646    exclLines = []
    26472647    if G2frame.SinglePlot and PatternId:
    2648 #        Pattern = copy.deepcopy(G2frame.GPXtree.GetItemPyData(PatternId))
    26492648        Pattern = G2frame.GPXtree.GetItemPyData(PatternId)
    26502649        Pattern.append(G2frame.GPXtree.GetItemText(PatternId))
     
    26742673        time0 = time.time()
    26752674        for item in choices:
    2676             id = G2gd.GetGPXtreeItemId(G2frame,G2frame.root, item)
    2677             Pattern = G2frame.GPXtree.GetItemPyData(id)
     2675            pid = G2gd.GetGPXtreeItemId(G2frame,G2frame.root, item)
     2676            Pattern = G2frame.GPXtree.GetItemPyData(pid)
    26782677            if len(Pattern) < 3:                    # put name on end if needed
    2679                 Pattern.append(G2frame.GPXtree.GetItemText(id))
     2678                Pattern.append(G2frame.GPXtree.GetItemText(pid))
    26802679            if 'Offset' not in Page.plotStyle:     #plot offset data
    26812680                Ymax = max(Pattern[1][1])
     
    26872686            PlotList.append(Pattern)
    26882687            ParmList.append(G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    2689                 id,'Instrument Parameters'))[0])
     2688                pid,'Instrument Parameters'))[0])
    26902689            SampleList.append(G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    2691                 id, 'Sample Parameters')))
     2690                pid, 'Sample Parameters')))
    26922691            Temps.append('%.1fK'%SampleList[-1]['Temperature'])
    26932692        if timeDebug:
  • trunk/GSASIIscriptable.py

    r3840 r3841  
    789789    finally:
    790790        file.close()
     791    print('gpx file saved as %s'%ProjFile)
    791792
    792793# def ImportPowder(reader,filename):
     
    36383639        :returns: a list of created histogram (:class:`G2PwdrData`) objects.
    36393640        '''
     3641        blkSize = 1024   #this seems to be optimal; will break in polymask if >1024
    36403642        ImageZ = GetCorrImage(Readers['Image'],self.proj,self)
    36413643        # do integration
    3642         ints,azms,Xvals,cancel = G2img.ImageIntegrate(ImageZ,self.data['Image Controls'],self.data['Masks'])
     3644        ints,azms,Xvals,cancel = G2img.ImageIntegrate(ImageZ,self.data['Image Controls'],self.data['Masks'],blkSize=blkSize)
    36433645        # code from here on based on G2IO.SaveIntegration, but places results in the current
    36443646        # project rather than tree
Note: See TracChangeset for help on using the changeset viewer.