Subscribe Bookmark RSS Feed

Importing Touchstone format into JMP

I'm trying to evaluate JMP before purchasing the software. I would like to use JMP to analyze Touchstone files. However, it is not listed as a file type. I've tried importing as a text, but the some of the columns are shifted and are not aligned. Maybe it's because I'm unfamiliar with JSL, but I've looked into the Scripting documentation but I don't see a way I can import *.snp files (where n is the number of ports) i.e. *.s2p, *.s3p, *.s4p. I would have to have a custom delimiter for every row. I've also thought about manipulating the data table after import to see if I can shift a group of cells via scripting, but I don't see the proper code to do that. If anybody has any brilliant idea as to how I can import touchstone properly, please reply. Thanks all.

Touchstone file type are described here:

http://www.vhdl.org/pub/ibis/adhoc/interconnect/touchstone_spec2_draft4.pdf
(see pg. 10, "3-port and 4-port networks")
5 REPLIES
XanGregg

Staff

Joined:

Jun 23, 2011

What kind of output shape do you want? I'm guessing each data table row for a s4p would have 33 numbers: 1 freq and 4x4 pairs. JSL does have text processing functions to make such transformations possible.

It looks like you managed to strip off the "!" comments and "#" header lines when you got it into JMP with the shifted columns. I assume in that case, the last column of the non-freq columns had a missing value. You could try reshaping the table in the UI as follows.

1. Use Tables > Stack and choose all the columns to put all the data into one column.
2. Delete the "label" column.
3. Select one of the missing value cells and use Rows > Row Selection > Select Matching Rows to select all the rows with missing values.
4. Use Rows > Delete Rows to delete those.
5. Add a new column and choose Initial Data Values > Sequence Data in the Column Info dialog and have it go from 1 to 33.
6. Use Tables > Split with the new column as the Split By column.

Now you have a table with 33 values per row (and unimaginative numeric column names).

If you want help with the programmatic (JSL) route instead, let me know.
Xan... you're brilliant!!! That's exactly what I was aiming to do.

Yes, I would need to do this via scripting because there could be hundreds of these files touchstone files. Any help with this would be appreciated.

Some additional questions...
1. Is there anyway to parse the header file? The header file contains

# R

That determines if I need to convert the column to a different unit.

2. Is there a way for JSL to recognize file extension? I was aiming to create a single script file to analyze data weather it is s2p or s4p.
XanGregg

Staff

Joined:

Jun 23, 2011

You'll have to learn a little JSL to import custom formats like this, but below is a sample script that will read an s4p file (s2p would be much easier). There is plenty left for you to figure out, such parsing the extension or the parameters, but this should get you started and show what is possible.

The script basically converts a s4p file into a CSV file which JMP can import. The other way to do it would be to create a data table directly -- see the data tables chapter for the JMP Scripting Guide for that.


Test file sample.s4p:
In step 3, we've deleted empty cells by selecting matching rows of the selected cell. How is this accomplished with JSL? I've tried the following:

In place of the "", I've tried "." and "\!0" and it didn't select my rows. Where did I go wrong?
XanGregg

Staff

Joined:

Jun 23, 2011

I think you can put any expression in the Select Where, such as: