{"id":25973467,"url":"https://github.com/obrl-soil/em38","last_synced_at":"2025-09-20T08:22:46.297Z","repository":{"id":45387571,"uuid":"132758232","full_name":"obrl-soil/em38","owner":"obrl-soil","description":"decode n38 binary logfiles in R ","archived":false,"fork":false,"pushed_at":"2023-09-24T10:26:06.000Z","size":4294,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T16:51:44.619Z","etag":null,"topics":["data-logger","decode","em38","gps","r"],"latest_commit_sha":null,"homepage":"https://obrl-soil.github.io/em38/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obrl-soil.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-09T13:06:39.000Z","updated_at":"2022-02-02T04:39:26.000Z","dependencies_parsed_at":"2023-02-04T16:30:49.059Z","dependency_job_id":null,"html_url":"https://github.com/obrl-soil/em38","commit_stats":{"total_commits":67,"total_committers":3,"mean_commits":"22.333333333333332","dds":"0.19402985074626866","last_synced_commit":"d0ab59bbfafb9b1228eebceaa3929ed0c8d4fb80"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/obrl-soil/em38","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obrl-soil%2Fem38","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obrl-soil%2Fem38/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obrl-soil%2Fem38/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obrl-soil%2Fem38/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obrl-soil","download_url":"https://codeload.github.com/obrl-soil/em38/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obrl-soil%2Fem38/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064886,"owners_count":25579123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["data-logger","decode","em38","gps","r"],"created_at":"2025-03-05T01:29:43.160Z","updated_at":"2025-09-20T08:22:46.257Z","avatar_url":"https://github.com/obrl-soil.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: gfm\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n[![R build status](https://github.com/obrl-soil/em38/workflows/R-CMD-check/badge.svg)](https://github.com/obrl-soil/em38/actions)\n[![R build status](https://github.com/obrl-soil/em38/workflows/test-coverage/badge.svg)](https://github.com/obrl-soil/em38/actions)\n[![R build status](https://github.com/obrl-soil/em38/workflows/pkgdown/badge.svg)](https://github.com/obrl-soil/em38/actions)\n[![Coverage status](https://codecov.io/gh/obrl-soil/em38/branch/master/graph/badge.svg)](https://codecov.io/github/obrl-soil/em38?branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# em38\n\nem38 translates \\*.n38 binary files generated by the [Geonics EM38-MKII ground conductivity meter](http://geonics.com/html/em38.html), commonly used in soil research and precision agriculture. EM38-MKII devices are supported by an official translation app called DAT38MK2, but this lacks a command-line interface and is not easy to use in a reproducible workflow. \n\n## Installation\n\nInstall from github with\n\n```{r 'installation', eval = FALSE}\nlibrary(devtools)\ninstall_github(\"obrl-soil/em38\")\n```\n\nThis package is in early development phase. Improving its reliability requires access to a wide variety of test datasets, so if you have an \\*.n38 file that fails to decode correctly, please consider sending it to me. I have been able to test decoding on around 50 sample files from two different EM38-MKII devices, but could always use more. The device and its logger have a large number of possible setting combinations, and I have not seen all of them. Additionally, a third-party GPS needs to be attached to the device and its data-logger, and GPS output data are notoriously variable by brand and model.\n\n## Usage\n\nem38 is accompanied by a demo dataset gathered during a training exercise:\n\n```{r 'example', message=FALSE, results = 'hold'}\nlibrary(em38)\n\n# all-in-one wrapper function:\ndemo_survey  \u003c- em38_from_file(path = system.file(\"extdata\", \"em38_demo.n38\", \n                                                  package = \"em38\"),\n                               hdop_filter = 3)\n\n\n# Plot spatialised output of survey line 1 (calibrated conductivity for coil\n# separation 0.5m)\nsl1 \u003c- demo_survey$survey_lines[[1]]\nplot(sl1[sl1$mode == 'Vertical', 'cond_05'], pch = 20, \n     main = 'Conductivity, Vertical Dipole Mode, Coil Separation 0.5m')\n```\n\nIts surprisingly difficult to walk in a straight line across a paddock :no_mouth:\n\nIf you want to look at the intermediate data more closely,\n\n```{r 'longwayround'}\n# import binary file as raw() type matrix\nn38_mat     \u003c- n38_import(system.file(\"extdata\", \"em38_demo.n38\", package = \"em38\"))\n# break matrix into sections according to file spec \nn38_chunks  \u003c- n38_chunk(n38_mat)\n# decode matrix chunks into useable data\nn38_decoded \u003c- n38_decode(n38_chunks)\n```\n\nYou can also create the equivalent of an \\*.M38 text file, for comparison.\n\n```{r ytho, eval = FALSE}\nm38_example \u003c- n38_to_m38(n38_decoded)\n# write to file as e.g.\n#  write(m38_example, paste0('m38_from_R_', Sys.Date(), '.m38'))\n```\n\n***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobrl-soil%2Fem38","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobrl-soil%2Fem38","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobrl-soil%2Fem38/lists"}