{"id":19288351,"url":"https://github.com/techascent/tech.netcdf","last_synced_at":"2025-04-22T04:33:19.934Z","repository":{"id":57714044,"uuid":"182434396","full_name":"techascent/tech.netcdf","owner":"techascent","description":"netcdf bindings into the techascent ecosystem","archived":false,"fork":false,"pushed_at":"2020-06-15T16:28:57.000Z","size":708,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-25T19:25:45.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techascent.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2019-04-20T17:21:50.000Z","updated_at":"2020-06-15T16:29:00.000Z","dependencies_parsed_at":"2022-09-26T21:31:11.862Z","dependency_job_id":null,"html_url":"https://github.com/techascent/tech.netcdf","commit_stats":null,"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftech.netcdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftech.netcdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftech.netcdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftech.netcdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techascent","download_url":"https://codeload.github.com/techascent/tech.netcdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888369,"owners_count":17220083,"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","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":"2024-11-09T22:08:46.888Z","updated_at":"2024-11-09T22:08:46.955Z","avatar_url":"https://github.com/techascent.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tech.netcdf\n\n[![Clojars Project](https://clojars.org/techascent/tech.netcdf/latest-version.svg)](https://clojars.org/techascent/tech.netcdf)\n\nnetcdf findings into the tech ecosystem.  Based on the netcdfAll library.\n\n\n[sample files](https://www.unidata.ucar.edu/software/netcdf/examples/files.html)\n\n\n## Usage\n\n```clojure\nuser\u003e (require '[tech.netcdf :as netcdf])\n:tech.resource.gc Reference thread starting\nnil\n;; The return value of fname-\u003enetcdf is tracked by the tech.resource resource's \n;; stack based system.\n;; When not repl-programming, use tech.resource/stack-resource-context to wrap\n;; access to the netcdf file.\nuser\u003e (def test-file (netcdf/fname-\u003enetcdf \"test/data/sresa1b_ncar_ccsm3-example.nc\"))\nSLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n#'user/test-file\n\n;; Get all the variable info; attributes, dimensions, everything\nuser\u003e (netcdf/variables test-file)\n{\"tas\"\n {:name \"tas\",\n  :dimensions\n  ({:name \"time\", :length 1, :shared? true, :unlimited? true, :variable-length? false}\n   {:name \"lat\",\n    :length 128,\n    :shared? true,\n    :unlimited? false,\n    :variable-length? false}\n   {:name \"lon\",\n    :length 256,\n    :shared? true,\n    :unlimited? false,\n    :variable-length? false}),\n  :attributes\n  {\"missing_value\"\n   {:name \"missing_value\",\n    :datatype :float,\n    :is-array? false,\n    :is-string? false,\n    :value 1.0E20}\n...\n\n;;Get an overview of what is going on.\nuser\u003e (netcdf/overview test-file)\n{\"tas\"\n {:name \"tas\",\n  :shape [1 128 256],\n  :data #\u003cDelay@66492386: :not-delivered\u003e,\n  :shape-names [\"time\" \"lat\" \"lon\"],\n  :fullname \"air_temperature\",\n  :units \"K\",\n  :missing-value 1.0E20},\n \"ua\"\n {:name \"ua\",\n  :shape [1 17 128 256],\n  :data #\u003cDelay@388e2044: :not-delivered\u003e,\n  :shape-names [\"time\" \"plev\" \"lat\" \"lon\"],\n  :fullname \"eastward_wind\",\n  :units \"m s-1\",\n  :missing-value 1.0E20},\n \"area\"\n {:name \"area\",\n  :shape [128 256],\n  :data #\u003cDelay@2658dff1: :not-delivered\u003e,\n  :shape-names [\"lat\" \"lon\"],\n  :fullname \"area\",\n  :units \"meter2\",\n  :missing-value nil},\n \"lon\"\n {:name \"lon\",\n  :shape [256],\n  :data #\u003cDelay@4628cad3: :not-delivered\u003e,\n  :shape-names [\"lon\"],\n  :fullname \"longitude\",\n  :units \"degrees_east\",\n  :missing-value nil},\n \"time\"\n {:name \"time\",\n  :shape [1],\n  :data #\u003cDelay@6c0d901d: :not-delivered\u003e,\n  :shape-names [\"time\"],\n  :fullname \"time\",\n  :units \"days since 0000-1-1\",\n  :missing-value nil},\n \"lat\"\n {:name \"lat\",\n  :shape [128],\n  :data #\u003cDelay@206b1c4b: :not-delivered\u003e,\n  :shape-names [\"lat\"],\n  :fullname \"latitude\",\n  :units \"degrees_north\",\n  :missing-value nil},\n \"time_bnds\"\n {:name \"time_bnds\",\n  :shape [1 2],\n  :data #\u003cDelay@4bc0d189: :not-delivered\u003e,\n  :shape-names [\"time\" \"bnds\"],\n  :fullname \"time_bnds\",\n  :units nil,\n  :missing-value nil},\n \"msk_rgn\"\n {:name \"msk_rgn\",\n  :shape [128 256],\n  :data #\u003cDelay@6623b7c3: :not-delivered\u003e,\n  :shape-names [\"lat\" \"lon\"],\n  :fullname \"msk_rgn\",\n  :units \"bool\",\n  :missing-value nil},\n \"lat_bnds\"\n {:name \"lat_bnds\",\n  :shape [128 2],\n  :data #\u003cDelay@1447a9ee: :not-delivered\u003e,\n  :shape-names [\"lat\" \"bnds\"],\n  :fullname \"lat_bnds\",\n  :units nil,\n  :missing-value nil},\n \"lon_bnds\"\n {:name \"lon_bnds\",\n  :shape [256 2],\n  :data #\u003cDelay@24a81410: :not-delivered\u003e,\n  :shape-names [\"lon\" \"bnds\"],\n  :fullname \"lon_bnds\",\n  :units nil,\n  :missing-value nil},\n \"plev\"\n {:name \"plev\",\n  :shape [17],\n  :data #\u003cDelay@7d63f18a: :not-delivered\u003e,\n  :shape-names [\"plev\"],\n  :fullname \"air_pressure\",\n  :units \"Pa\",\n  :missing-value nil},\n \"pr\"\n {:name \"pr\",\n  :shape [1 128 256],\n  :data #\u003cDelay@2c16ecfe: :not-delivered\u003e,\n  :shape-names [\"time\" \"lat\" \"lon\"],\n  :fullname \"precipitation_flux\",\n  :units \"kg m-2 s-1\",\n  :missing-value 1.0E20}}\n\n;; Actual get some data\nuser\u003e (def test-data @(get-in (netcdf/overview test-file) [\"tas\" :data]))\n#'user/test-data\nuser\u003e (require '[tech.v2.datatype :as dtype])\nnil\nuser\u003e (require '[tech.v2.tensor :as tens])\nnil\nuser\u003e (dtype/shape test-data)\n[1 128 256]\nuser\u003e (dtype/get-datatype test-data)\n:float32\nuser\u003e (type test-data)\nucar.ma2.ArrayFloat$D3\nuser\u003e (-\u003e (tens/select test-data 0 (range 5) (range 5))\n          println)\n#tech.v2.tensor\u003cfloat32\u003e[5 5]\n[[215.893 215.805 215.739 215.663 215.620]\n [217.168 217.030 216.910 216.792 216.632]\n [218.764 218.524 218.283 218.042 217.814]\n [219.861 219.500 219.176 218.873 218.578]\n [221.123 220.713 220.330 220.021 219.676]]\nnil\nuser\u003e (take 20 (dtype/-\u003evector test-data))\n(215.8935\n 215.80531\n 215.73935\n 215.66304\n 215.61963\n 215.54893\n 215.46086\n 215.36723\n 215.33812\n 215.2303\n 215.14465\n 215.08086\n 215.03511\n 215.01857\n 214.85776\n 214.83345\n 214.82996\n 214.70193\n 214.60558\n 214.62598)\n```\n\n## License\n\nCopyright © 2019 TechAscent, LLC\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechascent%2Ftech.netcdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechascent%2Ftech.netcdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechascent%2Ftech.netcdf/lists"}