pro markprep, rot1,rot2, nodelete=nodelete @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; MarkPrep ; PURPOSE: ; Converts HAO MARK III synoptic map files (UNIX files) to VAX fixed ; record binary files ; CATEGORY: ; I/O ; CALLING SEQUENCE: ; markprep [, first_rotation, last_rotation, /nodelete] ; INPUTS: ; OPTIONAL INPUT PARAMETERS: ; first_rotation # of first Carrington rotation to be processed ; last_rotation # of last rotation to be processed ; /nodelete the original HAO file is deleted after conversion to ; VAX format UNLESS the /nodelete keyword is set ; CALLS: ; SetFileSpec, GetFileSpec, do_file, ieee_to_vax, bin_read ; PROCEDURE: ; > If both arguments are omitted, user prompts will follow ; > For each rotation 4 files are procesed: *e1.36, *e1.74, *w1.36, *w1.74. ; > The VAX file is an unformatted file with fixed record lenght of 720 ; bytes (360 short integers; 180 long integers). ; > The array read from the HAO file is a 360 x 181 short integer array. ; > The array is flipped in the latitudinal direction by applying ; a rotate(array,7). (This is the form in which the MARKIII synoptic ; map program expects to find the array). ; MODIFICATION HISTORY: ; MAR-1994, Paul Hick (UCSD) ;- delete = 1-keyword_set(nodelete) case n_params() of 1: rot2 = rot1 2: else: message, 'Specify start and end rotation, or just a single rotation endcase postfix = ['E1.36','E1.74','W1.36','W1.74'] for i=rot1,rot2 do begin for j=0,3 do begin file = strcompress(i,/rem)+postfix(j) if bin_read(file,a,nx=360) then begin a = a[*,0:180] ieee_to_host, a a=rotate(a,7) infile = file SetFileSpec, file file = GetFileSpec(part='name')+strmid(GetFileSpec(part='type'),1)+'.MRK' message, /info, 'Creating '+file openw,/get_lun,iu, file,/fixed,2*360 writeu,iu,a free_lun,iu if delete then stat = do_file(infile,/delete) endif endfor endfor return & end