zhenyicun / 3DA_code

This is the code for the paper "An adaptive optimal interpolation based on analog forecasting: application to SSH in the Gulf of Mexico"
https://zenodo.org/record/3559784#.Xk0BIeko85l
3 stars 2 forks source link

Issues in code main_OI #4

Open qjuanr opened 3 years ago

qjuanr commented 3 years ago

Hello! After reading your code and paper in detail,we still have the following questions. Hope you can give us some answers: In lines 121 and 122 of the code main_OI:

`BH_tmp=find_BH(lon1[ix:ix+1]0,lat1[ix:ix+1]0,time_true[it_neighbor_tmp],lon_at_tmp0,lat_at_tmp0,time_at_tmp,s_spat,s_temp)

HBH_tmp=find_HBH(lon_at_tmp0,lat_at_tmp0,time_at_tmp,lon_at_tmp0,lat_at_tmp0,time_at_tmp,s_spat,s_temp)`

  1. Why the value of LON and LAT multiplied by 0 here, is it only considering the temporal factor but not considering the spatial factor?
  2. If we want to consider the spatial factor, how to modify the code?
  3. In line 122, why are parameters (1,4),(2,5) and(3,6)entered with the same value? 4.Do the calculation of space and time factors correspond to the interpretation of B[xi(T1), xj(T2)] in formula (11) in the paper?
zhenyicun commented 3 years ago

Hi qjuanr,

1,4: As you already noted, the line 121,122 correspond to Eq.(11) in the paper. Hence no spatial factor is considered. This is why the Lons and Lats are multiplied by 0.

3: I do not understand your question.

2: If you want to consider the spatial factor, you can for instance change Eq.(11) to $B_{ij}\exp(-d_x^2/L_x^2 - d_t^2/L_t^2)$, where $d_x$ is the geophysical distance between $x_i$ and $x_j$, $L_x$ is a new parameter similar to $L_t$.