root = '/data/LP/' dirObj = root+'targets/' dirEph = root+'ephems/' dirDAMIT = '/astrodata/Catalog/shape_models/asteroids/' readcol, dirObj+'targets.csv', delimiter=',', num, name, run, format='(I,A,A)',/Silent name=strTrim(name,2) run =strTrim(run,2) runA=where( strCmp(run,'A'), nbA ) runB=where( strCmp(run,'B'), nbB ) runC=where( strCmp(run,'C'), nbC ) runD=where( strCmp(run,'D'), nbD ) ; print, nbA, nbB, nbC, nbD dates= [ ['2017-03-31', '2017-10-01'], $ ; dates= [ ['2017-03-31', '2017-04-02'], $ ;-test ['2017-09-30', '2018-04-01'], $ ['2018-03-31', '2018-10-01'], $ ['2018-09-30', '2019-04-01'] ] step = 10. ; minutes stepDay = string(step/(60.*24),format='(D10.8)') cur='A' case cur of 'A': begin nbSSO=nbA runId=runA dates = dates[*,0] end 'B': begin nbSSO=nbB runId=runB dates = dates[*,1] end 'C': begin nbSSO=nbC runId=runC dates = dates[*,2] end 'D': begin nbSSO=nbD runId=runD dates = dates[*,3] end endcase JD1 = date_conv(dates[0],'Julian') JD2 = date_conv(dates[1],'Julian') nbStep = ( JD2-JD1 )/stepDay+1 print, nbStep for kSSO=0, nbSSO-1 do begin locName =name[runId[kSSO]] locNum = num[runId[kSSO]] print, kSSO+1, locNum, locName, format='(I2,2x,I4,1x,A-15)' dir3D = dirDAMIT+locName+'/' spawn, 'ls '+dir3D, res, err if strCmp(err,'') then begin spin = readSpin( dir3D+'1/spin.dat' ) eph = replicate( {iso:'',jd:0.d, lon:0., lat:0. }, nbStep ) sun = voMiriade_callEphemCC( 'Sun', JD1, rPlane=1, type='planet', obs='309', $ tCoor=3, nbd=nbStep, step=stepDay ) geo = voMiriade_callEphemCC( locName, JD1, rPlane=2, type='aster', obs='309', $ tCoor=2, nbd=nbStep, step=stepDay ) loc = voMiriade_callEphemCC( locName, JD1, rPlane=1, type='aster', obs='309', $ tCoor=5, nbd=nbStep, step=stepDay ) am=float(loc.am+'0') for kStep=0L, nbStep-1 do begin jd = JD1 + kStep*float(stepDay) vec = -[geo[kStep].x,geo[kStep].y,geo[kStep].z] sep = subObserver_coord( vec, spin, JD ) eph[kStep].jd = jd eph[kStep].iso = date_conv( jd, 'FITS' ) eph[kStep].lon = sep.lon eph[kStep].lat = sep.lat endfor forprint, eph.jd, eph.iso, eph.lon, eph.lat, $ sun.el.dec, am, $ format='(D16.8,",",A-22,",",F6.2,",",F6.2,",",F6.2,",",F6.3)', $ textout=dirEph+cur+'/'+locName+'.csv', /Silent, $ comment='JD, ISO, Longitude, Latitude, Sun, AM' ; stop endif endfor end