function readVHS, file spawn, 'wc -l '+file+"|awk '{print $1}'" , nbSSO nbSSO = round(float(nbSSO))-1 openR, idIn, file, /get_lun line ='' ePhot={PetroMag:0.,PetroMagErr:0.,PsfMag:0.,PsfMagErr:0.,SerMag2D:0.,SerMag2DErr:0.,AperMag3:0.,AperMag3Err:0.,$ AperMag4:0.,AperMag4Err:0.,AperMag6:0.,AperMag6Err:0.,AperMagNoAperCorr3:0.,AperMagNoAperCorr4:0.,AperMagNoAperCorr6:0.,$ HlCorSMjRadAs:0.,Gausig:0.,Ell:0.,PA:0.,ErrBits:0L,AverageConf:0.,Class:0,ClassStat:0.,ppErrBits:0L,SeqNum:0L,Xi:0.,Eta:0.} empty={sourceID:'',cuEventID:0L,frameSetID:0L,date:'', $ ra:0.,dec:0.,cx:0.,cy:0.,cz:0.,htmID:0L,l:0.,b:0.,lambda:0.,eta:0.,priOrSec:0L,$ ymjPnt:0.,ymjPntErr:0.,jmhPnt:0.,jmhPntErr:0.,hmksPnt:0.,hmksPntErr:0.,jmksPnt:0.,jmksPntErr:0.,$ ymjExt:0.,ymjExtErr:0.,jmhExt:0.,jmhExtErr:0.,hmksExt:0.,hmksExtErr:0.,jmksExt:0.,jmksExtErr:0.,$ mergedClassStat:0.,mergedClass:0,pStar:0.,pGalaxy:0.,pNoise:0.,pSaturated:0.,eBV:0.,aY:0.,aJ:0.,aH:0.,aKs:0.,$ Y:ePhot, J:ePhot, H:ePhot, K:ePhot} vhs = replicate(empty, nbSSO) readf, idIn, line i=0L while ~EOF(idIn) do begin readf, idIn, line s = strSplit(line,',',/extract,count=n) fI=0 vhs[i].sourceID = strtrim(s[fI],2) & fI++ vhs[i].cuEventID = round(float(s[fI])) & fI++ vhs[i].frameSetID = round(float(s[fI])) & fI++ vhs[i].date = strtrim(s[fI],2) & fI++ vhs[i].ra = float(s[fI]) & fI++ vhs[i].dec = float(s[fI]) & fI++ vhs[i].cx = float(s[fI]) & fI++ vhs[i].cy = float(s[fI]) & fI++ vhs[i].cz = float(s[fI]) & fI++ vhs[i].htmID = round(float(s[fI])) & fI++ vhs[i].l = float(s[fI]) & fI++ vhs[i].b = float(s[fI]) & fI++ vhs[i].lambda = float(s[fI]) & fI++ vhs[i].eta = float(s[fI]) & fI++ vhs[i].priOrSec = round(float(s[fI])) & fI++ vhs[i].ymjPnt = float(s[fI]) & fI++ vhs[i].ymjPntErr = float(s[fI]) & fI++ vhs[i].jmhPnt = float(s[fI]) & fI++ vhs[i].jmhPntErr = float(s[fI]) & fI++ vhs[i].hmksPnt = float(s[fI]) & fI++ vhs[i].hmksPntErr = float(s[fI]) & fI++ vhs[i].jmksPnt = float(s[fI]) & fI++ vhs[i].jmksPntErr = float(s[fI]) & fI++ vhs[i].ymjExt = float(s[fI]) & fI++ vhs[i].ymjExtErr = float(s[fI]) & fI++ vhs[i].jmhExt = float(s[fI]) & fI++ vhs[i].jmhExtErr = float(s[fI]) & fI++ vhs[i].hmksExt = float(s[fI]) & fI++ vhs[i].hmksExtErr = float(s[fI]) & fI++ vhs[i].jmksExt = float(s[fI]) & fI++ vhs[i].jmksExtErr = float(s[fI]) & fI++ vhs[i].mergedClassStat = float(s[fI]) & fI++ vhs[i].mergedClass = round(float(s[fI])) & fI++ vhs[i].pStar = float(s[fI]) & fI++ vhs[i].pGalaxy = float(s[fI]) & fI++ vhs[i].pNoise = float(s[fI]) & fI++ vhs[i].pSaturated = float(s[fI]) & fI++ vhs[i].eBV = float(s[fI]) & fI++ vhs[i].aY = float(s[fI]) & fI++ vhs[i].aJ = float(s[fI]) & fI++ vhs[i].aH = float(s[fI]) & fI++ vhs[i].aKs = float(s[fI]) & fI++ vhs[i].y.PetroMag = float(s[fI]) & fI++ vhs[i].y.PetroMagErr = float(s[fI]) & fI++ vhs[i].y.PsfMag = float(s[fI]) & fI++ vhs[i].y.PsfMagErr = float(s[fI]) & fI++ vhs[i].y.SerMag2D = float(s[fI]) & fI++ vhs[i].y.SerMag2DErr = float(s[fI]) & fI++ vhs[i].y.AperMag3 = float(s[fI]) & fI++ vhs[i].y.AperMag3Err = float(s[fI]) & fI++ vhs[i].y.AperMag4 = float(s[fI]) & fI++ vhs[i].y.AperMag4Err = float(s[fI]) & fI++ vhs[i].y.AperMag6 = float(s[fI]) & fI++ vhs[i].y.AperMag6Err = float(s[fI]) & fI++ vhs[i].y.AperMagNoAperCorr3 = float(s[fI]) & fI++ vhs[i].y.AperMagNoAperCorr4 = float(s[fI]) & fI++ vhs[i].y.AperMagNoAperCorr6 = float(s[fI]) & fI++ vhs[i].y.HlCorSMjRadAs = float(s[fI]) & fI++ vhs[i].y.Gausig = float(s[fI]) & fI++ vhs[i].y.Ell = float(s[fI]) & fI++ vhs[i].y.PA = float(s[fI]) & fI++ vhs[i].y.ErrBits = round(float(s[fI])) & fI++ vhs[i].y.AverageConf = float(s[fI]) & fI++ vhs[i].y.Class = round(float(s[fI])) & fI++ vhs[i].y.ClassStat = float(s[fI]) & fI++ vhs[i].y.ppErrBits = round(float(s[fI])) & fI++ vhs[i].y.SeqNum = round(float(s[fI])) & fI++ vhs[i].y.Xi = float(s[fI]) & fI++ vhs[i].y.Eta = float(s[fI]) & fI++ vhs[i].j.PetroMag = float(s[fI]) & fI++ vhs[i].j.PetroMagErr = float(s[fI]) & fI++ vhs[i].j.PsfMag = float(s[fI]) & fI++ vhs[i].j.PsfMagErr = float(s[fI]) & fI++ vhs[i].j.SerMag2D = float(s[fI]) & fI++ vhs[i].j.SerMag2DErr = float(s[fI]) & fI++ vhs[i].j.AperMag3 = float(s[fI]) & fI++ vhs[i].j.AperMag3Err = float(s[fI]) & fI++ vhs[i].j.AperMag4 = float(s[fI]) & fI++ vhs[i].j.AperMag4Err = float(s[fI]) & fI++ vhs[i].j.AperMag6 = float(s[fI]) & fI++ vhs[i].j.AperMag6Err = float(s[fI]) & fI++ vhs[i].j.AperMagNoAperCorr3 = float(s[fI]) & fI++ vhs[i].j.AperMagNoAperCorr4 = float(s[fI]) & fI++ vhs[i].j.AperMagNoAperCorr6 = float(s[fI]) & fI++ vhs[i].j.HlCorSMjRadAs = float(s[fI]) & fI++ vhs[i].j.Gausig = float(s[fI]) & fI++ vhs[i].j.Ell = float(s[fI]) & fI++ vhs[i].j.PA = float(s[fI]) & fI++ vhs[i].j.ErrBits = round(float(s[fI])) & fI++ vhs[i].j.AverageConf = float(s[fI]) & fI++ vhs[i].j.Class = round(float(s[fI])) & fI++ vhs[i].j.ClassStat = float(s[fI]) & fI++ vhs[i].j.ppErrBits = round(float(s[fI])) & fI++ vhs[i].j.SeqNum = round(float(s[fI])) & fI++ vhs[i].j.Xi = float(s[fI]) & fI++ vhs[i].j.Eta = float(s[fI]) & fI++ vhs[i].h.PetroMag = float(s[fI]) & fI++ vhs[i].h.PetroMagErr = float(s[fI]) & fI++ vhs[i].h.PsfMag = float(s[fI]) & fI++ vhs[i].h.PsfMagErr = float(s[fI]) & fI++ vhs[i].h.SerMag2D = float(s[fI]) & fI++ vhs[i].h.SerMag2DErr = float(s[fI]) & fI++ vhs[i].h.AperMag3 = float(s[fI]) & fI++ vhs[i].h.AperMag3Err = float(s[fI]) & fI++ vhs[i].h.AperMag4 = float(s[fI]) & fI++ vhs[i].h.AperMag4Err = float(s[fI]) & fI++ vhs[i].h.AperMag6 = float(s[fI]) & fI++ vhs[i].h.AperMag6Err = float(s[fI]) & fI++ vhs[i].h.AperMagNoAperCorr3 = float(s[fI]) & fI++ vhs[i].h.AperMagNoAperCorr4 = float(s[fI]) & fI++ vhs[i].h.AperMagNoAperCorr6 = float(s[fI]) & fI++ vhs[i].h.HlCorSMjRadAs = float(s[fI]) & fI++ vhs[i].h.Gausig = float(s[fI]) & fI++ vhs[i].h.Ell = float(s[fI]) & fI++ vhs[i].h.PA = float(s[fI]) & fI++ vhs[i].h.ErrBits = round(float(s[fI])) & fI++ vhs[i].h.AverageConf = float(s[fI]) & fI++ vhs[i].h.Class = round(float(s[fI])) & fI++ vhs[i].h.ClassStat = float(s[fI]) & fI++ vhs[i].h.ppErrBits = round(float(s[fI])) & fI++ vhs[i].h.SeqNum = round(float(s[fI])) & fI++ vhs[i].h.Xi = float(s[fI]) & fI++ vhs[i].h.Eta = float(s[fI]) & fI++ vhs[i].k.PetroMag = float(s[fI]) & fI++ vhs[i].k.PetroMagErr = float(s[fI]) & fI++ vhs[i].k.PsfMag = float(s[fI]) & fI++ vhs[i].k.PsfMagErr = float(s[fI]) & fI++ vhs[i].k.SerMag2D = float(s[fI]) & fI++ vhs[i].k.SerMag2DErr = float(s[fI]) & fI++ vhs[i].k.AperMag3 = float(s[fI]) & fI++ vhs[i].k.AperMag3Err = float(s[fI]) & fI++ vhs[i].k.AperMag4 = float(s[fI]) & fI++ vhs[i].k.AperMag4Err = float(s[fI]) & fI++ vhs[i].k.AperMag6 = float(s[fI]) & fI++ vhs[i].k.AperMag6Err = float(s[fI]) & fI++ vhs[i].k.AperMagNoAperCorr3 = float(s[fI]) & fI++ vhs[i].k.AperMagNoAperCorr4 = float(s[fI]) & fI++ vhs[i].k.AperMagNoAperCorr6 = float(s[fI]) & fI++ vhs[i].k.HlCorSMjRadAs = float(s[fI]) & fI++ vhs[i].k.Gausig = float(s[fI]) & fI++ vhs[i].k.Ell = float(s[fI]) & fI++ vhs[i].k.PA = float(s[fI]) & fI++ vhs[i].k.ErrBits = round(float(s[fI])) & fI++ vhs[i].k.AverageConf = float(s[fI]) & fI++ vhs[i].k.Class = round(float(s[fI])) & fI++ vhs[i].k.ClassStat = float(s[fI]) & fI++ vhs[i].k.ppErrBits = round(float(s[fI])) & fI++ vhs[i].k.SeqNum = round(float(s[fI])) & fI++ vhs[i].k.Xi = float(s[fI]) & fI++ vhs[i].k.Eta = float(s[fI]) & fI++ ; fI=0 ; vhs[i].sourceID = strtrim(s[fI],2) & fI++ ; vhs[i].cuEventID = round(float(s[fI])) & fI++ ; vhs[i].frameSetID = round(float(s[fI])) & fI++ ; vhs[i].date = float(s[3]) ; vhs[i].ra = float(s[3]) ; vhs[i].dec = float(s[4]) ; vhs[i].cx = float(s[5]) ; vhs[i].cy = float(s[6]) ; vhs[i].cz = float(s[7]) ; vhs[i].htmID = round(float(s[8])) ; vhs[i].l = float(s[9]) ; vhs[i].b = float(s[10]) ; vhs[i].lambda = float(s[11]) ; vhs[i].eta = float(s[12]) ; vhs[i].priOrSec = round(float(s[13])) ; vhs[i].ymjPnt = float(s[14]) ; vhs[i].ymjPntErr = float(s[15]) ; vhs[i].jmhPnt = float(s[16]) ; vhs[i].jmhPntErr = float(s[17]) ; vhs[i].hmksPnt = float(s[18]) ; vhs[i].hmksPntErr = float(s[19]) ; vhs[i].jmksPnt = float(s[20]) ; vhs[i].jmksPntErr = float(s[21]) ; vhs[i].ymjExt = float(s[22]) ; vhs[i].ymjExtErr = float(s[23]) ; vhs[i].jmhExt = float(s[24]) ; vhs[i].jmhExtErr = float(s[25]) ; vhs[i].hmksExt = float(s[26]) ; vhs[i].hmksExtErr = float(s[27]) ; vhs[i].jmksExt = float(s[28]) ; vhs[i].jmksExtErr = float(s[29]) ; vhs[i].mergedClassStat = float(s[30]) ; vhs[i].mergedClass = round(float(s[31])) ; vhs[i].pStar = float(s[32]) ; vhs[i].pGalaxy = float(s[33]) ; vhs[i].pNoise = float(s[34]) ; vhs[i].pSaturated = float(s[35]) ; vhs[i].eBV = float(s[36]) ; vhs[i].aY = float(s[37]) ; vhs[i].aJ = float(s[38]) ; vhs[i].aH = float(s[39]) ; vhs[i].aKs = float(s[40]) ; ; vhs[i].y.PetroMag = float(s[41]) ; vhs[i].y.PetroMagErr = float(s[42]) ; vhs[i].y.PsfMag = float(s[43]) ; vhs[i].y.PsfMagErr = float(s[44]) ; vhs[i].y.SerMag2D = float(s[45]) ; vhs[i].y.SerMag2DErr = float(s[46]) ; vhs[i].y.AperMag3 = float(s[47]) ; vhs[i].y.AperMag3Err = float(s[48]) ; vhs[i].y.AperMag4 = float(s[49]) ; vhs[i].y.AperMag4Err = float(s[40]) ; vhs[i].y.AperMag6 = float(s[51]) ; vhs[i].y.AperMag6Err = float(s[52]) ; vhs[i].y.AperMagNoAperCorr3 = float(s[53]) ; vhs[i].y.AperMagNoAperCorr4 = float(s[54]) ; vhs[i].y.AperMagNoAperCorr6 = float(s[55]) ; vhs[i].y.HlCorSMjRadAs = float(s[56]) ; vhs[i].y.Gausig = float(s[57]) ; vhs[i].y.Ell = float(s[58]) ; vhs[i].y.PA = float(s[59]) ; vhs[i].y.ErrBits = round(float(s[50])) ; vhs[i].y.AverageConf = float(s[61]) ; vhs[i].y.Class = round(float(s[62])) ; vhs[i].y.ClassStat = float(s[63]) ; vhs[i].y.ppErrBits = round(float(s[64])) ; vhs[i].y.SeqNum = round(float(s[65])) ; vhs[i].y.Xi = float(s[66]) ; vhs[i].y.Eta = float(s[67]) ; ; vhs[i].j.PetroMag = float(s[68]) ; vhs[i].j.PetroMagErr = float(s[69]) ; vhs[i].j.PsfMag = float(s[70]) ; vhs[i].j.PsfMagErr = float(s[71]) ; vhs[i].j.SerMag2D = float(s[72]) ; vhs[i].j.SerMag2DErr = float(s[73]) ; vhs[i].j.AperMag3 = float(s[74]) ; vhs[i].j.AperMag3Err = float(s[75]) ; vhs[i].j.AperMag4 = float(s[76]) ; vhs[i].j.AperMag4Err = float(s[77]) ; vhs[i].j.AperMag6 = float(s[78]) ; vhs[i].j.AperMag6Err = float(s[79]) ; vhs[i].j.AperMagNoAperCorr3 = float(s[80]) ; vhs[i].j.AperMagNoAperCorr4 = float(s[81]) ; vhs[i].j.AperMagNoAperCorr6 = float(s[82]) ; vhs[i].j.HlCorSMjRadAs = float(s[83]) ; vhs[i].j.Gausig = float(s[84]) ; vhs[i].j.Ell = float(s[85]) ; vhs[i].j.PA = float(s[86]) ; vhs[i].j.ErrBits = round(float(s[87])) ; vhs[i].j.AverageConf = float(s[88]) ; vhs[i].j.Class = round(float(s[89])) ; vhs[i].j.ClassStat = float(s[90]) ; vhs[i].j.ppErrBits = round(float(s[91])) ; vhs[i].j.SeqNum = round(float(s[92])) ; vhs[i].j.Xi = float(s[93]) ; vhs[i].j.Eta = float(s[94]) ; ; vhs[i].h.PetroMag = float(s[95]) ; vhs[i].h.PetroMagErr = float(s[96]) ; vhs[i].h.PsfMag = float(s[97]) ; vhs[i].h.PsfMagErr = float(s[98]) ; vhs[i].h.SerMag2D = float(s[99]) ; vhs[i].h.SerMag2DErr = float(s[100]) ; vhs[i].h.AperMag3 = float(s[101]) ; vhs[i].h.AperMag3Err = float(s[102]) ; vhs[i].h.AperMag4 = float(s[103]) ; vhs[i].h.AperMag4Err = float(s[104]) ; vhs[i].h.AperMag6 = float(s[105]) ; vhs[i].h.AperMag6Err = float(s[106]) ; vhs[i].h.AperMagNoAperCorr3 = float(s[107]) ; vhs[i].h.AperMagNoAperCorr4 = float(s[108]) ; vhs[i].h.AperMagNoAperCorr6 = float(s[109]) ; vhs[i].h.HlCorSMjRadAs = float(s[110]) ; vhs[i].h.Gausig = float(s[111]) ; vhs[i].h.Ell = float(s[112]) ; vhs[i].h.PA = float(s[113]) ; vhs[i].h.ErrBits = round(float(s[114])) ; vhs[i].h.AverageConf = float(s[115]) ; vhs[i].h.Class = round(float(s[116])) ; vhs[i].h.ClassStat = float(s[117]) ; vhs[i].h.ppErrBits = round(float(s[118])) ; vhs[i].h.SeqNum = round(float(s[119])) ; vhs[i].h.Xi = float(s[120]) ; vhs[i].h.Eta = float(s[121]) ; ; vhs[i].k.PetroMag = float(s[122]) ; vhs[i].k.PetroMagErr = float(s[123]) ; vhs[i].k.PsfMag = float(s[124]) ; vhs[i].k.PsfMagErr = float(s[125]) ; vhs[i].k.SerMag2D = float(s[126]) ; vhs[i].k.SerMag2DErr = float(s[127]) ; vhs[i].k.AperMag3 = float(s[128]) ; vhs[i].k.AperMag3Err = float(s[129]) ; vhs[i].k.AperMag4 = float(s[130]) ; vhs[i].k.AperMag4Err = float(s[131]) ; vhs[i].k.AperMag6 = float(s[132]) ; vhs[i].k.AperMag6Err = float(s[133]) ; vhs[i].k.AperMagNoAperCorr3 = float(s[134]) ; vhs[i].k.AperMagNoAperCorr4 = float(s[135]) ; vhs[i].k.AperMagNoAperCorr6 = float(s[136]) ; vhs[i].k.HlCorSMjRadAs = float(s[137]) ; vhs[i].k.Gausig = float(s[138]) ; vhs[i].k.Ell = float(s[139]) ; vhs[i].k.PA = float(s[140]) ; vhs[i].k.ErrBits = round(float(s[141])) ; vhs[i].k.AverageConf = float(s[142]) ; vhs[i].k.Class = round(float(s[143])) ; vhs[i].k.ClassStat = float(s[144]) ; vhs[i].k.ppErrBits = round(float(s[145])) ; vhs[i].k.SeqNum = round(float(s[146])) ; vhs[i].k.Xi = float(s[147]) ; vhs[i].k.Eta = float(s[148]) i++ endwhile close, idIn free_lun, idIn return, vhs end