Changeset 1012


Ignore:
Timestamp:
Jul 31, 2013 9:25:27 AM (10 years ago)
Author:
vondreele
Message:

add svn header to G2cif.py and GSASIIpath to imports
add DEBUG to skip prnting of profile & reflections
add profile parm cif output
work on MC/SA scrolling

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1011 r1012  
    39683968################################################################################
    39693969
    3970     def UpdateMCSA(refresh=True):
     3970    def UpdateMCSA(Scroll=0):
    39713971        Indx = {}
    39723972       
     
    42514251                        else:       #March Dollase
    42524252                            Models[0]['Coef'][0] = val
    4253                     wx.CallAfter(UpdateMCSA)
     4253                    wx.CallAfter(UpdateMCSA,MCSA.GetScrollPos(wx.VERTICAL))
    42544254                    G2plt.PlotStructure(G2frame,data)
    42554255                elif c == 1:
     
    42604260                    resultsTable.SetValue(r,c,Results[r][1])
    42614261                    resultsGrid.ForceRefresh()
    4262                        
    42634262               
    42644263            resultsSizer = wx.BoxSizer(wx.VERTICAL)
     
    42904289       
    42914290        # UpdateMCSA executable code starts here
    4292         if refresh:
    4293             MCSA.DestroyChildren()
    42944291        general = data['General']
    42954292        Amat,Bmat = G2lat.cell2AB(general['Cell'][1:7])
     
    43314328
    43324329        SetPhaseWindow(G2frame.dataFrame,MCSA,mainSizer)
     4330        MCSA.Scroll(0,Scroll)
    43334331           
    43344332    def OnRunMultiMCSA(event):
  • trunk/exports/G2cif.py

    r1010 r1012  
     1#!/usr/bin/env python
     2# -*- coding: utf-8 -*-
     3#G2cif
     4########### SVN repository information ###################
     5# $Date: 2013-07-22 20:57:37 -0500 (Mon, 22 Jul 2013) $
     6# $Author: toby $
     7# $Revision: 1006 $
     8# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/exports/G2cif.py $
     9# $Id: G2cif.py 1006 2013-07-23 01:57:37Z toby $
     10########### SVN repository information ###################
    111'''Development code to export a GSAS-II project as a CIF
    212The heavy lifting is done in method export
     
    818import os.path
    919import numpy as np
     20import GSASIIpath
     21GSASIIpath.SetVersionNumber("$Revision: 1006 $")
    1022import GSASIIIO as G2IO
    1123#reload(G2IO)
     
    1931import GSASIIspc as G2spg
    2032#reload(G2spg)
     33
     34DEBUG = True    #True to skip printing of reflection/powder profile lists
    2135
    2236def getCallerDocString(): # for development
     
    243257            string description. Will only be called on PWDR histograms
    244258            '''
    245             #print instparmdict[0].keys()
    246             return 'TODO: Instrument profile goes here'
     259            s = ''
     260            inst = instparmdict[0]
     261            if 'C' in inst['Type'][0]:
     262                s = 'Finger-Cox-Jephcoat function parameters U, V, W, X, Y, SH/L:\n   '
     263                for item in ['U','V','W','X','Y','SH/L']:
     264                    s += G2mth.ValEsd(inst[item][1],-.009)+', '                   
     265            elif 'T' in inst['Type'][0]:    #to be tested after TOF Rietveld done
     266                s = 'Von Dreele-Jorgenson-Windsor function parameters\n'+ \
     267                    '   alpha, beta-0, beta-1, beta-q, sig-0, sig-1, sig-q, X, Y:\n   '
     268                for item in ['alpha','bet-0','bet-1','bet-q','sig-0','sig-1','sig-q','X','Y']:
     269                    s += G2mth.ValEsd(inst[item][1],-.009)+', '
     270            return s
    247271
    248272        def FormatPhaseProfile(phasenam):
     
    709733            if not oneblock:                 # instrumental profile terms go here
    710734                WriteCIFitem('_pd_proc_ls_profile_function',
    711                              FormatInstProfile(histblk["Instrument Parameters"]))
     735                    FormatInstProfile(histblk["Instrument Parameters"]))
    712736
    713737            #refprx = '_refln.' # mm
     
    749773                refcount += len(histblk['Reflection Lists'][phasenam])
    750774                for ref in histblk['Reflection Lists'][phasenam]:
     775                    if DEBUG:
     776                        print 'DEBUG: skip reflection list'
     777                        break
    751778                    if hklmin is None:
    752779                        hklmin = ref[0:3]
     
    832859                                            histblk['Data'][3],
    833860                                            histblk['Data'][4]):
     861                if DEBUG:
     862                    print 'DEBUG: skip reflection list'
     863                    break
    834864                if fixedstep:
    835865                    s = ""
     
    11641194                    # report instrumental profile terms
    11651195                    WriteCIFitem('_pd_proc_ls_profile_function',
    1166                                  FormatInstProfile(histblk["Instrument Parameters"]))
    1167                     WriteCIFitem('# Information for histogram '+str(i)+': '+
    1168                                  hist)
     1196                        FormatInstProfile(histblk["Instrument Parameters"]))
     1197                    WriteCIFitem('# Information for histogram '+str(i)+': '+hist)
    11691198                    WriteCIFitem('_pd_block_id',datablockidDict[hist])
    11701199                    WritePowderTemplate()
     
    11761205                    WriteCIFitem('\ndata_'+self.CIFname+"_sx_"+str(i))
    11771206                    #instnam = histblk["Instrument Parameters"][0]['InstrName']
    1178                     WriteCIFitem('# Information for histogram '+str(i)+': '+
    1179                                  hist)
     1207                    WriteCIFitem('# Information for histogram '+str(i)+': '+hist)
    11801208                    WriteCIFitem('_pd_block_id',datablockidDict[hist])
    11811209                    WriteSnglXtalTemplate()
Note: See TracChangeset for help on using the changeset viewer.