Products > Test Equipment
Rigol RSA3015N Noob question about the .csv data format?
(1/2) > >>
curtisound:
I recently got a new Rigol RSA3015N spectrum analyzer that I mostly use for UHF broadcast spectrum scans to coordinate wireless mics and communications equipment. However, The .csv files it generates don't seem to work with my frequency coordination software.

With my older TTI PSA2702 spectrum analyzer I can easily import the .csv files of my spectrum traces into my software. Those .csv files look pretty straight forward with real numbers like this example.

TTI partial example starting 510 MHz
.CSV DATA,
0510.0000,-064.7
0510.1110,-065.4
0510.2220,-065.5
0510.3330,-059.8
0510.4440,-054.5
0510.5560,-050.1
0510.6670,-048.3
0510.7780,-048.2
0510.8890,-051.9

However, The trace file data for the frequency markers of my Rigol RSA3015N's .csv  look different. The frequency markers always have "e+08" as part of the frequency data point which I'm guessing is math shorthand for moving the decimal point? (obviously I'm no programmer ;D).

I'm guessing there's no setting to change this? I haven't been able to find one. Maybe there is a way to convert the .csv files?

Thanks for any insight  :)

3015N partial example starting 450 MHz
.CSV DATA,
4.5e+08,-79.5194
4.5025e+08,-79.9948
4.505e+08,-80.9295
4.5075e+08,-81.1753
4.51e+08,-81.7338
4.5125e+08,-82.1699
4.515e+08,-82.2603
4.5175e+08,-82.0573
4.52e+08,-82.1724
alm:
4.5e+08 is shorthand for 4.5 * 108. This is not specific to programming: you can find the exact same syntax on most scientific calculators. I would import the data into a spreadsheet like Excel, change the format there, and re-export as csv.
Nominal Animal:
Yup, it is just standard scientific notation numeric data, an absolutely ubiquitous format.

In Linux or macOS, you only need to run e.g.
    awk -F ',' '{ if (FNR==1 || NF!=2) print ; else printf "%.4f,%.4f\n", $1, $2 } ' < original.csv > fixed.csv
to convert the notation to decimal.

If you have Bash installed in any OS, run
    bash -c 'LANG=C LC_ALL=C IFS="," ; ( read H && echo "$H" ; while read A B ; do printf "%.4f,%.4f\n" "$A" "$B" ; done ) < original.csv > fixed.csv'
to convert the notation just like above.

In Linux, either of the above can be written as a script, with a shortcut that lets you drop files on top of to get them converted.  (You can either discard the original data, save the original data to say original.old, or use e.g. Zenity to pop up a Save As.. dialog for each converted file.)

If you have or install Python, it is easy to write a small program that fixes such CSV files.  (Python 3 has a built-in CSV module, that can read and write CSV files; or one can do the equivalent of the above awk line.  Or you can even add a tiny Tcl/Tk user interface, so that when you drop a CSV file on top of the shortcut, the Python interpreter will execute the script, that will simply prompt you where to save the converted file.)

I personally don't use Windows, so can't be of much help there.  Python is supposedly portable across systems... but to fix a problem, one has to first pinpoint or replicate the exact issue, and that is very difficult if you don't use the same operating system.
curtisound:
Thanks for the info! I'm able to easily convert the data from scientific to real numbers easily enough in Excel. Though my software is picky and wants to see all the data in MHz. So 400.000 instead of 400000000.000 . I'm guessing I can make formula to automate this in Excel as well.

-Cheers!
alm:
A formula could easily do it. Or copy the number 1e6, select the entire column of frequency values, paste special, and choose "divide".
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod