# File: prog_hr_mvc60_v02.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/prog_hr_mvc60_v02.src"
descr "Loads IP queue instructions"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; FILE:    prog_hr_mvc60.ips
#; PURPOSE: Make a high resolution magnetogram from a 60 sec obser
#;	   2 double scans each in LCP and RCP
#;	   Downlink either:
#;		mag + continuum filtergram (sqrt comp)	4b002000 & 40083e00
#;		mag + average line depth 		4b002000 & 44033e00
#;			(OR)
#;		mag + average dopplergram		4b002000 & 4a022e00
#; METHOD:
#;		LCP in page 0 & 6
#;		RCP in page 1 & 4
#;		FC  in page 3 & 5 (Si)
#;		F1,2,3,4 in page 2 (Sd)
#;
#;		VEL-RCP in page 5
#;		LINE-DEP (RCP) in page 17
#;		VEL-LCP in page 15
#;		LINE-DEP (LCP) in page 18
#;		LINE-DEP (Avg) in page 19	extracted into page 18
#;
#;		MAG in page 6			extracted into page 4
#;		VEL-AVG in page 7		extracted into page 15
#;
#;		CONT flgram 1024 extract in page 0
#;		CONT flgram extract to 19	compress into page 17
#; HISTORY: Written 27-Feb-96 by M.Morrison
#;	29-Feb-96 (MDM) - Removed the continuum observable calculation
#;			- Added filtergram continuum
#;	 4-Mar-96 (MDM) - Changed shift count on LDEPTH instruction fro
#;			- Removed the sqrt compression of the LDEPTH observable (new 
#;			- Changed LDEPTH compression from e2 to e3
#;			- Shifted some page usage around
#
#QPROG_HR_MC60::
#    SETREGS $IPRL_DL_PARAM 2 0x8800 0x2000			;downlink continuum 
tcblock mbipcmd 0x0091 0x1A68   0x01B2 0x11D0 0x0002 0x8800 \
                                0x2000 
#    GOTO &INCOMING_IMG
tcblock mbipcmd 0x0091 0x1A6D   0x0156 0x1A7B 
#
#QPROG_HR_ML60::
#    SETREGS $IPRL_DL_PARAM 2 0x9000 0x2000			;downlink line-depth
tcblock mbipcmd 0x0091 0x1A6F   0x01B2 0x11D0 0x0002 0x9000 \
                                0x2000 
#    GOTO &INCOMING_IMG
tcblock mbipcmd 0x0091 0x1A74   0x0156 0x1A7B 
#
#QPROG_HR_MV60::
#    SETREGS $IPRL_DL_PARAM 2 0x7800 0x2000			;downlink avg-dop an
tcblock mbipcmd 0x0091 0x1A76   0x01B2 0x11D0 0x0002 0x7800 \
                                0x2000 
#
#INCOMING_IMG:
#    COPYRD2D $IPRL_EXTRACT_80K $IPRL_EXTRACT_PARAM 6            ;
tcblock mbipcmd 0x0091 0x1A7B   0x0144 0x13F0 0x1173 0x0006 
#
#    BRANCHEQ R3072  18 &FRM18
tcblock mbipcmd 0x0091 0x1A7F   0x01AE 0x0C00 0x0012 0x1A8C 
#    BRANCHEQ R3072  19 &FRM19
tcblock mbipcmd 0x0091 0x1A83   0x01AE 0x0C00 0x0013 0x1AB7 
#    BRANCHEQ R3072  20 &FRM20
tcblock mbipcmd 0x0091 0x1A87   0x01AE 0x0C00 0x0014 0x1AFA 
#    END
tcblock mbipcmd 0x0091 0x1A8B   0x01FC 
#
#FRM18:
#
#    ;---- Make RCP velocity
#    SETREGS $IPRL_VEL_PARAM   8  1:0x00514  4:0x00514  5:0x00726 
tcblock mbipcmd 0x0091 0x1A8C   0x01B2 0x1389 0x0008 0x0514 \
                                0x0800 0x0514 0x2000 0x0726 \
                                0x2800 0x0003 0x007F 
#    SETREGS $IPRL_VEL_PARAM+8 6  1 0xe5  0x4a00 0x2000   1 16
tcblock mbipcmd 0x0091 0x1A97   0x01B2 0x1391 0x0006 0x0001 \
                                0x00E5 0x4A00 0x2000 0x0001 \
                                0x0010 
