{"id":16860997,"url":"https://github.com/nickmcintyre/processing-netcdf","last_synced_at":"2025-04-11T04:23:16.779Z","repository":{"id":130731696,"uuid":"158438908","full_name":"nickmcintyre/processing-netcdf","owner":"nickmcintyre","description":"Simple access to scientific datasets with Processing","archived":false,"fork":false,"pushed_at":"2022-04-27T20:21:14.000Z","size":202847,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T02:37:07.613Z","etag":null,"topics":["data","netcdf","processing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickmcintyre.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,"governance":null}},"created_at":"2018-11-20T19:11:44.000Z","updated_at":"2022-01-22T04:12:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f08e0ad-eba7-4243-bd98-b188acdbd45a","html_url":"https://github.com/nickmcintyre/processing-netcdf","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"04d1c1d85353a5a63c0147ac7a70f5017aacd9a7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fprocessing-netcdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fprocessing-netcdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fprocessing-netcdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fprocessing-netcdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickmcintyre","download_url":"https://codeload.github.com/nickmcintyre/processing-netcdf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248340572,"owners_count":21087475,"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":["data","netcdf","processing"],"created_at":"2024-10-13T14:28:34.774Z","updated_at":"2025-04-11T04:23:11.760Z","avatar_url":"https://github.com/nickmcintyre.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# processing-netcdf\n**Simple access to scientific datasets with Processing**\n\n- Thin wrapper around the [Unidata NetCDF Java library](https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/documentation.htm).\n- Friendly API for scientific file formats and remote access protocols.\n- GRIB 1/2, HDF 4/5, NetCDF 3/4, OPeNDAP, and [many more](https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/formats/FileTypes.html).\n\n## Example\nThe following example loads the first observation of a gravitational wave from an [HDF5 file](https://www.gw-openscience.org/catalog/GWTC-1-confident/data/GW150914/H-H1_GWOSC_4KHZ_R1-1126257415-4096.hdf5) stored in the sketch's `data` folder, then plots the data (strain). Visit the [Graviational Wave Open Science Center](https://www.gw-openscience.org/about/) for tutorials and datasets.\n\n![Plot of LIGO data](ligo.png)\n\n```java\nimport netcdf.*;\n\nPDataset data;\ndouble[] strain;\nfloat start;\nfloat duration;\n\nvoid setup() {\n  size(1000, 350);\n\n  data = new PDataset(this);\n  String filename = dataPath(\"H-H1_GWOSC_4KHZ_R1-1126257415-4096.hdf5\");\n  data.openFile(filename);\n  \n  data.loadData(\"strain/Strain\");\n  data.loadData(\"meta/GPSstart\");\n  data.loadData(\"meta/Duration\");\n  \n  strain = data.get1DDoubleArray(\"strain/Strain\");\n  // Access metadata contained in a NetCDF-Java Array object\n  start = data.variables.get(\"meta/GPSstart\").getFloat(0);\n  duration = data.variables.get(\"meta/Duration\").getFloat(0);\n  \n  data.close();\n\n  noLoop();\n}\n\nvoid draw() {\n  background(255);\n  fill(0);\n  stroke(0);\n  \n  // Draw plot title\n  textSize(18);\n  textAlign(CENTER, CENTER);\n  text(\"Waves, waves, waves\", width/2, 20);\n\n  // Draw y-axis\n  line(50, 50, 50, height - 50);\n  line(width - 50, 50, width - 50, height - 50);\n  for (int y = -100; y \u003c= 100; y += 50) {\n    line(width - 50, height/2 + y, width - 60, height/2 + y);\n    line(50, height/2 + y, 60, height/2 + y);\n  }\n\n  // Draw y labels\n  textSize(12);\n  textAlign(CENTER, CENTER);\n  text(\"1\", 40, height/2 - 100);\n  text(\"0.5\", 38, height/2 - 50);\n  text(\"0\", 40, height/2);\n  text(\"-0.5\", 34, height/2 + 50);\n  text(\"-1\", 36, height/2 + 100);\n\n  // Draw y title\n  pushMatrix();\n  textAlign(CENTER, BOTTOM);\n  translate(20, height/2);\n  rotate(-HALF_PI);\n  text(\"H1 Strain (E-19)\", 0, 0);\n  popMatrix();\n\n  // Draw x-axis\n  line(50, 50, width - 50, 50);\n  line(50, height - 50, width - 50, height - 50);\n  for (int x = 50; x \u003c= width - 50; x += 100) {\n    line(x, height - 50, x, height - 60);\n    line(x, 50, x, 60);\n  }\n\n  // Draw x labels\n  text(String.format(\"+%1.8E\", start), width - 110, height - 10);\n  textAlign(CENTER, CENTER);\n  for (int i = 0; i \u003c 10; i++) {\n    int t = int(i * duration / 9);\n    text(t, 50 + i*100, height - 40);\n  }\n\n  // Draw x title\n  textAlign(CENTER, BOTTOM);\n  text(\"GPS Time (s)\", width/2, height - 10);\n\n  // Plot data points\n  pushMatrix();\n  stroke(0, 0, 255);\n  scale(1, -1);\n  translate(0, -height);\n  for (int i = 0; i \u003c strain.length; i++) {\n    float x = map(i * (float)width/strain.length, 0, width, 50, width - 50);\n    float y = height/2 + (float)strain[i]*pow(10, 19);\n    point(x, y);\n  }\n  popMatrix();\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmcintyre%2Fprocessing-netcdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickmcintyre%2Fprocessing-netcdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmcintyre%2Fprocessing-netcdf/lists"}