; pro fixxdr,filein ; ; Take input xdr file containing frames with latitudes ; frame.yy = -90,-87.5,-82.5,...,82.5,87.5,90. ; and write new xdr file with frame.yy = -87.5,-82.5,...,82.5,87.5 ; (and corresponding frame.f) ; on_ioerror,badio nfr = 0 luin = xdr_open(filein,nframes=nfr) if luin lt 0 then begin print,'fixxdr: error opening file ',filein return endif print,'Opened input xdr file ',filein ; fileout = filein + '.new' openw,luout,fileout,/get_lun,/xdr print,'Opened output xdr file ',fileout ; ; Read each frame, create new frame and write to new file: ; for i=0,nfr-1 do begin frame = xdr_rdframe(luin) newframe = { $ frsize:0, $ frame size (currently dummy) hdr1:frame.hdr1, $ 1st header line hdr2:frame.hdr2, $ 2nd header line hdr3:frame.hdr3, $ 3rd header line hdr4:frame.hdr4, $ 4th header line nx:frame.nx, $ number of x coords xlab:frame.xlab, $ x-axis label xx:frame.xx, $ x coords ny:frame.ny-2, $ number of y coords ylab:frame.ylab, $ y-axis label yy:frame.yy(1:frame.ny-2), $ y coords f:frame.f(*,1:frame.ny-2) $ data } writeu,luout,newframe endfor writeu,luout,nfr ; close,luout free_lun,luout free_lun,luin return ; badio: print,'>>> i/o error' return end