root='/data/colors/kids/' dirFINAL = root+'final-xmatch-skybot/' dirSSO = root+'ssos/' dirFINAL ='~/work/data/kids/' dirSSO ='~/work/data/kids/' file='histo-lat-bin1.csv' binSize=1 ;-- READ # SSO per SQ DEG from Max readcol, dirFINAL+file, low,hig,kidsN, delimiter=',', /silent lat = (low+hig)/2. kids = replicate({lat:0, sso:0., norm:0.},181) kids.lat = -90 + indgen(181) kids[lat+90].sso = kidsN cgPlot, lat, kidsN, psym=10 cgPlot, kids.lat, kids.sso, psym=10, color='red', linestyle=2, /Over wdelete ;-- READ # sq deg per lat in KiDS from Max readcol, dirFINAL+'KiDSFieldsPerLatituce.csv', kidsLAT, kidsF, format='(F,I)', delimiter=',', /Silent kidsDeg = kidsF ;-vmano readcol, dirFINAL+'kids-fields.csv', kidsF, trash, kidsLAT, format='(A,F,F)', delimiter=',', /Silent ;-vmano ;-vmano kidsDeg = fltarr( 181/binSize ) ;-vmano for k=0, 181/binSize-2 do begin ;-vmano p=where( kidsLAT ge kids[k].lat and kidsLAT lt kids[k+1].lat ) ;-vmano ;-vmano if p[0] ne -1 then begin ;-vmano uField = uniq( kidsF[p], sort(kidsF[p]) ) ;-vmano nbSq = n_elements(uField) ;-vmano kidsDeg[k] = nbSq ;-vmano endif else nbSq=0 ;-vmano; print, k, kids[k].lat, kids[k+1].lat, nbSq ;-vmano ;-vmano endfor kids.norm = 1.*kids.sso / kidsDeg ;--- SKYBOT @ KIDS mid-time if not keyword_set(elat1) then $ readcol, dirSSO+'sso-now.csv', delimiter=',', /Silent, $ id1, ra1, dec1, d1, dra1, ddec1, h1, g1, class1, name1, glon1, glat1, elong1, elat1, $ format='(I,F,F,F,F,F,F,F,A,A,F,F,F,F)' cgHistoPlot, eLat1, binSize=binSize, loc=x, histdata=ssoN, minInput=-90, maxInput=90 ;max(hig)+binSize/2. wdelete sqDeg = fltarr( 181/binSize ) for k=0,180,binSize do sqDeg[k] = 360. * cos( (k-90.)*!DTOR) print, total(sqDeg) sb = replicate({lat:0, sso:0., norm:0.},181) sb.lat = x sb.sso = ssoN sb.norm = 1.* sb.sso / sqDeg ; forprint, sb.lat, sb.norm, textout=root+'sso_vs_lat.csv', $ ; format='(F5.1,",",F6.1)', comment='Latitude, SSO',/Silent ;-ratio kids to current ratio = kids.norm/sb.norm bad=where(~finite(ratio), com=val ) ratio[bad]=0 ;- no kids obsevrations noKids = [ [-60.00, -54.62], $ [-41.07, -38.65], $ [-38.38, -32.48], $ [-32.20, -30.68], $ [-11.80, -9.61 ], $ [ 7.31, 10.23], $ [ 23.80, 30.00] ] xRang=[-60,30] yRang= [1e-1,1e3] ;-------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------- ;----------------SYMETRY FIGURE-------------------------------------------------- ;-------------------------------------------------------------------------------- cgPS_open, Filename=dirFINAL+'Kids-NorthSouth.eps', /metric, /decomposed, /encapsulated, $ xSize=35, ySize=18.9, language_level=2, /quiet cgPlot, indgen(91), ratio[90:180], xRange=[0,60], yRange=yRang, /yLog, /NoData, $ xTitle='Absolute ecliptic latitude '+cgGreek('beta')+' (!Uo!N)', $ yTitle='KiDS/SkyBoT' cgPlot, /OverPlot, indgen(91), ratio[90:180] ,psym='Filled Circle', color='red' cgPlot, /OverPlot, indgen(91), reverse(ratio[0:90]),psym='Filled Circle', color='blue' xx = indgen(91) yy = reverse(ratio[0:90]) ok = where( yy ne 0 ) coef = linfit( xx[ok], alog10(yy[ok]) ) print, coef cgPlot, /OverPlot, xx, 10.^(coef[0]+coef[1]*xx), color='gray' yLin = 10.^(coef[0]+coef[1]*xx) cgPS_close, /PNG, delete_PS=0 ;-------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------- ;-------------PAPER FIGURE------------------------------------------------------- ;-------------------------------------------------------------------------------- cgPS_open, Filename=dirFINAL+'Kids-lat2.eps', /metric, /decomposed, /encapsulated, $ xSize=35, ySize=18.9, language_level=2, /quiet cgPlot, x, kids.norm/sb.norm, psym=10, yr=yRang, /NoData, /yLog, $ xTitle='Ecliptic latitude '+cgGreek('beta')+' (!Uo!N)', $ yTitle='KiDS/SkyBoT', xRange=xRang ;-no kids area for k=0,6 do begin xNO=noKids[[0,1,1,0,0],k] yNO=yRang[[0,0,1,1,0]] cgColorFill, xNO, yNO, color='Light gray' endfor ;-equality cgPlot, sb.lat, x*0+1, linestyle=2, /OverPlot ; cgPlot, sb.lat, kids.norm/sb.norm, psym=10, /ylog, yr=yRang, /NoErase, xRange=xRang ; cgPlot, /OverPlot, xx, yLin, color='Cornflower blue' ; cgPlot, /OverPlot, -90+xx, reverse(yLin), color='Cornflower blue' cgPlot, /OverPlot, sb.lat+0.5, ratio, psym='Filled circle' cgPlot, /OverPlot, sb.lat+0.5, ratio, psym=10 ; coef = poly_fit( sb[val].lat+0.5, alog10(ratio[val]), 2, yfit=poly, chisq=chi ) ; xx = sb.lat+0.5 ; cgPlot, /OverPlot, xx, (coef[0]+coef[1]*xx+coef[2]*xx*xx)*10, color='red' ; print, coef ; print, chi ; ;-replot axes over gray area cgPlot, x, kids.norm/sb.norm, psym=10, yr=yRang, /NoData, /yLog,/NoErase, xRange=xRang cgPS_close, /PNG, delete_PS=0 end