Loosing Precision During Loadwave Procedure. Is using the \B and\F Flags the solution?
Hi All,
I've been writing some code to load a tab delimited text file into IGOR.
The main problem I've encountered is that the non- timestamp columns are only loading data up to six siginificant figures such that the number in the wave is rounded. I think this has something to do with floating points and formatting? I've added a snippet of the text file for context.
I tried to play with the \F flag as I think should be able to specify the width/number of significant figures I'd like to use, however since my columns are different widths I think I need to use them in conjunction with the \B flag. Problem is I'm not sure I understand how to use the \B flag correctly and I can't find examples/documentation. I feel like I'm going down a rabbit hole and that there must be a better way to retain the precision of the data without going full brute force and specifying each columns requirements.
Can someone point me in the right direction for
1) Using the loadwave with the \B and \F flags correctly? Maybe an example somewhere would be useful?
2) Perhaps suggest a more elegant solution for retaining the precision of data in my text file?
Thanks,
Nic
PS My timestamp column isn't loading at all unless I make it a text wave which is less of an issue and I think I can iron that out using the \B flag with the \K=2 flag. Still not sure how to format the \B flag though.
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
In the table window click on the settings icon and change the digits setting. The data are being loaded at full resolution, but truncated for display in the table.
May 21, 2019 at 04:28 am - Permalink
DisplayHelpTopic "sscanf"
May 21, 2019 at 04:44 am - Permalink
This command loads your data correctly:
LoadWave/J/D/W/E=1/K=0/R={English,2,2,2,2,"DayOfMonth/Month/Year",40}
See the LoadWave documentation for /D and /R for details.
Also:
In Igor7 or later, execute this for information about table displayed precision:
May 21, 2019 at 05:52 am - Permalink
Thank you both for your tips here this solved my problem.
Is there a way to change the table precision to a new default setting?
Out of interest when would you use the \F and \B flags? I feel like the \B flag is very powerful and I've never quite gotten a handle on how to use it successfully.
Thanks,
Nic
May 21, 2019 at 07:24 am - Permalink
/B is explained in the section "Specifying Characteristics of Individual Columns" in the documentation for LoadWave.
You can find examples here.
/F is for FORTRAN data files that use spaces to align text into fixed fields:
May 21, 2019 at 08:12 am - Permalink