# File: mk_mvl30_v02.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/prep/src/mk_mvl30_v02.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#; FILE:    mk_mvl30.ips
#; PURPOSE: Make a full disk (or) high resolution magnetogram, ave
#;	   velocity and average line-depth from a 30 sec observation.  
#;	   the continuum filtergram too.
#; METHOD:
#;		LCP in page 0 & 3
#;		RCP in page 1 & 2
#;		FC  in page 4
#;
#;						CONT filt 1024 page 19
#;
#;		VEL-RCP in page 5
#;		LINE-DEP (RCP) in page 17
#;		VEL-LCP in page 2
#;		LINE-DEP (LCP) in page 15
#;						LINE-DEP (Avg) in page 6
#;
#;						MAG in page 17
#;						VEL-AVG in page 7
#;
#;		Available pages: 11,13,18
#;
#; HISTORY: Written 2-May-96 by M.Morrison (using prog_mvc60 as st
#;	 3-May-96 (MDM) - Moved the page usage around a bit
#;	 6-May-96 (MDM) - changed to put Line-Dep (Avg) in page 13, not
#;			  (it was clobbering the Mag and VEL-AVG)
#;			- Changed DPC for mag and vel to 4b45 and 4a45 (from
#;			  4b43 and 4a44)
#;	 9-May-96 (MDM) - Changed when things are done (on which frames
#;			  new framelist
#;			- Reversed the Mag sign and changed dpc to 4b46
#;			- Changed the K bits for vel and mag
#;			- Changed to put Line-Dep (avg) in page 15, not page 13
#;			  to leave page 13 unused for flat field backup
#;			- Corrected line depth compression to come from proper page
#;	 9-May-96 (MDM) - Modified to have linedepth use page 18,15,18 
#;			  of 15,18,15 because of LOOKUP page restriction
#;	 9-May-96 (MDM) - Swapped page 2 and 4 incoming page usage
#;	 9-May-96 (MDM) - Moved VEL-LCP to page 2 (from page 4)
#;	16-Jul-96 (MDM) - Renamed from "mk_hr_mvl30" to "mk_mvl30" and 
#;			  to handle full disk option
#;			- set the velocity compression to 0xe4 (from 0xe5)
#;	17-Jul-96 (MDM) - Set all sub-version values for the DPCs to "7
#;			  (except filtergrams)
#;			- Set mag n/k to "e3"
#;			- Changed vel and ldep "average" to be average (shifted
#;			  by an extra 2 to preserve the charge)
#;	18-Jul-96 (MDM) - Removed square-root compression calls (becaus
#;			  are done after the formatting typically)
#;			- Moved continuum filtergram to page 5 (copy from 19)
#;			- Moved avg line-depth to page 6 (old was page 18)
#;	24-Jul-96 (MDM) - Changed LDEPTH args from "7  127  7" to
#;			  "6 127 8"
#;        1-Aug-96 (MDM) - Changed CONT_FLT and LDEPTH K to be one
#;                         higher (since SQRT_COMP will reduce it 
#
#QSR_HR_MVL30::
#    SETREGS  $IPRL_VLCM_CONT_FLT  3 0xe3   0x4048 0x2000
tcblock mbipmacl 0x1663    0x01B2 0x1487 0x0003 0x00E3 \
                                0x4048 0x2000 
#    SETREGS  $IPRL_VLCM_LDEPTH    3 0xe4   0x4447 0x2000
tcblock mbipmacl 0x1669    0x01B2 0x1490 0x0003 0x00E4 \
                                0x4447 0x2000 
#    SETREGS  $IPRL_VLCM_VEL       3 0xe4   0x4a47 0x2000
tcblock mbipmacl 0x166F    0x01B2 0x148D 0x0003 0x00E4 \
                                0x4A47 0x2000 
#    SETREGS  $IPRL_VLCM_MAG       3 0xe3   0x4b47 0x2000
tcblock mbipmacl 0x1675    0x01B2 0x1493 0x0003 0x00E3 \
                                0x4B47 0x2000 
