def getBarray(pointing, time, position, height_array): az, el = PosTools.getAzEl(pointing, time, position) lonlat = PosTools.getLonLatStation(az, el, pos=position) los_dir = [lonlat['m0']['value'], lonlat['m1']['value']] lat = los_dir[1] lon = los_dir[0] itrfdir = [ np.cos(lat) * np.cos(lon), np.cos(lat) * np.sin(lon), np.sin(lat) ] pp, am = PosTools.getPPsimpleAngle(height=height_array, mPosition=position, direction=itrfdir) year, month, day, myfrac = PosTools.obtain_observation_year_month_day_fraction( time) dayofyear = date(year, month, day).timetuple().tm_yday emm = EMM.WMM(date=year + float(dayofyear) / 365.) BField = emm.getProjectedFieldArray(np.degrees(pp[:, 0]), np.degrees(pp[:, 1]), pp[:, 2] / 1e3, los_dir) return pp, am, BField
def getPParray(pointing, time, position, height_array): az, el = PosTools.getAzEl(pointing, time, position) lonlat = PosTools.getLonLatStation(az, el, pos=position) los_dir = [lonlat['m0']['value'], lonlat['m1']['value']] lat = los_dir[1] lon = los_dir[0] itrfdir = [ np.cos(lat) * np.cos(lon), np.cos(lat) * np.sin(lon), np.sin(lat) ] pp, am = PosTools.getPPsimpleAngle(height=height_array, mPosition=position, direction=itrfdir) return pp, am
def getBarray(pointing,time,position,height_array): az,el = PosTools.getAzEl(pointing,time,position) lonlat=PosTools.getLonLatStation(az,el,pos=position) los_dir=[lonlat['m0']['value'],lonlat['m1']['value']] lat=los_dir[1] lon=los_dir[0] itrfdir=[np.cos(lat)*np.cos(lon),np.cos(lat)*np.sin(lon),np.sin(lat)] pp,am=PosTools.getPPsimpleAngle(height=height_array,mPosition=position,direction=itrfdir) year, month, day, myfrac = PosTools.obtain_observation_year_month_day_fraction(time) dayofyear = date(year,month,day).timetuple().tm_yday emm=EMM.WMM(date=year+float(dayofyear)/365.) BField=emm.getProjectedFieldArray(np.degrees(pp[:,0]),np.degrees(pp[:,1]),pp[:,2]/1e3,los_dir) return pp,am,BField