binary_template() errors and do I have to use this? [message #62279] |
Tue, 02 September 2008 12:52 |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
All,
I just got a bunch of satellite data that I would like to read in,
unfortunately instead of being cdf or something kind it is some random
format described as:
The .FPM files contain the CRRES magnetometer data already converted
to
magnetic field components. The files consist of 16-byte frames
containing UT,
Bx,By,Bz in INTEL floating-point format.
My system:
IDL> print, !version
{ i386 darwin unix Mac OS X 6.4.1 Sep 25 2007 32 64}
I tried to use binary_template() (for the first time) and got a pile
or errors trying to setup the template. Have others seen this?
IDL> tmp=binary_template(file)
% Compiled module: XMANAGER.
% Compiled module: CW_FIELD.
% Compiled module: CW_BGROUP.
% XMANAGER: Caught unexpected error from client application. Message
follows...
% Attempt to call undefined procedure/function: 'BT_ENTRY_IS_VALID'.
% Execution halted at: BT_MODIFY_FIELD_EVENT 812 /Applications/itt/
idl64/lib/binary_template.pro
% XMANAGER_EVLOOP_REAL_MODAL 506 /Applications/
itt/idl64/lib/xmanager.pro
% XMANAGER 704 /Applications/itt/idl64/
lib/xmanager.pro
% BT_MODIFY_FIELD 1222 /Applications/itt/idl64/
lib/binary_template.pro
% BINARY_TEMPLATE_EVENT 1272 /Applications/itt/
idl64/lib/binary_template.pro
% XMANAGER_EVLOOP_REAL_MODAL 506 /Applications/
itt/idl64/lib/xmanager.pro
% XMANAGER 704 /Applications/itt/idl64/
lib/xmanager.pro
% BINARY_TEMPLATE 1714 /Applications/itt/idl64/
lib/binary_template.pro
% $MAIN$
So giving up on this I tried the following and would like to do this
or something close:
- read a line into a string -> convert to byte -> grab 4 bytes ->
convert to float
I can do the first 2 steps easy, step one returns string from the
file, step 2 makes that a byte array, step 3 is just array[0:3], but I
dont know how to combine these to a float for step 4.
Does anyone have advice on this or insight into a different solution?
Thanks,
Brian
------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
|
|
|