pro calib_xt1, xmats, tfile, do_skew, sslope, xc1,xc2, $ ii,qq,uu,vv, i_scr,q_scr,u_scr,v_scr, run=run, verbose=verbose ;+ ; ; procedure: calib_xt1 ; ; purpose: apply Xs=1 and T=1, remove skew and ; DO NOT correct for residual I->QUV crosstalk ; ; (for getting radiant point polarimeter vectors for xttx ) ; ; author: rob@ncar, 10/93 modified by sku 27 July/95 ; ;============================================================================== ; ; Check number of parameters. ; if n_params() ne 14 then begin print print, "usage: calib_xt1, xmats, tfile, do_skew, sslope, $" print, " xc1,xc2, ii,qq,uu,vv, $" print, " i_scr,q_scr,u_scr,v_scr" print print, " Apply Xs and T; remove skew and residual" print, " I->QUV crosstalk (for calibrate.pro)." print print, " Arguments" print, " xmats - X matrices for each pos'n along slit" print, " (dimensions are [y2-y1+1, 4, 4])" print, " tfile - name of T matrix parameter file" print, " do_skew - 1=de-skew, 0=don't de-skew" print, " sslope - slope for use in de-skewing" print, " xc1, xc2 - X (wavelength) range for continuum" print, " ii - vv - spectral images (input and output)" print, " *_scr - scratch arrays" print print, " Keywords" print, " run - data of run for run-specific" print, " processing (def=skew.pro's default)" print, " verbose - if set, print run-time info" print, " (def=don't print)" print return endif ;- ; ; Specify common blocks. ; @scan_hdr.com ; ; ; Set general variables. ; ny_use1 = sizeof(xmats, 1) - 1 do_verb = keyword_set(verbose) ; ; ; Apply X and T matrices. ; ; ------------------------------ ; ; Theory: ; ; (S_inst is measured Stokes vector) ; (S_cal is calibrated Stokes vector) ; ; S_inst = X T S_cal ; ; Applied Below: ; ; S_cal = invert(T) invert(X) S_inst ; ; ------------------------------ ; ; ; Apply X matrix for each position along slit. ; if do_verb then print, '>>>>>>> applying X=1 matrix (multiplication) ...' for y = 0, ny_use1 do begin i_scr(*,y) = ii(*,y) q_scr(*,y) = qq(*,y) u_scr(*,y) = uu(*,y) v_scr(*,y) = vv(*,y) endfor ; ; Get and apply T matrix. ; if do_verb then print, '>>>>>>> applying T=1 matrix (multiplication) ...' t_mat = get_t(0, float(s_vtt(0)), float(s_vtt(1)), float(s_vtt(2)), tfile) t_mat = invert(t_mat) ; ii = i_scr qq = q_scr uu = u_scr vv = v_scr ; ; Optionally de-skew of the spectral images. ; if do_skew then begin if do_verb then print, '>>>>>>> removing skewness (skew) ...' ii = skew(ii, sslope, run=run) qq = skew(qq, sslope, run=run) uu = skew(uu, sslope, run=run) vv = skew(vv, sslope, run=run) endif ; ; Remove residual I -> Q,U,V crosstalk. if do_verb then print, '>>>>>>> I crosstalk (icross)is NOT applied ...' ;icross, ii, qq, uu, vv, xc1, xc2 if do_verb then print, '>>>>>>> gain corr,flatfld,deskewed polarimeter vecs...' ; ; Done. ; end