emf-creaf / meteoland

Functions to estimate weather variables at any position of a landscape
https://emf-creaf.github.io/meteoland/
10 stars 4 forks source link

Completing output of interpolation_data #20

Open miquelcaceres opened 1 year ago

miquelcaceres commented 1 year ago

Function meteo_complete can be applied to weather data in form of an sf object, but not to the output of interpolation_data, making it difficult to fill missing values (e.g. relative humidity) due to missing data in the interpolator. An option could be added to function interpolation_data() to try completing the result after interpolation.

MalditoBarbudo commented 1 year ago

@miquelcaceres I don't understand the need of complete the weather data after the interpolation. If you complete the weather data before creating the interpolator, the interpolated data will not have missing values. I think this should be the default workflow for most use-cases

  1. retrieve meteo from stations (with meteospain, worldmet...)
  2. complete meteo
  3. create interpolator
  4. interpolate data

In any case, in other use-cases when is really needed to complete the interpolated data, then the process would be

  1. interpolate data
  2. unnest (as in the vignette)
  3. complete the unnested meteo

I can add a logic in complete_meteo that detects if weather data provided to complete_meteo comes from interpolate_data and then perform steps 2 and 3 automatically. This won't be complicated to implement and can be useful for those other use cases, but I still think that all of this can be avoided if weather data is completed before interpolation.