Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

projects/maven/mag/

marker_search.pro


*NAME: marker_search *PURPOSE: Find the first marker in the data file and return the byte number of the beginning of that marker. *CALLING SEQUENCE: marker_search,lun,sync_pattern,after_byte,found_byte,/debug *PARAMETERS: lun (required) (input) (integer) (scalar) Open file unit sync_pattern (required) (input) (scalar) (string - hex) The pattern to find. Hex - include leading zeros. after_byte (required) (input) (integer) (scalar) The byte to start the search after. If not needed, use 0. found_byte (required) (output) (scalar) (long word integer) The byte number in the file where - if no after_byte, the occurance of the pattern starts - if after_byte set, the next occurance of the pattern starts If marker not found, equals -1 debug (keyword) (input) (integer) (scalar) Set to print out debug information *EXAMPLES: marker_search,lun,'fe6b2840',0,found_byte,/debug marker_search,lun,'fe6b2840',found_byte+1L,found_byte *SYSTEM VARIABLES USED: none *INTERACTIVE INPUT: none *SUBROUTINES CALLED: none *FILES USED: open input file from parameter list *SIDE EFFECTS: Sets input file read pointer to start of file *RESTRICTIONS: *NOTES: found_byte equals -1 if marker not found *PROCEDURE: - determine size of file - determine length of sync pattern and separate first byte value - If after_byte not equals 0, skip number of bytes. - Until end-of-file or marker is found, - read a buffer of bytes - convert the bytes to hex - check for the start of the marker - if start of marker is found, - obtain additional bytes if needed - add leading zeros if necessary - combine the hex of the neceaary number of bytes - if equals the marker, return found byte of the marker *MODIFICATION HISTORY: 7 May 2012 PJL wrote - based on juno_cip_marker_search and juno_fgm_pkts_search - generalize 13 Mar 2013 PJL before each readu, make sure there are enough bytes remaining 8 Jul 2013 PJL subtract bytes read from track number

Routines

File attributes

Modification date: Thu Apr 10 11:53:07 2014
Lines: 100