ET-NCMP / NCMP

Software in R for calculating National Climate Monitoring Products
5 stars 1 forks source link

Short time series #10

Open ET-NCMP opened 7 years ago

ET-NCMP commented 7 years ago

There are assumptions built into the station calculations (P2_Indices) that all stations have all 30 years of the user-defined reference period. The implications for the NCMP indices are:

ET-NCMP commented 7 years ago

The code, fails if stations have nothing but missing data for a variable (e.g. all precipitation values for all dates are missing) with the following error message:

Error in check.var(tmax, tmax.dates, "tmax") : tmax must be of type numeric.

Error in check.var(prec, prec.dates, "prec") : prec must be of type numeric.

The code also fails if a station record ends (or starts, I think) during the climatology period with the following error message:

Error in validObject(.Object) : invalid class "climdexInput" object: 1: Quantiles for tmax are missing. invalid class "climdexInput" object: 2: Quantiles for tmin are missing. invalid class "climdexInput" object: 3: Quantiles for prec are missing.

It looks like we need to add some checks to the QC script to ensure that stations have a complete record through the climatology period and flag those that don't.

AND

Add a check to the index calculation (and subsequent calculations) to ensure that stations which are missing all their data don't cause an error. We still want some of these stations because we can still use stations that have just precip but no temperature data.