Use argo_read_prof_*() functions to extract profile information from a previously-downloaded Argo NetCDF file.

argo_read_prof_levels(file, vars = NULL, quiet = FALSE)

argo_read_prof_prof(file, vars = NULL, quiet = FALSE)

argo_read_prof_calib(file, vars = NULL, quiet = FALSE)

argo_read_prof_param(file, vars = NULL, quiet = FALSE)

argo_read_prof_history(file, vars = NULL, quiet = FALSE)

argo_read_prof_spectra(file, vars = NULL, quiet = FALSE)

Arguments

file

A previously downloaded Argo NetCDF file (e.g., using argo_download()).

vars

A vector of variable names to include. Explicitly specifying vars can lead to much faster read times when reading many files.

quiet

Use FALSE to stop for malformed files, NA to silently warn for malformed files, or TRUE to silently ignore read errors when possible.

Value

A tibble::tibble() with

  • argo_read_prof_levels(): one row per profile per sampling level.

  • argo_read_prof_prof(): one row per profile.

  • argo_read_prof_calib(): one row per profile per calibration per parameter.

  • argo_read_prof_param(): one row per profile per parameter.

  • argo_read_prof_history(): one row per profile per history entry.

  • argo_read_prof_spectra(): one row per profile per sampling level per spectra value.

Examples

prof_file <- system.file(
  "cache-test/dac/csio/2900313/profiles/D2900313_000.nc",
  package = "argodata"
)

argo_read_prof_levels(prof_file)
#> # A tibble: 70 × 17
#>    N_LEVELS N_PROF   PRES PRES_QC PRES_ADJUSTED PRES_ADJUSTED_QC
#>  *    <int>  <int>  <dbl> <chr>           <dbl> <chr>           
#>  1        1      1   9.80 1                9.80 1               
#>  2        2      1  20.1  1               20.1  1               
#>  3        3      1  29.9  1               29.9  1               
#>  4        4      1  39.7  1               39.7  1               
#>  5        5      1  49.9  1               49.9  1               
#>  6        6      1  60.3  1               60.3  1               
#>  7        7      1  69.7  1               69.7  1               
#>  8        8      1  80.3  1               80.3  1               
#>  9        9      1  90.2  1               90.2  1               
#> 10       10      1 100.   1              100.   1               
#> # … with 60 more rows, and 11 more variables: PRES_ADJUSTED_ERROR <dbl>,
#> #   TEMP <dbl>, TEMP_QC <chr>, TEMP_ADJUSTED <dbl>, TEMP_ADJUSTED_QC <chr>,
#> #   TEMP_ADJUSTED_ERROR <dbl>, PSAL <dbl>, PSAL_QC <chr>, PSAL_ADJUSTED <dbl>,
#> #   PSAL_ADJUSTED_QC <chr>, PSAL_ADJUSTED_ERROR <dbl>
argo_read_prof_prof(prof_file)
#> # A tibble: 1 × 26
#>   N_PROF PLATFORM_NUMBER PLATFORM_TYPE   PROJECT_NAME    PI_NAME    CYCLE_NUMBER
#> *  <int> <chr>           <chr>           <chr>           <chr>             <dbl>
#> 1      1 2900313         "PROVOR       … "CHINA ARGO PR… "JIANPING…            0
#> # … with 20 more variables: DIRECTION <chr>, DATA_CENTRE <chr>,
#> #   DC_REFERENCE <chr>, DATA_STATE_INDICATOR <chr>, DATA_MODE <chr>,
#> #   FLOAT_SERIAL_NO <chr>, FIRMWARE_VERSION <chr>, WMO_INST_TYPE <chr>,
#> #   JULD <dbl>, JULD_QC <chr>, JULD_LOCATION <dbl>, LATITUDE <dbl>,
#> #   LONGITUDE <dbl>, POSITION_QC <chr>, POSITIONING_SYSTEM <chr>,
#> #   PROFILE_PRES_QC <chr>, PROFILE_TEMP_QC <chr>, PROFILE_PSAL_QC <chr>,
#> #   VERTICAL_SAMPLING_SCHEME <chr>, CONFIG_MISSION_NUMBER <dbl>
argo_read_prof_calib(prof_file)
#> # A tibble: 3 × 8
#>   N_PARAM N_CALIB N_PROF PARAMETER          SCIENTIFIC_CALIB_… SCIENTIFIC_CALIB…
#> *   <int>   <int>  <int> <chr>              <chr>              <chr>            
#> 1       1       1      1 "PRES            " "none            … "none           …
#> 2       2       1      1 "TEMP            " "none            … "none           …
#> 3       3       1      1 "PSAL            " "PSAL_ADJUSTED = … "WJO: r =0.9999(…
#> # … with 2 more variables: SCIENTIFIC_CALIB_COMMENT <chr>,
#> #   SCIENTIFIC_CALIB_DATE <chr>
argo_read_prof_param(prof_file)
#> # A tibble: 3 × 3
#>   N_PARAM N_PROF STATION_PARAMETERS
#> *   <int>  <int> <chr>             
#> 1       1      1 "PRES            "
#> 2       2      1 "TEMP            "
#> 3       3      1 "PSAL            "
argo_read_prof_history(prof_file)
#> # A tibble: 3 × 14
#>   N_PROF N_HISTORY HISTORY_INSTITUTION HISTORY_STEP HISTORY_SOFTWARE
#> *  <int>     <int> <chr>               <chr>        <chr>           
#> 1      1         1 "HZ  "              ARGQ         "    "          
#> 2      1         2 "HZ  "              ARGQ         "    "          
#> 3      1         3 "HZ  "              ARSQ         "WJO "          
#> # … with 9 more variables: HISTORY_SOFTWARE_RELEASE <chr>,
#> #   HISTORY_REFERENCE <chr>, HISTORY_DATE <chr>, HISTORY_ACTION <chr>,
#> #   HISTORY_PARAMETER <chr>, HISTORY_START_PRES <dbl>, HISTORY_STOP_PRES <dbl>,
#> #   HISTORY_PREVIOUS_VALUE <dbl>, HISTORY_QCTEST <chr>

bgc_file <- system.file(
  "cache-test/dac/aoml/5906206/profiles/BD5906206_016.nc",
  package = "argodata"
)
argo_read_prof_spectra(bgc_file)
#> # A tibble: 40,590 × 4
#>    N_VALUES41 N_LEVELS N_PROF UV_INTENSITY_NITRATE
#>  *      <int>    <int>  <int>                <dbl>
#>  1          1        1      1                   NA
#>  2          2        1      1                   NA
#>  3          3        1      1                   NA
#>  4          4        1      1                   NA
#>  5          5        1      1                   NA
#>  6          6        1      1                   NA
#>  7          7        1      1                   NA
#>  8          8        1      1                   NA
#>  9          9        1      1                   NA
#> 10         10        1      1                   NA
#> # … with 40,580 more rows