#    CALLQUE $QSR_MK_VEL						;1.7 sec
tcblock mbipcmd 0x0091 0x1AA0   0x01F8 0x1761 
#
#    ;---- Line depth (for RCP)
#    SETREGS  $IPRL_LDEP_PARAM    9 1:0x00514  4:0x00514 17:0x0072
tcblock mbipcmd 0x0091 0x1AA2   0x01B2 0x13CD 0x0009 0x0514 \
                                0x0800 0x0514 0x2000 0x0726 \
                                0x8800 0x0008 0x007F 0x0008 
#    SETREGS  $IPRL_LDEP_PARAM+9  3 0xe4 0x4400 0x2000
tcblock mbipcmd 0x0091 0x1AAE   0x01B2 0x13D6 0x0003 0x00E4 \
                                0x4400 0x2000 
#    CALLQUE  $QSR_MK_LDEP					;0.6 sec
tcblock mbipcmd 0x0091 0x1AB4   0x01F8 0x19D0 
#
#    END
tcblock mbipcmd 0x0091 0x1AB6   0x01FC 
#
#FRM19:
#    ;---- Make LCP velocity
#    SETREGS $IPRL_VEL_PARAM   8  0:0x00514  6:0x00514  15:0x00726
tcblock mbipcmd 0x0091 0x1AB7   0x01B2 0x1389 0x0008 0x0514 \
                                0x0000 0x0514 0x3000 0x0726 \
                                0x7800 0x0003 0x007F 
#    SETREGS $IPRL_VEL_PARAM+8 6  1 0xe5  0x4a01 0x2000   1 16
tcblock mbipcmd 0x0091 0x1AC2   0x01B2 0x1391 0x0006 0x0001 \
                                0x00E5 0x4A01 0x2000 0x0001 \
                                0x0010 
#    CALLQUE $QSR_MK_VEL						;1.7 sec
tcblock mbipcmd 0x0091 0x1ACB   0x01F8 0x1761 
#
#    ;---- Line depth (for LCP)
#    SETREGS  $IPRL_LDEP_PARAM    9 0:0x00514  6:0x00514 18:0x0072
tcblock mbipcmd 0x0091 0x1ACD   0x01B2 0x13CD 0x0009 0x0514 \
                                0x0000 0x0514 0x3000 0x0726 \
                                0x9000 0x0008 0x007F 0x0008 
#    SETREGS  $IPRL_LDEP_PARAM+9  3 0xe4 0x4401 0x2000
tcblock mbipcmd 0x0091 0x1AD9   0x01B2 0x13D6 0x0003 0x00E4 \
                                0x4401 0x2000 
#    CALLQUE  $QSR_MK_LDEP					;0.6 sec
tcblock mbipcmd 0x0091 0x1ADF   0x01F8 0x19D0 
#
#    ;---- Make the average line depth
#    SETREGS  $IPRL_SUMDIFF_PARAM  10  17:0x00726 18:0x00726 19:0x
tcblock mbipcmd 0x0091 0x1AE1   0x01B2 0x13A0 0x000A 0x0726 \
                                0x8800 0x0726 0x9000 0x0726 \
                                0x9800 0x0010 0x00E3 0x4403 \
                                0x2000 
#    CALLQUE  $QSR_DO_SUM					;0.3 sec
tcblock mbipcmd 0x0091 0x1AEE   0x01F8 0x1994 
#
#    ;---- Extract it and square-root it
#    SETREGS  $IPRL_EXTRACT_INST 4  19:0x0726 18:0x0726          ;
tcblock mbipcmd 0x0091 0x1AF0   0x01B2 0x116B 0x0004 0x0726 \
                                0x9800 0x0726 0x9000 
#    CALLQUE  $QSR_FMT_EXTRACT                           	;0.3 sec
tcblock mbipcmd 0x0091 0x1AF7   0x01F8 0x1239 
#
#    END
tcblock mbipcmd 0x0091 0x1AF9   0x01FC 
#
#FRM20:
#    ;---- Continuum filtergram (get it out of the way for next pa
#
#    SETREGS  $IPRL_FLTGRAM_PARAM 4 3:0x0000 0:0x0226            ;
tcblock mbipcmd 0x0091 0x1AFA   0x01B2 0x1238 0x0004 0x0000 \
                                0x1800 0x0226 0x0000 
