datestr = datestr6_pwd() echo=1 NCP = nsxng_load_ncp() redo = 0 c = nsxng_constants() ; load NSX contants (were globals) ncp = nsxng_load_ncp() ; load NSX edge of slit polynomials nsxng_load_WSC, c.nsxdir, WSC ; read the shortlog file... nsets = rd_2_shortlog(datestr, sets, /nocal) ;for iset = 0, nsets-1 do begin for iset = 6,6 do begin set = sets[iset] count = rd_2_position(datestr, set.setno, seqno, object, dpatname, beam) if strtrim(dpatname[0],2) eq 'ABBA' then begin beamarr = ['ABEAM','BBEAM'] endif else begin beamarr = ['CENTER','SKY'] endelse for ibeam = 0, 1 do begin beammatch = beamarr[ibeam] indx = where(beam eq beammatch, nim) if nim gt 0 then begin for iim = 0, nim-1 do begin fn = fn1s( datestr, seqno[indx[iim]], ok) print, fn if not ok then stop nsxng_read_image, IA, echo, file=fn[0], logfu=-1 IA.slitoffset = slitoffset(IA.root) if (0) then begin ; BIGCOMMENT SPX = replicate(nsxng_SPXtype(),9) nsxng_spx_numpro, SPX, IA.nc, NCP asinc = c.ARCSEC_PER_PIXEL asmax = round( asinc * SPX[3].numpro ) nxnyn, *(IA.image), nc, nr plotsub, *(IA.image), bin=2 color = [x11rgb('yellow'), x11rgb('red')] for as = 0., asmax, asinc do begin for nso = 3, 7 do begin if (nso eq 7) then ecol=IA.nc/2 else ecol=IA.nc for icol = 0L, ecol-1, 10L do begin edge = nsxng_find_real_image_row( 1, icol, nso, NCP, IA.SlitOffset ) oplot, [icol,icol], [edge,edge], color=color[0] rb1 = edge + nsxng_AVPinv( AVP, nso, icol, as, IA, WSC ) rb2 = edge + nsxng_AVPinv( AVP, nso, icol, as+asinc, IA, WSC ) oplot, [icol,icol], [rb1, rb2], color=color[1] endfor endfor endfor endif ; BIGCOMMENT ;print, 'before nsxng_arcsec_profile_mash' & stop nsxng_arcsec_profile_mash, IA, SPX, AVP, NCP, WSC if iim eq 0 then begin SPXIM = replicate(SPX[0], 9, nim) end SPXIM[*,iim] = SPX if if (0) then begin ; BIGCOMMENT colors = [x11rgb('black'), x11rgb('sienna'), x11rgb('red'), x11rgb('orange'), $ x11rgb('goldenrod'), x11rgb('DarkGreen'), x11rgb('DarkBlue'), x11rgb('purple')] if iim eq 0 then begin for nso = 3, 7 do begin spxn = spx[nso] window, nso plot, (spxn.pro_apx)[0:spxn.pro_apn], (spxn.pro_apymed)[0:spxn.pro_apn], $ color=colors[iim] endfor endif else begin for nso = 3, 7 do begin spxn = spx[nso] wset, nso oplot, (spxn.pro_apx)[0:pro_apn], (spxn.pro_apymedx)[0:pro_apn], $ color=colors[iim] endfor endelse print, 'plotted ', seqno[indx[iim]], beaam[indx[iim]] & stop endif ; BIGCOMMENT stop endfor ; valid images in a set endif ; any valid images endfor ; beams print, 'end of set ', set.setno stop endfor ; the sets ;uniqobjects = objname(datestr, nobj, /trim, /nocal) ;for iobj = 0, nobj-1 do begin ; sets_obj = where(strtrim(sets.object, 2) eq uniqobjects[iobj], nsetobj) ;; for isetobj = 0, nsetobj - 1 do begin ; for isetobj = 0,0 do begin ; iset = sets_obj[isetobj] ; set = sets[iset] ; rd_2_position, fn, setno ;; fnpos = 'tables/'+datestr+'_2_position_'+string(iset, form='(I03)')+'.txt' ;; readcol, fnpos, indx, object, dpatname, dpatipos,dpatnpos, xoffset, yoffset, xiarcsec, etaarcsec, ;d, beam, $ ;; form = 'I,A, A,I,I, F,F, F,F, F,A', skip=2, delim=' ,:/', count=n ;; n = 2 ; ********* ; fn = fnsets( datestr, indx[0], n, ok) ; nsxng_read_image, IA, echo, file=fn[0], logfu=-1 ; IA.SlitOffset = 0. ;; 3.0679472 ;***************************** JUST A CHEAT FOR NOW ; nsxng_choose_best_AVP, IA, c.nsxdir, UseAVP ; nsxng_load_avp, AVP, UseAVP ; if (1) then begin ; SPX = replicate(nsxng_SPXtype(),9) ; nsxng_spx_numpro, SPX, IA.nc, NCP ; asinc = c.ARCSEC_PER_PIXEL ; asmax = round( asinc * SPX[3].numpro ) ; plotsub, *(IA.image), bin=2 ; nxnyn, *(IA.image), nc, nr ; plotsub, *(IA.image), bin=2 ; color = [x11rgb('yellow'), x11rgb('red')] ; for as = 0., asmax, asinc do begin ; for nso = 3, 7 do begin ; if (nso eq 7) then ecol=IA.nc/2 else ecol=IA.nc ; for icol = 0L, ecol-1, 10L do begin ; edge = nsxng_find_real_image_row( 1, icol, nso, NCP, IA.SlitOffset ) ; oplot, [icol,icol], [edge,edge], color=color[0] ; rb1 = edge + nsxng_AVPinv( AVP, nso, icol, as, IA, WSC ) ; rb2 = edge + nsxng_AVPinv( AVP, nso, icol, as+asinc, IA, WSC ) ; oplot, [icol,icol], [rb1, rb2], color=color[1] ; endfor ; endfor ; endfor ; endif ; BIGCOMMENT ; stop ; nsxng_arcsec_profile_mash, IA, SPX, AVP, NCP, WSC ; stop ; endfor ;endfor end