
% Evaluate field model at particular location

a   = 6371.2*10^3;                     % [m] - Earth radius                         
c   = 3480*10^3;                       % [m] - Core radius
%==========================================================================
% Get field model
t_plot  = (2016.5-2000)*365.25;                 % time in mjd
t_plot2  = (2017.1-2000)*365.25;                 % time in mjd
t_0_new = [t_plot; t_plot2];
load('CHAOS-6-x2.mat')  % load field model
N_deg      = 13;                                % spcecify to which degree 
pp_N       = pp;
pp_N.dim   = N_deg*(N_deg+2);
coefs_tmp  = reshape(pp.coefs, [], pp.pieces, pp.order);
pp_N.coefs = reshape(coefs_tmp(1:N_deg*(N_deg+2),:,:), [], pp.order); 
%==========================================================================
% Point of interest
lat = % insert HOV latitude
lon = % insert HOV longitude
r_c    = a;        % radius
t_c    = 90- lat;   %[deg] - co-latitude
p_c    = lon;       % [deg] -longitude
B_core = synth_values(r_c./(10^3),t_c,p_c,pp_N,t_0_new) % [nT] (Br,B_theta,B_phi)
%==========================================================================

