ra2, dec2 = GLOBALutils.getcoords(obname, mjd, filen=reffile) if ra2 != 0 and dec2 != 0: ra = ra2 dec = dec2 else: print '\t\tUsing the coordinates found in the image header.' iers = GLOBALutils.JPLiers(baryc_dir, mjd - 999.0, mjd + 999.0) obsradius, R0 = GLOBALutils.JPLR0(latitude, altitude) obpos = GLOBALutils.obspos(longitude, obsradius, R0) jplephem.set_ephemeris_dir(baryc_dir, ephemeris) jplephem.set_observer_coordinates(obpos[0], obpos[1], obpos[2]) res = jplephem.doppler_fraction(ra / 15.0, dec, int(mjd), mjd % 1, 1, 0.0) lbary_ltopo = 1.0 + res['frac'][0] bcvel_baryc = (lbary_ltopo - 1.0) * 2.99792458E5 print "\t\tBarycentric velocity:", bcvel_baryc res = jplephem.pulse_delay(ra / 15.0, dec, int(mjd), mjd % 1, 1, 0.0) mbjd = mjd + res['delay'][0] / (3600.0 * 24.0) # Moon Phase Calculations gobs = ephem.Observer() gobs.name = 'Clay_Mag_2' gobs.lat = rad(latitude) # lat/long in decimal degrees gobs.long = rad(longitude) DDATE = h[ih].header['UT-DATE'] HHOUR = mikeutils.get_hour(float(h[ih].header['UT-TIME']))
# set observatory parameters altitude = float(h[0].header['ESO TEL GEOELEV']) latitude = float(h[0].header['ESO TEL GEOLAT']) longitude = float(h[0].header['ESO TEL GEOLON']) epoch = 2000. iers = GLOBALutils.JPLiers(baryc_dir, mjd - 999.0, mjd + 999.0) obsradius, R0 = GLOBALutils.JPLR0(latitude, altitude) obpos = GLOBALutils.obspos(longitude, obsradius, R0) jplephem.set_ephemeris_dir(baryc_dir, ephemeris) jplephem.set_observer_coordinates(float(obpos[0]), float(obpos[1]), float(obpos[2])) res = jplephem.doppler_fraction(float(ra / 15.0), float(dec), long(mjd), float(mjd % 1), 1, 0.0) lbary_ltopo = 1.0 + res['frac'][0] bcvel_baryc = (lbary_ltopo - 1.0) * 2.99792458E5 print "\t\tBarycentric velocity:", bcvel_baryc res = jplephem.pulse_delay(ra / 15.0, dec, int(mjd), mjd % 1, 1, 0.0) mbjd = mjd + res['delay'][0] / (3600.0 * 24.0) # Moon Phase Calculations gobs = ephem.Observer() gobs.name = 'VLT' gobs.lat = rad(latitude) # lat/long in decimal degrees gobs.long = rad(longitude) gobs.date = h[0].header['DATE-OBS'].replace('T', ' ') mephem = ephem.Moon()
scmjd,scmjd0 = vbtutils.mjd_fromheader(hd) ra2,dec2 = GLOBALutils.getcoords(obname,scmjd,filen=reffile) if ra2 !=0 and dec2 != 0: RA = ra2 DEC = dec2 else: print '\t\tUsing the coordinates found in the image header.' # set info for compute the baricentric correction iers = GLOBALutils.JPLiers( baryc_dir, scmjd-999.0, scmjd+999.0 ) obsradius, R0 = GLOBALutils.JPLR0( latitude, altitude) obpos = GLOBALutils.obspos( longitude, obsradius, R0 ) jplephem.set_ephemeris_dir( baryc_dir , ephemeris ) jplephem.set_observer_coordinates( obpos[0], obpos[1], obpos[2] ) res = jplephem.doppler_fraction(RA/15.0, DEC, int(scmjd), scmjd%1, 1, 0.0) lbary_ltopo = 1.0 + res['frac'][0] bcvel_baryc = ( lbary_ltopo - 1.0 ) * 2.99792458E5 #This in the barycentric velocity res = jplephem.pulse_delay(RA/15.0, DEC, int(scmjd), scmjd%1, 1, 0.0) scmbjd = scmjd + res['delay'][0] / (3600.0 * 24.0) #This is the modified barycentric julian day of the observation # set observatory info to retrive info about the moon gobs = ephem.Observer() gobs.name = 'VBT' gobs.lat = rad(latitude) gobs.long = rad(longitude) #gobs.date = hd['UT-DATE'] + ' ' + hd['UT-TIME'].replace(':','_') gobs.date = hd['DATE-OBS'].replace('T',' ') mephem = ephem.Moon() mephem.compute(gobs)