dbAddCorrection_station_adlershof: Add corrections of 'station_adlershof' measurements

Description Usage Arguments Details Value See Also Examples

View source: R/db_write.R

Description

In general, use dbAddCorrection_station_adlershof to consistently add the corrected measurement values to station_adlershof_correction and to modify the quality flags in station_adlershof. dbWriteTable_station_adlershof_correction and dbUpdate_station_adlershof_qf_id do the respective single actions.

Usage

1
2
3
4
5
6
7
dbAddCorrection_station_adlershof(conn, stadl_id, qf_id, stadlcor_datetime,
  md_id, stadlcor_value)

dbUpdate_station_adlershof_qf_id(conn, stadl_id, qf_id)

dbWriteTable_station_adlershof_correction(conn, stadl_id, stadlcor_datetime,
  md_id, stadlcor_value)

Arguments

conn

Database connection.

stadl_id

Integer vector of station_adlershof ID.

qf_id

Integer vector with 1 <= qf_id <= 9 indicating value ok and qf_id >= 10 indicating value not ok.

stadlcor_datetime

POSIXct vector of corrected date and time of measurement.

md_id

Integer vector of measurand ID.

stadlcor_value

Numeric vector of corrected value of measurement.

Details

By design, qf_id with values >= 10 in station_adlershof indicates that entries in station_adlershof are corrected in station_adlershof_correction. Thus, dbAddCorrection_station_adlershof imposes the constraint qf_id >= 10. dbUpdate_station_adlershof_qf_id, on the other hand, allows general values of qf_id (further checks are done by the database).

Value

For performance reason, contrary to the meta data table functions, these functions do not return anything.

See Also

Other custom dbWriteTable functions: dbAddCorrection_station_patagonia, dbAdd_calibration_state, dbAdd_device_model, dbAdd_device, dbAdd_integration, dbAdd_measurand, dbAdd_physical_quantity, dbAdd_station_adlershof, dbAdd_station_patagonia, dbWriteTable_device_manufacturer, dbWriteTable_device_type, dbWriteTable_integration_type, dbWriteTable_person, dbWriteTable_quality_flag, dbWriteTable_site

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
con <- dbConnect_klimageo()
add all required entries before with the respective dbWriteTable_*
dbAddCorrection_station_adlershof(
  con,
  stadl_id = c(1,2),
  qf_id = c(11,11),
  stadlcor_datetime =
  as.POSIXct(c("2017-01-01 12:15:12", "2017-01-01 12:15:12"), tz = "UTC"),
  md_id = c(1,1),
  stadlcor_value = c(290.12, 289.23))
dbDisconnect(con)

## End(Not run)

sebschub/klimageodb documentation built on July 26, 2018, 2:32 a.m.