def compute_hourangle(date, obsvr_long, obsvr_lat, obsvr_hgt, mean_ra, mean_dec, dbg=False): mjd_tdb = datetime2mjd_tdb(date, obsvr_long, obsvr_lat, obsvr_hgt, False) # Compute MJD_UTC mjd_utc = datetime2mjd_utc(date) # Compute UT1-UTC dut = ut1_minus_utc(mjd_utc) # Compute local apparent sidereal time # Do GMST first which takes UT1 and then add East longitude and the equation of the equinoxes # (which takes TDB) # gmst = S.sla_gmst(mjd_utc+(dut/86400.0)) stl = gmst + obsvr_long + S.sla_eqeqx(mjd_tdb) logger.debug('GMST, LAST, EQEQX, GAST, long= %.17f %.17f %E %.17f %.17f' % (gmst, stl, S.sla_eqeqx(mjd_tdb), gmst+S.sla_eqeqx(mjd_tdb), obsvr_long)) (app_ra, app_dec) = S.sla_map(mean_ra, mean_dec, 0.0, 0.0, 0.0, 0.0, 2000.0, mjd_tdb) (ra_str, dec_str) = radec2strings(app_ra, app_dec) logger.debug("%f %f %s %s" % (app_ra, app_dec, ra_str, dec_str)) hour_angle = stl - app_ra logger.debug(hour_angle) hour_angle = S.sla_drange(hour_angle) logger.debug(hour_angle) return hour_angle
def radec_to_azza(ra, dec, MJD, fctr=350.0, atm=1010.0, temp=283.0, humid=0.5, scope='GBT'): """ redec_to_azza(ra, dec, MJD): Return AZ and ZA (in deg) from RA and DEC (J2000 in deg) at MJD. Keyword params are fctr=350.0, atm=1010.0, temp=283.0, humid=0.5, scope='GBT'. """ scope, x, lon, lat, hgt = s.sla_obs(0, scope) microns = 3e8/(fctr*1e6)*1e6 app_rarad, app_decrad = s.sla_map(ra*DEGTORAD,dec*DEGTORAD,0.0,0.0,0.0,0.0,2000.0,MJD) az, za, hob, rob, dob = s.sla_aop(app_rarad,app_decrad,MJD, 0.0,-lon,lat,hgt,0.0,0.0,temp,atm,humid,microns,0.0065) az = s.sla_dranrm(az) return az*RADTODEG, za*RADTODEG
def radec_to_azza(ra, dec, MJD, fctr=350.0, atm=1010.0, temp=283.0, humid=0.5, scope='GBT'): """ redec_to_azza(ra, dec, MJD): Return AZ and ZA (in deg) from RA and DEC (J2000 in deg) at MJD. Keyword params are fctr=350.0, atm=1010.0, temp=283.0, humid=0.5, scope='GBT'. """ scope, x, lon, lat, hgt = s.sla_obs(0, scope) microns = 3e8 / (fctr * 1e6) * 1e6 app_rarad, app_decrad = s.sla_map(ra * DEGTORAD, dec * DEGTORAD, 0.0, 0.0, 0.0, 0.0, 2000.0, MJD) az, za, hob, rob, dob = s.sla_aop(app_rarad, app_decrad, MJD, 0.0, -lon, lat, hgt, 0.0, 0.0, temp, atm, humid, microns, 0.0065) az = s.sla_dranrm(az) return az * RADTODEG, za * RADTODEG