Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'importing *.SPE binary files on mac os x' topicStudent Support Forum > General > Archives > "importing *.SPE binary files on mac os x"

Next Comment >Help | Reply To Topic
Author Comment/Response
Rob Sewell
06/06/05 06:56am

The following code was written to import *.SPE files from Prinston Instruments' WinView program into mathematica for analysis. The code works well on a windows box running mathematica 5.1, but on a powerbook running mac os 10.3 the binary file is read incorrectly. Does anyone have any suggestions for importing binary files cross-platform?

(* Reading SPE Files *)

reads data from a Princeton Instruments SPE file into a Mathematica \
array. The function works with all data types supported by the SPE format. \
If the file contains a single frame, the data is returned as an array. If it \
contains multiple frames then the data is returned as a list of arrays.";

(* This function is used by ReadSPE[ ]. It uses to StreamPosition[ ] to access the header entries that we need, and the Experimental binary import function to improve performance. *)

ReadBinary[stream_,offset_,format_]:= Block[{},SetStreamPosition[stream,offset];BinaryRead[stream,\

(* This function reads in SPE files written by the Princeton Instruments camera. The location and data type of the header parameters we need to make sense of the file are taken from the file specification in the WinView manual. SPE files can contain one or more frames. The If[ ] at the end applies an extra partioning function in the case of multiple frames. *)

strm=OpenRead[fname,DOSTextFormatFalse,BinaryFormat -> True];

URL: ,

Subject (listing for 'importing *.SPE binary files on mac os x')
Author Date Posted
importing *.SPE binary files on mac os x Rob Sewell 06/06/05 06:56am
Re: importing *.SPE binary files on mac os x christoph he... 07/13/05 3:01pm
Re: importing *.SPE binary files on mac o... Forum Modera... 07/13/05 9:26pm
Next Comment >Help | Reply To Topic