Changeset 3992


Ignore:
Timestamp:
May 23, 2019 8:58:32 AM (3 years ago)
Author:
vondreele
Message:

provide protections for Dysnomia - no fourier, missing executable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3991 r3992  
    42174217        UseList = Map['RefList']
    42184218        pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,UseList[0])       #only use 1st histogram
     4219        if not pId:
     4220            wx.MessageBox('You must prepare a fourier map before running Dysnomia','Dysnomia Error',
     4221                style=wx.ICON_ERROR)
     4222            return           
    42194223        reflSets = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,'Reflection Lists'))
    42204224        reflData = reflSets[generalData['Name']]['RefList']
     4225        if 'Type' not in Map:
     4226            wx.MessageBox('You must prepare a fourier map before running Dysnomia','Dysnomia Error',
     4227                style=wx.ICON_ERROR)
     4228            return           
    42214229        Type = Map['Type']
    42224230        MEMtype = 0
     
    42284236        prfName = str(G2pwd.makePRFfile(data,MEMtype))
    42294237        if not G2pwd.makeMEMfile(data,reflData,MEMtype):
    4230             print('non standard space groupsnot permitted in Dysnomia')
     4238            SpGrp = generalData['SGData']['SpGrp']
     4239            wx.MessageBox('Non standard space group '+SpGrp+' not permitted in Dysnomia','Dysnomia Error',
     4240                style=wx.ICON_ERROR)
     4241            return
     4242
     4243        path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
     4244        DYSNOMIA = os.path.join(path2GSAS2,'Dysnomia','Dysnomia64.exe')
     4245       
     4246        if not os.path.exists(DYSNOMIA):
     4247            wx.MessageBox(''' Dysnomia is not installed. Please download it from
     4248         https://jp-minerals.org/dysnomia/en/
     4249         and install it at.'''+DYSNOMIA,
     4250                caption='Dysnomia not installed',style=wx.ICON_ERROR)
    42314251            return
    42324252
     
    42374257      doi:10.1017/S088571561300002X''',caption='Dysnomia (MEM)',style=wx.ICON_INFORMATION)
    42384258       
    4239         path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
    4240         DYSNOMIA = os.path.join(path2GSAS2,'Dysnomia','Dysnomia64.exe')     #TODO; need check if DYSNOMIA exists!
    4241         print('Run '+DYSNOMIA)
    4242        
     4259        print('Run '+DYSNOMIA)       
    42434260        subp.call([DYSNOMIA,prfName])
    42444261       
    42454262        G2pwd.MEMupdateReflData(prfName,reflData)   #auto run Fourier?
    42464263        OnFourierMaps(event)       
    4247            
    4248        
    4249        
    42504264       
    42514265################################################################################
Note: See TracChangeset for help on using the changeset viewer.