TEXTURE-DEPENDENT BIAS IN A EUROPEAN VIS-NIR MAP OF POM AND MAOM CARBON
Code and stored summaries

FILES
  texture_bias_analysis.py   Python 3 (NumPy, pandas). Reads the ESDAC files, runs every
                             analysis in the paper, writes summary tables to analysis/.
                             About 3 minutes on a laptop.
  make_figure_and_table.R    Base R. Draws Figure 1 on screen and saves it to
                             R_output/Figure1.png (600 dpi), and writes R_output/Table1.csv.
                             Needs only the files in analysis/.
  analysis/                  Stored summaries (no value for a single sample):
    overall.csv                    accuracy and the measured-on-predicted regression
    texture_terms.csv              sand and clay terms with cell and country bootstrap intervals
    bias_by_texture_and_quintile.csv  bias by texture class within quintiles of the prediction
    calibration_by_texture.csv     Figure 1a
    residual_by_sand.csv           Figure 1b
    accuracy_by_texture.csv        Table 1 (published and texture-corrected)
    correction_coefficients.csv    the texture correction fitted to all points
    bias_by_latitude_band.csv      bias by texture north and south of 52 N
    recovery_by_texture.csv        fractionation recovery, cropland and grassland samples

INPUT DATA (not distributed; ESDAC license)
  Put these in ../04_DATA_DO_NOT_REDISTRIBUTE/ (on the author computer they are in
  Desktop\MS2\SC_TEXTURE_BIAS\04_DATA_DO_NOT_REDISTRIBUTE):
  VNIRSOCfractions.csv         Soil Carbon Risk Index dataset (ESDAC), predicted POM C, MAOM C,
                               their sum, clay, silt, sand, coordinates
  lucas2009_consolidated.csv   LUCAS 2009 topsoil data with POINT_ID and measured OC
                               ('|' separated)
  fraction_samples.csv         SOM fractions dataset (ESDAC): POINT_ID, LU, clay, silt, sand,
                               OC, OC_pom_g_kg, OC_sc_g_kg for the 330 fractionated samples
  The script joins predictions and measurements by POINT_ID and stops unless it finds
  6,399 points and no overlap with the fractionated samples.