#    GOTO &COMMON_CODE
tcblock mbipmacl 0x167B    0x0156 0x1697 
#
#QSR_FD_MVL30::
#    SETREGS  $IPRL_VLCM_CONT_FLT  3 0xe3   0x404b 0x2000
tcblock mbipmacl 0x167D    0x01B2 0x1487 0x0003 0x00E3 \
                                0x404B 0x2000 
#    SETREGS  $IPRL_VLCM_LDEPTH    3 0xe4   0x4c47 0x2000
tcblock mbipmacl 0x1683    0x01B2 0x1490 0x0003 0x00E4 \
                                0x4C47 0x2000 
#    SETREGS  $IPRL_VLCM_VEL       3 0xe4   0x4247 0x2000
tcblock mbipmacl 0x1689    0x01B2 0x148D 0x0003 0x00E4 \
                                0x4247 0x2000 
#    SETREGS  $IPRL_VLCM_MAG       3 0xe3   0x4847 0x2000
tcblock mbipmacl 0x168F    0x01B2 0x1493 0x0003 0x00E3 \
                                0x4847 0x2000 
#    GOTO &COMMON_CODE
tcblock mbipmacl 0x1695    0x0156 0x1697 
#
#COMMON_CODE:
#
#    BRANCHEQ R3072  5 &FRM5		;save the continuum filtergram
tcblock mbipmacl 0x1697    0x01AE 0x0C00 0x0005 0x16A4 
#    BRANCHEQ R3072  8 &FRM8		;make the RCP velocity
tcblock mbipmacl 0x169B    0x01AE 0x0C00 0x0008 0x16B2 
#    BRANCHEQ R3072  9 &FRM9		;make the LCP velocity
tcblock mbipmacl 0x169F    0x01AE 0x0C00 0x0009 0x16DD 
#    RTNQUE
tcblock mbipmacl 0x16A3    0x01FA 
#
#FRM5:
#    SETREGS  $IPRL_FLTGRAM_PARAM 4 4:0x0000 19:0x0726		;set sourc
tcblock mbipmacl 0x16A4    0x01B2 0x1238 0x0004 0x0000 \
                                0x2000 0x0726 0x9800 
#    COPYRD2D $IPRL_VLCM_CONT_FLT  $IPRL_FLTGRAM_PARAM+8 3 	;last 
tcblock mbipmacl 0x16AB    0x0144 0x1487 0x1240 0x0003 
#    CALLQUE  $QSR_MK_FLTGRAM					;0.3 sec
tcblock mbipmacl 0x16AF    0x01F8 0x11E3 
#
#    RTNQUE
tcblock mbipmacl 0x16B1    0x01FA 
#
#FRM8:
#    ;---- Make RCP velocity
#    SETREGS $IPRL_VEL_PARAM   8  1:0x00514  2:0x00514  5:0x00726 
tcblock mbipmacl 0x16B2    0x01B2 0x1389 0x0008 0x0514 \
                                0x0800 0x0514 0x1000 0x0726 \
                                0x2800 0x0004 0x007F 
#    SETREGS $IPRL_VEL_PARAM+8 6  1 0xe5  0x4a00 0x2000   1 16
tcblock mbipmacl 0x16BD    0x01B2 0x1391 0x0006 0x0001 \
                                0x00E5 0x4A00 0x2000 0x0001 \
                                0x0010 
#    CALLQUE $QSR_MK_VEL						;1.7 sec
tcblock mbipmacl 0x16C6    0x01F8 0x123F 
#
#    ;---- Line depth (for RCP)
#    SETREGS  $IPRL_LDEP_PARAM    9 1:0x00514  2:0x00514 17:0x0072
tcblock mbipmacl 0x16C8    0x01B2 0x13CD 0x0009 0x0514 \
                                0x0800 0x0514 0x1000 0x0726 \
                                0x8800 0x0006 0x007F 0x0008 
#    SETREGS  $IPRL_LDEP_PARAM+9  3 0xe4 0x4400 0x2000
tcblock mbipmacl 0x16D4    0x01B2 0x13D6 0x0003 0x00E4 \
                                0x4400 0x2000 
