; NAME: mk_mag.ips ; PURPOSE: Make a magnetogram data product and header ; HISTORY: Written 15-Jan-96 by M.Morrison ; 2-Oct-96 (MDM) - Added sub-pixel alignment of Y dimension ; for high resoultion images ; 4-Oct-96 (MDM) - Modified to shift LCP instead of RCP ; 7-Oct-96 (MDM) - Modified to ; 1. copy from source (page 2) to page 1 (input for YALIGN) ; 2. copy from source (page 2) to page 17 (output for YALIGN) ; (done because YALIGN does not write all of the image back) ; 3. Do align (from page 1 to 17) ; 4. Copy from page 17 to page 2. ; - MODIFIED TO NOT LOOK AT **MAG_PARAM** but to used hardwired source page ; ; QSR_MK_MAG:: ; NOTE: **** ROUTINE DOES NOT LOOK AT MAG_PARAM for the align portion **** BRANCHIF $IPRL_MAGCAM_DO_ALIGN &SKIP_ALIGN ;if 0, then FD and don't align _MOVBLKI $IPRL_MAGCAM_MOVE1A ;copy page 2 to 1 _MOVBLKI $IPRL_MAGCAM_MOVE1B ;copy page 2 to 17 SETREG $IPRL_MAGCAM_YALIGN 0 ;reset low address word of source SETREG $IPRL_MAGCAM_YALIGN+2 0 ;reset low address word of destination SETREG $IPRL_MAGCAM_COUNTER 8 ALIGN_LOOP: YALIGN $IPRL_MAGCAM_YALIGN ;subpixel shift the RCP 0.1 pixels into page 10 ADDREGD $IPRL_MAGCAM_COUNTER -1 BRANCHNE $IPRL_MAGCAM_COUNTER 0 &ALIGN_LOOP _MOVBLKI $IPRL_MAGCAM_MOVE2 ;move image back to page 2 from page 17 ;-------- Do the magnetogram calculation SKIP_ALIGN: _SCALESUM $IPRL_MAG_PARAM ;newMAG = LCP_VEL - RCP_VEL ;-------- decode the source and destination page info COPYREG $IPRL_MAG_PARAM+1 $IPRL_HDECODE_PARAM ;copy the source page high word into a known fixed place COPYREG $IPRL_MAG_PARAM+5 $IPRL_HDECODE_PARAM+1 ;copy the dest page high word into a known fixed place CALLQUE $QSR_DO_HDECODE ;decode the value - ;-------- now copy the relevant info to the hrdinit slot and make the header COPYRI2D $IPRP_HDECODE_ADDR+1 $IPRL_HEAD_WORK 10 ;copy the register list to a fixed working area COPYRD2D $IPRL_MAG_PARAM+4 $IPRL_HEAD_WORK+6 4 ;copy the final dest(l,h), # of pix (l,h) COPYRD2D $IPRL_MAG_PARAM+11 $IPRL_HEAD_WORK+3 3 ;copy n/k, dpc(l), and dpc(h) into the HRDINIT slot COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR+1 10 ;copy the register list back to the slot CALLQUE $QSR_DO_HEADER RTNQUE