Problem
This was pointed out by Paola when morphing iq data in the form of .dat files. When files are saved, the columns are labeled as r and gr like this # Labels: [r] [gr]. In the metadata, there is also the line that says # PDF created by diffpy.morph. the files are also saved as .cgr files even if its not PDF. In summary, this is what the header looks like of a saved morph file:
# PDF created by diffpy.morph
# from /Users/cadenmyers/billingelab/BNL/oct2025_beamtime/data/Xiaoyu/gr/rt/TiSe2_RT_XS4_215C_PDF_20251021-124802_1da6c1_sum.gr
# Labels: [r] [gr]
0.000000000000000000e+00 0.000000000000000000e+00
1.000000000000000021e-02 -2.563058786130854593e-06
2.000000000000000042e-02 -1.912763583912635416e-05
Proposed solution
Fix this to infer spectrum type from the filename (.iq, .fq, .gr, etc)
- changed
# PDF created by diffpy.morph to # file created by diffpy.morph
- Use input file suffix to determine if its a PDF (ie
if "gr" in str(path_object.stem) or something). If not gr, have some sort of default behavior
Problem
This was pointed out by Paola when morphing iq data in the form of
.datfiles. When files are saved, the columns are labeled asrandgrlike this# Labels: [r] [gr]. In the metadata, there is also the line that says# PDF created by diffpy.morph. the files are also saved as.cgrfiles even if its not PDF. In summary, this is what the header looks like of a saved morph file:Proposed solution
Fix this to infer spectrum type from the filename (
.iq,.fq,.gr, etc)# PDF created by diffpy.morphto# file created by diffpy.morphif "gr" in str(path_object.stem)or something). If not gr, have some sort of default behavior