| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| Gotta love it when you answer your own question and impress everyone with your ignorance ![]() There really is no magic, one just has to use readu this works great (for anyone else who reads this) file='cr0425.fpm openr,lun,file,/get_lun a=fltarr(10000) readu,lun,a ;; just get the first 100 points intt=indgen(100)*4 intx=indgen(100)*4+1 inty=indgen(100)*4+1 inty=indgen(100)*4+2 ;; plot them up. plot, a[intt],a[intz] binary_template() still doesn't work but if its like ascii_template() is too slow anyway. Brian -------------------------------------------------------------------------- Brian Larsen Boston University Center for Space Physics http://people.bu.edu/balarsen/Home/IDL |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.