#    CALLQUE  $QSR_MK_LDEP					;0.6 sec
tcblock mbipmacl 0x16DA    0x01F8 0x1340 
#
#    RTNQUE
tcblock mbipmacl 0x16DC    0x01FA 
#
#FRM9:
#    ;---- Make LCP velocity
#    SETREGS $IPRL_VEL_PARAM   8  0:0x00514  3:0x00514  2:0x00726 
tcblock mbipmacl 0x16DD    0x01B2 0x1389 0x0008 0x0514 \
                                0x0000 0x0514 0x1800 0x0726 \
                                0x1000 0x0004 0x007F 
#    SETREGS $IPRL_VEL_PARAM+8 6  1 0xe5  0x4a01 0x2000   1 16
tcblock mbipmacl 0x16E8    0x01B2 0x1391 0x0006 0x0001 \
                                0x00E5 0x4A01 0x2000 0x0001 \
                                0x0010 
#    CALLQUE $QSR_MK_VEL						;1.7 sec
tcblock mbipmacl 0x16F1    0x01F8 0x123F 
#
#    ;---- Line depth (for LCP)
#    SETREGS  $IPRL_LDEP_PARAM    9 0:0x00514  3:0x00514 15:0x0072
tcblock mbipmacl 0x16F3    0x01B2 0x13CD 0x0009 0x0514 \
                                0x0000 0x0514 0x1800 0x0726 \
                                0x7800 0x0006 0x007F 0x0008 
#    SETREGS  $IPRL_LDEP_PARAM+9  3 0xe4 0x4401 0x2000
tcblock mbipmacl 0x16FF    0x01B2 0x13D6 0x0003 0x00E4 \
                                0x4401 0x2000 
#    CALLQUE  $QSR_MK_LDEP					;0.6 sec
tcblock mbipmacl 0x1705    0x01F8 0x1340 
#
#    ;---- Make the average line depth
#    SETREGS  $IPRL_SUMDIFF_PARAM  7  17:0x00726 15:0x00726 6:0x00
tcblock mbipmacl 0x1707    0x01B2 0x13A0 0x0007 0x0726 \
                                0x8800 0x0726 0x7800 0x0726 \
                                0x3000 0x000F 
#    COPYRD2D $IPRL_VLCM_LDEPTH $IPRL_SUMDIFF_PARAM+7 3
tcblock mbipmacl 0x1711    0x0144 0x1490 0x13A7 0x0003 
#    CALLQUE  $QSR_DO_SUM					;0.3 sec
tcblock mbipmacl 0x1715    0x01F8 0x1304 
#
#    ;---- Subtract two velocities to make the mag
#    SETREGS  $IPRL_MAG_PARAM    6  2:0x00726  5:0x00726  17:0x007
tcblock mbipmacl 0x1717    0x01B2 0x1278 0x0006 0x0726 \
                                0x1000 0x0726 0x2800 0x0726 \
                                0x8800 
#    SETREGS  $IPRL_MAG_PARAM+6  5  0x100000L  1  0xFFFF  13
tcblock mbipmacl 0x1720    0x01B2 0x127E 0x0005 0x0000 \
                                0x0010 0x0001 0xFFFF 0x000D 
#    COPYRD2D $IPRL_VLCM_MAG  $IPRL_MAG_PARAM+11 3
tcblock mbipmacl 0x1728    0x0144 0x1493 0x1283 0x0003 
#    CALLQUE  $QSR_MK_MAG					;0.3 sec
tcblock mbipmacl 0x172C    0x01F8 0x1295 
#
#    ;---- Make the average dopplergram
#    SETREGS  $IPRL_SUMDIFF_PARAM  7  5:0x00726  2:0x00726  7:0x00
tcblock mbipmacl 0x172E    0x01B2 0x13A0 0x0007 0x0726 \
                                0x2800 0x0726 0x1000 0x0726 \
                                0x3800 0x000C 
#    COPYRD2D $IPRL_VLCM_VEL $IPRL_SUMDIFF_PARAM+7 3
tcblock mbipmacl 0x1738    0x0144 0x148D 0x13A7 0x0003 
#    CALLQUE  $QSR_DO_SUM					;0.3 sec
tcblock mbipmacl 0x173C    0x01F8 0x1304 
#
#    RTNQUE
tcblock mbipmacl 0x173E    0x01FA 
#=======================================================
#
return
#
#=======================================================
