From f7b4a4d13e8871eadb379a8bf6cf86d8d7819032 Mon Sep 17 00:00:00 2001 From: Max <17359435+MaxPelly@users.noreply.github.com> Date: Mon, 5 Oct 2026 17:05:03 +0100 Subject: [PATCH] Support St Andrews FDS converted XRDML A few changes to support the converted FDS .XRDML files produced by the university of St Andrews school of chemistry PXRD department. Adds .XRDML as an allowed extension and makes the sample variable optional. --- GSASII/imports/G2pwd_Panalytical.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GSASII/imports/G2pwd_Panalytical.py b/GSASII/imports/G2pwd_Panalytical.py index 9f62d0bc5..4a74d1eff 100644 --- a/GSASII/imports/G2pwd_Panalytical.py +++ b/GSASII/imports/G2pwd_Panalytical.py @@ -11,7 +11,7 @@ class Panalytical_ReaderClass(G2obj.ImportPowderData): ''' def __init__(self): super(self.__class__,self).__init__( # fancy way to self-reference - extensionlist=('.xrdml','.xml'), + extensionlist=('.xrdml','.xml', '.XRDML'), strictExtension=True, formatName = 'Panalytical xrdml (xml)', longFormatName = 'Panalytical powder data as *.xrdml' @@ -75,7 +75,9 @@ def Reader(self,filename, ParentFrame=None, **kwarg): dataPoints = scan.find(tag+'dataPoints') self.comments.append('Gonio. radius=%.2f'%(radius)) self.Sample['Gonio. radius'] = radius - if sample.find(tag+'id').text: + + + if sample and sample.find(tag+'id').text: self.comments.append('Sample name='+sample.find(tag+'id').text) try: self.comments.append('Date/TimeStart='+header.find(tag+'startTimeStamp').text)