-
Notifications
You must be signed in to change notification settings - Fork 36
Description
I have written the below script
import sys, os
sys.path.insert(0,'c:/gsas/gsas-ii/gsasii/')
import GSASIIscriptable as g2sc
datadir = 'C:/users/rajvog/documents/Python/GSASSDPD/'
pathwrap=lambda fil: os.path.join(datadir,fil)
gpx=g2sc.G2Project(newgpx = pathwrap('FB.gpx'))
phase0=gpx.add_phase(pathwrap('sample.cif'))
But I am getting the below error. please help
G2ImportException Traceback (most recent call last)
Cell In[97], line 8
6 pathwrap=lambda fil: os.path.join(datadir,fil)
7 gpx=g2sc.G2Project(newgpx = pathwrap('FB.gpx'))
----> 8 phase0=gpx.add_phase(pathwrap('sample.cif'))
File C:\GSAS/GSAS-II/GSASII\GSASIIscriptable.py:1287, in G2Project.add_phase(self, phasefile, phasename, histograms, fmthint, mag, spacegroup, cell)
1285 raise G2ImportException(f'File {phasefile} does not exist')
1286 # TODO: handle multiple phases in a file
-> 1287 phasereaders = import_generic(phasefile, Readers['Phase'], fmthint=fmthint)
1288 phasereader = phasereaders[0]
1290 if phasereader.MPhase and mag:
File C:\GSAS/GSAS-II/GSASII\GSASIIscriptable.py:407, in import_generic(filename, readerlist, fmthint, bank)
405 primaryReaders.append(reader)
406 if not secondaryReaders and not primaryReaders:
--> 407 raise G2ImportException("Could not read file: ", filename)
409 with open(filename, 'r'):
410 rd_list = []
G2ImportException: ('Could not read file: ', 'C:\users\rajvog\documents\Python\GSASSDPD\sample.cif')