#    SETREGS  $IPRL_FLTGRAM_PARAM+8 3 0xe2   0x4008 0x2000       ;
tcblock mbipcmd 0x0091 0x1B01   0x01B2 0x1240 0x0003 0x00E2 \
                                0x4008 0x2000 
#    CALLQUE  $QSR_MK_FLTGRAM					;0.3 sec
tcblock mbipcmd 0x0091 0x1B07   0x01F8 0x1334 
#
#
#    ;vvvvvvvvvvvvvvvvvvv could be done at FRAME19, but want it do
#
#    ;---- Subtract two velocities to make the mag
#    SETREGS $IPRL_MAG_PARAM    6  5:0x00726  15:0x00726  6:0x0072
tcblock mbipcmd 0x0091 0x1B09   0x01B2 0x1278 0x0006 0x0726 \
                                0x2800 0x0726 0x7800 0x0726 \
                                0x3000 
#    SETREGS $IPRL_MAG_PARAM+6  5  0x100000L  1  0xFFFF  13
tcblock mbipcmd 0x0091 0x1B12   0x01B2 0x127E 0x0005 0x0000 \
                                0x0010 0x0001 0xFFFF 0x000D 
#    SETREGS $IPRL_MAG_PARAM+11 3  0xe4 0x4b00 0x2000
tcblock mbipcmd 0x0091 0x1B1A   0x01B2 0x1283 0x0003 0x00E4 \
                                0x4B00 0x2000 
#    CALLQUE $QSR_MK_MAG						;0.3 sec
tcblock mbipcmd 0x0091 0x1B20   0x01F8 0x17B7 
#
#    ;---- Make the average dopplergram
#    SETREGS  $IPRL_SUMDIFF_PARAM  10  5:0x00726  15:0x00726  7:0x
tcblock mbipcmd 0x0091 0x1B22   0x01B2 0x13A0 0x000A 0x0726 \
                                0x2800 0x0726 0x7800 0x0726 \
                                0x3800 0x000D 0x00E4 0x4A02 \
                                0x2000 
#    CALLQUE  $QSR_DO_SUM					;0.3 sec
tcblock mbipcmd 0x0091 0x1B2F   0x01F8 0x1994 
#
#    ;---- Extract the mag and avg-dop data
#
#    SETREGS  $IPRL_EXTRACT_INST 4 6:0x0726 4:0x0726             ;
tcblock mbipcmd 0x0091 0x1B31   0x01B2 0x116B 0x0004 0x0726 \
                                0x3000 0x0726 0x2000 
#    CALLQUE  $QSR_FMT_EXTRACT                                   ;
tcblock mbipcmd 0x0091 0x1B38   0x01F8 0x1239 
#
#    SETREGS  $IPRL_EXTRACT_INST 4 7:0x0726 15:0x0726            ;
tcblock mbipcmd 0x0091 0x1B3A   0x01B2 0x116B 0x0004 0x0726 \
                                0x3800 0x0726 0x7800 
#    CALLQUE  $QSR_FMT_EXTRACT                                   ;
tcblock mbipcmd 0x0091 0x1B41   0x01F8 0x1239 
#
#    ;^^^^^^^^^^^^^^^^^^^ could be done at FRAME19, but want it do
#
#    ;---- Extract continuum and square-root it
#    SETREGS  $IPRL_EXTRACT_INST  4  0:0x00226  19:0x0726	;setup s
tcblock mbipcmd 0x0091 0x1B43   0x01B2 0x116B 0x0004 0x0226 \
                                0x0000 0x0726 0x9800 
#    CALLQUE  $QSR_FMT_EXTRACT                                   ;
tcblock mbipcmd 0x0091 0x1B4A   0x01F8 0x1239 
#
#    SETREGS  $IPRL_SQRT_PARAM    4  19:0x00726 17:0x0726
tcblock mbipcmd 0x0091 0x1B4C   0x01B2 0x13B5 0x0004 0x0726 \
                                0x9800 0x0726 0x8800 
#    CALLQUE  $QSR_SQRT_COMP					;0.3 sec
tcblock mbipcmd 0x0091 0x1B53   0x01F8 0x1952 
#
#    ;---- Downlink the two observables
#    CALLQUE $QSR_DL_2PAGE					;0.6 sec
tcblock mbipcmd 0x0091 0x1B55   0x01F8 0x10DB 
#END
tcblock mbipcmd 0x0091 0x1B57   0x01FC 
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
