{"id":37319943,"url":"https://github.com/csiro/soilspec.format","last_synced_at":"2026-01-16T03:16:52.174Z","repository":{"id":322365814,"uuid":"1067651416","full_name":"csiro/soilspec.format","owner":"csiro","description":"A package for extracting R data frames and metadata from soil spectroscopy files.","archived":false,"fork":false,"pushed_at":"2025-11-26T00:07:55.000Z","size":847,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-29T03:50:51.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-01T07:17:38.000Z","updated_at":"2025-11-26T00:07:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/csiro/soilspec.format","commit_stats":null,"previous_names":["csiro/soilspec.format"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/csiro/soilspec.format","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fsoilspec.format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fsoilspec.format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fsoilspec.format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fsoilspec.format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csiro","download_url":"https://codeload.github.com/csiro/soilspec.format/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fsoilspec.format/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T03:16:52.111Z","updated_at":"2026-01-16T03:16:52.166Z","avatar_url":"https://github.com/csiro.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![pkg-test](https://github.com/csiro/soilspec.format/actions/workflows/test.yml/badge.svg)](https://github.com/csiro/soilspec.format/actions/workflows/test.yml) [![CodeQL](https://github.com/csiro/soilspec.format/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/csiro/soilspec.format/actions/workflows/github-code-scanning/codeql)\n\n# Overview\nsoilspec.format is a package for extracting data frames and\nmetadata lists from soil spectra of various formats, currently:\n\n* Nicolet (.spa)\n* Bruker Opus Binary (.0)\n* Thermo (.spc)\n* ASD (.asd)\n* ASD SCO (.sco)\n* Perkin Elmer (.sp) [PEPE and PE IR magic numbers]\n* Hone Lab Red (.hlr)\n* Hone Lab Red Reduced (.hlrr)\n* Spectral Evolution (.sed)\n* CSIRO SCANS (.scan)\n* CSV (.csv)\n\nThe extracted data frames will always have the columns: \"wavenumber\" and \"intensity\".\n\n# Install\n\n\t# need devtools and Rcpp packages\n\tinstall.packages(c(\"devtools\", \"Rcpp\"))\n\t \n\t# need opusreader and opusreader2 packages\n\tdevtools::install_github(\"pierreroudier/opusreader\")\n\tdevtools::install_github(\"spectral-cockpit/opusreader2\")\n\n\t# install package from GitHub\n\tdevtools::install_github(\"csiro/soilspec.format\")\n\n  Under Windows, you will also need to install [Rtools](https://cran.r-project.org/bin/windows/Rtools)\n  to match your R version.\n\n# Example Usage\n```\n\u003e library(soilspec.format)\n\n\u003e path \u003c- asd.binary.file.path()\n\n\u003e result \u003c- read.soilspec(path)\n\n\u003e names(result)\n [1] \"status\"                  \"mode\"   \"is.absorbance\" \"is.reflectance\" \"is.transmittance\"       \n [6] \"is.descending\"           \"origin\" \"type\"          \"data\"           \"standardised.metadata\"  \n[11] \"all.instrument.metadata\"   \n\n\u003e result$status\n[1] 0\n\n\u003e result$is.descending\n[1] FALSE\n\n\u003e result$is.reflectance\n[1] TRUE\n\n\u003e result$mode\n[1] \"reflectance\"\n\n\u003e head(result$data)\n  wavenumber  intensity\n1        350 0.05432920\n2        351 0.04792801\n3        352 0.05130503\n4        353 0.05339854\n5        354 0.04970677\n6        355 0.05435767\n\n\u003e plot(result$data, type=\"l\")\n```\n\n\u003cimg src=\"https://github.com/csiro/soilspec.format/blob/main/assets/asd_example_plot.png\" alt=\"ASD spectrum plot\" width=\"800\"/\u003e\n\n```\n\u003e result$standardised.metadata\n$sample_id\n[1] \"\"\n\n$spectra_id\n[1] \"\"\n\n$spectra_source_file_name\n[1] \"example.asd\"\n\n$date_time\n[1] \"2017-06-21 10:33:49 ACST\"\n\n$response\n[1] \"reflectance\"\n\n$instrument_technology_type\n[1] \"visNIR\"\n\n$instrument_manufacturer\n[1] \"ASD\"\n\n$instrument\n[1] \"FieldSpec FR\"\n\n...\n\n$bulb\n[1] 0\n\n$swir1_gain\n[1] 569\n\n$swir2_gain\n[1] 1160\n\n$swir1_offset\n[1] 2180\n\n$swir2_offset\n[1] 2415\n\n$splice1_wavelength\n[1] 1000\n\n$splice2_wavelength\n[1] 1830\n\n\u003e result$all.instrument.metadata\n$co\n[1] \"as7\"\n\n$comments\n[1] \"\"\n\n$when\n[1] \"2017-06-20 19:04:47 ACST\"\n\n$program_version\n[1] \"6.0\"\n\n$file_version\n[1] \"7.0\"\n\n$dc_corr\n[1] TRUE\n...\n```\n\n# Developers\n## Install\nInstead of using `devtools::install_github()` to install `soilspec.format` for\ndevelopment purposes, use this command to install the package:\n  \n  `devtools::install()`\n\n## Test\nTo run unit tests use this command:\n\n  `devtools::test()`\n\n## Add Support for a New Format\n* Create a sub-class of `SpectrumFormat` (see `spectrum_format.R`) in the `R`\n  directory.\n  * Look at `R/*_format.R` files for examples.\n\n* Near the top of `R/read_soilspec.R` add a mapping from a file suffix to\n  an instance of the new ``SpectrumFormat` sub-class, e.g.\n\n  `soilspec.readers[[\".asd\"]] \u003c- ASDBinary$new()`\n\n* Create a format-specific reader function in `R/read_soilspec.R` by starting\n  with an example, e.g. `read.bruker.opus.binary`\n\n* Add an example file in a sub-directory under `inst/extdata` named to reflect\n  the file format. The file should start with `example` and end in the\n  suffix used for files of the format. In fact, it doesn't matter what the prefix\n  of the file is but the suffix does matter (unlike the empty file referred to in\n  a step below). Ensure there are no IP concerns with making the file available\n  in the library.\n\n* Create a file path function in `R/file_paths.R` to access this file. This\n  function can be used for testing and by users of the library.\n\n* Add an empty file in `inst/extdata/Unknown` that starts with `example` and ends in the\n  suffix associated with the format. This will be used with `common_read_test` (see below).\n\n* In `tests/testthat/test_read_soilspec.R`, add a test case for the new format above the lines:\n~~~\n     #######################################\n     # Add tests for new formats above ^^^ #\n     #######################################\n~~~\n* See examples above those lines for other format reader tests that\n  call `common_read_test`.\n\n* Add a unit test for the sub-class of `SpectrumFormat` in a new file \n  under `tests/testthat`. Look at other format-specific test files\n  there to get started, e.g. `test_bruker_opus_binary.R` or\n  `test_asd_sco_binary.R`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsiro%2Fsoilspec.format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsiro%2Fsoilspec.format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsiro%2Fsoilspec.format/lists"}