Skip to content

Instantly share code, notes, and snippets.

@MathewBiddle
Created September 6, 2023 21:40
Show Gist options
  • Save MathewBiddle/1c67ce45c77e8c8bb39921c599f10aed to your computer and use it in GitHub Desktop.
Save MathewBiddle/1c67ce45c77e8c8bb39921c599f10aed to your computer and use it in GitHub Desktop.
IR.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "ir",
"display_name": "R"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/MathewBiddle/1c67ce45c77e8c8bb39921c599f10aed/ir.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"# NOTE: This notebook is unnecessary since Google Colab now directly supports R. Please navigate to `Runtime -> Change runtime type` and select `R`."
],
"metadata": {
"id": "SWeg7u8IjsOA"
}
},
{
"cell_type": "code",
"metadata": {
"id": "rCEtur7fajGn",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "6776cb29-cd09-416d-9817-65fc70934290"
},
"source": [
"cat(system('python3 -c \"from google.colab import drive\\ndrive.mount()\"', intern=TRUE), sep='\\n', wait=TRUE)"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"Warning message in system(\"python3 -c \\\"from google.colab import drive\\ndrive.mount()\\\"\", :\n",
"“running command 'python3 -c \"from google.colab import drive\n",
"drive.mount()\"' had status 1”\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"\n",
"TRUE\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "T6aH0TahbghZ"
},
"source": [
"?system"
],
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "3o11KxDzyC0g",
"outputId": "26ed7293-94f2-4259-e492-3b884572b5ae",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"source": [
"install.packages(\"rgl\", repos = \"http://cran.rstudio.com/\")\n",
"install.packages(\"ConsRank\", repos = \"http://cran.rstudio.com/\")\n",
"library(\"ConsRank\")"
],
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"Installing package into ‘/usr/local/lib/R/site-library’\n",
"(as ‘lib’ is unspecified)\n",
"\n",
"also installing the dependency ‘htmlwidgets’\n",
"\n",
"\n",
"Installing package into ‘/usr/local/lib/R/site-library’\n",
"(as ‘lib’ is unspecified)\n",
"\n",
"also installing the dependencies ‘XML’, ‘rlist’, ‘proxy’, ‘gtools’\n",
"\n",
"\n",
"Loading required package: rgl\n",
"\n",
"This build of rgl does not include OpenGL functions. Use\n",
" rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).\n",
"\n",
"\n",
"Attaching package: ‘ConsRank’\n",
"\n",
"\n",
"The following object is masked from ‘package:base’:\n",
"\n",
" labels\n",
"\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "SPYGePw53fWq"
},
"source": [
"system(\"add-apt-repository -y ppa:marutter/rrutter\")\n",
"system(\"add-apt-repository -y ppa:marutter/c2d4u\")\n",
"system(\"apt-get update\")\n",
"system(\"apt install -y r-cran-rstan\")"
],
"execution_count": 4,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "1IzjHJFxv01f",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "8fd6e441-32e4-466f-ad46-ee480145a00f"
},
"source": [
"install.packages('tidync')"
],
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"Installing package into ‘/usr/local/lib/R/site-library’\n",
"(as ‘lib’ is unspecified)\n",
"\n",
"also installing the dependencies ‘ncdf4’, ‘ncmeta’, ‘RNetCDF’\n",
"\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "sdyV67dk2vGx"
},
"source": [
"library(tidync)"
],
"execution_count": 11,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "IS3VN3qamf20"
},
"source": [
"url = 'https://github.com/ioos/ioos-atn-data/raw/main/templates/atn_22275_loggerhead_turtle_19970720_20040216.nc'\n",
"download.file(url, 'atn_trajectory_template.nc', mode = \"wb\")"
],
"execution_count": 19,
"outputs": []
},
{
"cell_type": "code",
"source": [
"library(ncdf4)\n",
"ncmeta::nc_vars(\"atn_trajectory_template.nc\")\n",
"ncmeta::nc_grids(\"atn_trajectory_template.nc\") %>% tidyr::unnest(cols = c(variables))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "yDH45Ec_Y2v0",
"outputId": "59f59645-ffcd-4659-e6ec-248f51635fb2"
},
"execution_count": 20,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<table class=\"dataframe\">\n",
"<caption>A tibble: 32 × 5</caption>\n",
"<thead>\n",
"\t<tr><th scope=col>id</th><th scope=col>name</th><th scope=col>type</th><th scope=col>ndims</th><th scope=col>natts</th></tr>\n",
"\t<tr><th scope=col>&lt;int&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th></tr>\n",
"</thead>\n",
"<tbody>\n",
"\t<tr><td> 0</td><td>Ptt </td><td>NC_INT </td><td>1</td><td> 5</td></tr>\n",
"\t<tr><td> 1</td><td>animal </td><td>NC_STRING</td><td>0</td><td>22</td></tr>\n",
"\t<tr><td> 2</td><td>animal_length </td><td>NC_FLOAT </td><td>0</td><td> 3</td></tr>\n",
"\t<tr><td> 3</td><td>animal_life_stage </td><td>NC_STRING</td><td>0</td><td> 2</td></tr>\n",
"\t<tr><td> 4</td><td>animal_sex </td><td>NC_STRING</td><td>0</td><td> 2</td></tr>\n",
"\t<tr><td> 5</td><td>animal_weight </td><td>NC_FLOAT </td><td>0</td><td> 4</td></tr>\n",
"\t<tr><td> 6</td><td>comment </td><td>NC_STRING</td><td>1</td><td> 3</td></tr>\n",
"\t<tr><td> 7</td><td>count </td><td>NC_DOUBLE</td><td>1</td><td> 5</td></tr>\n",
"\t<tr><td> 8</td><td>crs </td><td>NC_INT </td><td>0</td><td> 6</td></tr>\n",
"\t<tr><td> 9</td><td>deploy_id </td><td>NC_INT </td><td>1</td><td> 5</td></tr>\n",
"\t<tr><td>10</td><td>ellipse_orientation </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>11</td><td>error_radius </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>12</td><td>instrument </td><td>NC_STRING</td><td>1</td><td> 3</td></tr>\n",
"\t<tr><td>13</td><td>instrument_location </td><td>NC_STRING</td><td>0</td><td> 7</td></tr>\n",
"\t<tr><td>14</td><td>instrument_tag </td><td>NC_STRING</td><td>0</td><td> 6</td></tr>\n",
"\t<tr><td>15</td><td>lat </td><td>NC_DOUBLE</td><td>1</td><td>14</td></tr>\n",
"\t<tr><td>16</td><td>location_class </td><td>NC_STRING</td><td>1</td><td>10</td></tr>\n",
"\t<tr><td>17</td><td>lon </td><td>NC_DOUBLE</td><td>1</td><td>14</td></tr>\n",
"\t<tr><td>18</td><td>offset </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>19</td><td>offset_orientation </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>20</td><td>qartod_location_flag</td><td>NC_INT </td><td>1</td><td> 9</td></tr>\n",
"\t<tr><td>21</td><td>qartod_rollup_flag </td><td>NC_INT </td><td>1</td><td> 9</td></tr>\n",
"\t<tr><td>22</td><td>qartod_speed_flag </td><td>NC_INT </td><td>1</td><td> 9</td></tr>\n",
"\t<tr><td>23</td><td>qartod_time_flag </td><td>NC_INT </td><td>1</td><td> 9</td></tr>\n",
"\t<tr><td>24</td><td>semi_major_axis </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>25</td><td>semi_minor_axis </td><td>NC_DOUBLE</td><td>1</td><td> 8</td></tr>\n",
"\t<tr><td>26</td><td>taxon_lsid </td><td>NC_STRING</td><td>0</td><td> 6</td></tr>\n",
"\t<tr><td>27</td><td>taxon_name </td><td>NC_STRING</td><td>0</td><td> 4</td></tr>\n",
"\t<tr><td>28</td><td>time </td><td>NC_DOUBLE</td><td>1</td><td>11</td></tr>\n",
"\t<tr><td>29</td><td>trajectory </td><td>NC_STRING</td><td>0</td><td> 2</td></tr>\n",
"\t<tr><td>30</td><td>type </td><td>NC_STRING</td><td>1</td><td> 3</td></tr>\n",
"\t<tr><td>31</td><td>z </td><td>NC_INT </td><td>1</td><td>10</td></tr>\n",
"</tbody>\n",
"</table>\n"
],
"text/markdown": "\nA tibble: 32 × 5\n\n| id &lt;int&gt; | name &lt;chr&gt; | type &lt;chr&gt; | ndims &lt;int&gt; | natts &lt;int&gt; |\n|---|---|---|---|---|\n| 0 | Ptt | NC_INT | 1 | 5 |\n| 1 | animal | NC_STRING | 0 | 22 |\n| 2 | animal_length | NC_FLOAT | 0 | 3 |\n| 3 | animal_life_stage | NC_STRING | 0 | 2 |\n| 4 | animal_sex | NC_STRING | 0 | 2 |\n| 5 | animal_weight | NC_FLOAT | 0 | 4 |\n| 6 | comment | NC_STRING | 1 | 3 |\n| 7 | count | NC_DOUBLE | 1 | 5 |\n| 8 | crs | NC_INT | 0 | 6 |\n| 9 | deploy_id | NC_INT | 1 | 5 |\n| 10 | ellipse_orientation | NC_DOUBLE | 1 | 8 |\n| 11 | error_radius | NC_DOUBLE | 1 | 8 |\n| 12 | instrument | NC_STRING | 1 | 3 |\n| 13 | instrument_location | NC_STRING | 0 | 7 |\n| 14 | instrument_tag | NC_STRING | 0 | 6 |\n| 15 | lat | NC_DOUBLE | 1 | 14 |\n| 16 | location_class | NC_STRING | 1 | 10 |\n| 17 | lon | NC_DOUBLE | 1 | 14 |\n| 18 | offset | NC_DOUBLE | 1 | 8 |\n| 19 | offset_orientation | NC_DOUBLE | 1 | 8 |\n| 20 | qartod_location_flag | NC_INT | 1 | 9 |\n| 21 | qartod_rollup_flag | NC_INT | 1 | 9 |\n| 22 | qartod_speed_flag | NC_INT | 1 | 9 |\n| 23 | qartod_time_flag | NC_INT | 1 | 9 |\n| 24 | semi_major_axis | NC_DOUBLE | 1 | 8 |\n| 25 | semi_minor_axis | NC_DOUBLE | 1 | 8 |\n| 26 | taxon_lsid | NC_STRING | 0 | 6 |\n| 27 | taxon_name | NC_STRING | 0 | 4 |\n| 28 | time | NC_DOUBLE | 1 | 11 |\n| 29 | trajectory | NC_STRING | 0 | 2 |\n| 30 | type | NC_STRING | 1 | 3 |\n| 31 | z | NC_INT | 1 | 10 |\n\n",
"text/latex": "A tibble: 32 × 5\n\\begin{tabular}{lllll}\n id & name & type & ndims & natts\\\\\n <int> & <chr> & <chr> & <int> & <int>\\\\\n\\hline\n\t 0 & Ptt & NC\\_INT & 1 & 5\\\\\n\t 1 & animal & NC\\_STRING & 0 & 22\\\\\n\t 2 & animal\\_length & NC\\_FLOAT & 0 & 3\\\\\n\t 3 & animal\\_life\\_stage & NC\\_STRING & 0 & 2\\\\\n\t 4 & animal\\_sex & NC\\_STRING & 0 & 2\\\\\n\t 5 & animal\\_weight & NC\\_FLOAT & 0 & 4\\\\\n\t 6 & comment & NC\\_STRING & 1 & 3\\\\\n\t 7 & count & NC\\_DOUBLE & 1 & 5\\\\\n\t 8 & crs & NC\\_INT & 0 & 6\\\\\n\t 9 & deploy\\_id & NC\\_INT & 1 & 5\\\\\n\t 10 & ellipse\\_orientation & NC\\_DOUBLE & 1 & 8\\\\\n\t 11 & error\\_radius & NC\\_DOUBLE & 1 & 8\\\\\n\t 12 & instrument & NC\\_STRING & 1 & 3\\\\\n\t 13 & instrument\\_location & NC\\_STRING & 0 & 7\\\\\n\t 14 & instrument\\_tag & NC\\_STRING & 0 & 6\\\\\n\t 15 & lat & NC\\_DOUBLE & 1 & 14\\\\\n\t 16 & location\\_class & NC\\_STRING & 1 & 10\\\\\n\t 17 & lon & NC\\_DOUBLE & 1 & 14\\\\\n\t 18 & offset & NC\\_DOUBLE & 1 & 8\\\\\n\t 19 & offset\\_orientation & NC\\_DOUBLE & 1 & 8\\\\\n\t 20 & qartod\\_location\\_flag & NC\\_INT & 1 & 9\\\\\n\t 21 & qartod\\_rollup\\_flag & NC\\_INT & 1 & 9\\\\\n\t 22 & qartod\\_speed\\_flag & NC\\_INT & 1 & 9\\\\\n\t 23 & qartod\\_time\\_flag & NC\\_INT & 1 & 9\\\\\n\t 24 & semi\\_major\\_axis & NC\\_DOUBLE & 1 & 8\\\\\n\t 25 & semi\\_minor\\_axis & NC\\_DOUBLE & 1 & 8\\\\\n\t 26 & taxon\\_lsid & NC\\_STRING & 0 & 6\\\\\n\t 27 & taxon\\_name & NC\\_STRING & 0 & 4\\\\\n\t 28 & time & NC\\_DOUBLE & 1 & 11\\\\\n\t 29 & trajectory & NC\\_STRING & 0 & 2\\\\\n\t 30 & type & NC\\_STRING & 1 & 3\\\\\n\t 31 & z & NC\\_INT & 1 & 10\\\\\n\\end{tabular}\n",
"text/plain": [
" id name type ndims natts\n",
"1 0 Ptt NC_INT 1 5 \n",
"2 1 animal NC_STRING 0 22 \n",
"3 2 animal_length NC_FLOAT 0 3 \n",
"4 3 animal_life_stage NC_STRING 0 2 \n",
"5 4 animal_sex NC_STRING 0 2 \n",
"6 5 animal_weight NC_FLOAT 0 4 \n",
"7 6 comment NC_STRING 1 3 \n",
"8 7 count NC_DOUBLE 1 5 \n",
"9 8 crs NC_INT 0 6 \n",
"10 9 deploy_id NC_INT 1 5 \n",
"11 10 ellipse_orientation NC_DOUBLE 1 8 \n",
"12 11 error_radius NC_DOUBLE 1 8 \n",
"13 12 instrument NC_STRING 1 3 \n",
"14 13 instrument_location NC_STRING 0 7 \n",
"15 14 instrument_tag NC_STRING 0 6 \n",
"16 15 lat NC_DOUBLE 1 14 \n",
"17 16 location_class NC_STRING 1 10 \n",
"18 17 lon NC_DOUBLE 1 14 \n",
"19 18 offset NC_DOUBLE 1 8 \n",
"20 19 offset_orientation NC_DOUBLE 1 8 \n",
"21 20 qartod_location_flag NC_INT 1 9 \n",
"22 21 qartod_rollup_flag NC_INT 1 9 \n",
"23 22 qartod_speed_flag NC_INT 1 9 \n",
"24 23 qartod_time_flag NC_INT 1 9 \n",
"25 24 semi_major_axis NC_DOUBLE 1 8 \n",
"26 25 semi_minor_axis NC_DOUBLE 1 8 \n",
"27 26 taxon_lsid NC_STRING 0 6 \n",
"28 27 taxon_name NC_STRING 0 4 \n",
"29 28 time NC_DOUBLE 1 11 \n",
"30 29 trajectory NC_STRING 0 2 \n",
"31 30 type NC_STRING 1 3 \n",
"32 31 z NC_INT 1 10 "
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<table class=\"dataframe\">\n",
"<caption>A tibble: 21 × 4</caption>\n",
"<thead>\n",
"\t<tr><th scope=col>grid</th><th scope=col>ndims</th><th scope=col>variable</th><th scope=col>nvars</th></tr>\n",
"\t<tr><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;int&gt;</th></tr>\n",
"</thead>\n",
"<tbody>\n",
"\t<tr><td>D0</td><td>1</td><td>Ptt </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>comment </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>count </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>deploy_id </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>ellipse_orientation </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>error_radius </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>instrument </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>lat </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>location_class </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>lon </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>offset </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>offset_orientation </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>qartod_location_flag</td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>qartod_rollup_flag </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>qartod_speed_flag </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>qartod_time_flag </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>semi_major_axis </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>semi_minor_axis </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>time </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>type </td><td>21</td></tr>\n",
"\t<tr><td>D0</td><td>1</td><td>z </td><td>21</td></tr>\n",
"</tbody>\n",
"</table>\n"
],
"text/markdown": "\nA tibble: 21 × 4\n\n| grid &lt;chr&gt; | ndims &lt;int&gt; | variable &lt;chr&gt; | nvars &lt;int&gt; |\n|---|---|---|---|\n| D0 | 1 | Ptt | 21 |\n| D0 | 1 | comment | 21 |\n| D0 | 1 | count | 21 |\n| D0 | 1 | deploy_id | 21 |\n| D0 | 1 | ellipse_orientation | 21 |\n| D0 | 1 | error_radius | 21 |\n| D0 | 1 | instrument | 21 |\n| D0 | 1 | lat | 21 |\n| D0 | 1 | location_class | 21 |\n| D0 | 1 | lon | 21 |\n| D0 | 1 | offset | 21 |\n| D0 | 1 | offset_orientation | 21 |\n| D0 | 1 | qartod_location_flag | 21 |\n| D0 | 1 | qartod_rollup_flag | 21 |\n| D0 | 1 | qartod_speed_flag | 21 |\n| D0 | 1 | qartod_time_flag | 21 |\n| D0 | 1 | semi_major_axis | 21 |\n| D0 | 1 | semi_minor_axis | 21 |\n| D0 | 1 | time | 21 |\n| D0 | 1 | type | 21 |\n| D0 | 1 | z | 21 |\n\n",
"text/latex": "A tibble: 21 × 4\n\\begin{tabular}{llll}\n grid & ndims & variable & nvars\\\\\n <chr> & <int> & <chr> & <int>\\\\\n\\hline\n\t D0 & 1 & Ptt & 21\\\\\n\t D0 & 1 & comment & 21\\\\\n\t D0 & 1 & count & 21\\\\\n\t D0 & 1 & deploy\\_id & 21\\\\\n\t D0 & 1 & ellipse\\_orientation & 21\\\\\n\t D0 & 1 & error\\_radius & 21\\\\\n\t D0 & 1 & instrument & 21\\\\\n\t D0 & 1 & lat & 21\\\\\n\t D0 & 1 & location\\_class & 21\\\\\n\t D0 & 1 & lon & 21\\\\\n\t D0 & 1 & offset & 21\\\\\n\t D0 & 1 & offset\\_orientation & 21\\\\\n\t D0 & 1 & qartod\\_location\\_flag & 21\\\\\n\t D0 & 1 & qartod\\_rollup\\_flag & 21\\\\\n\t D0 & 1 & qartod\\_speed\\_flag & 21\\\\\n\t D0 & 1 & qartod\\_time\\_flag & 21\\\\\n\t D0 & 1 & semi\\_major\\_axis & 21\\\\\n\t D0 & 1 & semi\\_minor\\_axis & 21\\\\\n\t D0 & 1 & time & 21\\\\\n\t D0 & 1 & type & 21\\\\\n\t D0 & 1 & z & 21\\\\\n\\end{tabular}\n",
"text/plain": [
" grid ndims variable nvars\n",
"1 D0 1 Ptt 21 \n",
"2 D0 1 comment 21 \n",
"3 D0 1 count 21 \n",
"4 D0 1 deploy_id 21 \n",
"5 D0 1 ellipse_orientation 21 \n",
"6 D0 1 error_radius 21 \n",
"7 D0 1 instrument 21 \n",
"8 D0 1 lat 21 \n",
"9 D0 1 location_class 21 \n",
"10 D0 1 lon 21 \n",
"11 D0 1 offset 21 \n",
"12 D0 1 offset_orientation 21 \n",
"13 D0 1 qartod_location_flag 21 \n",
"14 D0 1 qartod_rollup_flag 21 \n",
"15 D0 1 qartod_speed_flag 21 \n",
"16 D0 1 qartod_time_flag 21 \n",
"17 D0 1 semi_major_axis 21 \n",
"18 D0 1 semi_minor_axis 21 \n",
"19 D0 1 time 21 \n",
"20 D0 1 type 21 \n",
"21 D0 1 z 21 "
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"atn <- tidync(\"atn_trajectory_template.nc\")\n",
"atn"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 243
},
"id": "npMk4zBGZQFc",
"outputId": "a3801c17-4fb3-4451-c485-eee0a64d431c"
},
"execution_count": 21,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"\n",
"Data Source (1): atn_trajectory_template.nc ...\n",
"\n",
"Grids (1) <dimension family> : <associated variables> \n",
"\n",
"[1] D0 : Ptt, comment, count, deploy_id, ellipse_orientation, error_radius, instrument, lat, location_class, lon, offset, offset_orientation, qartod_location_flag, qartod_rollup_flag, qartod_speed_flag, qartod_time_flag, semi_major_axis, semi_minor_axis, time, type, z **ACTIVE GRID** ( 706 values per variable)\n",
"\n",
"Dimensions 1 (all active): \n",
" \n",
" dim name length min max start count dmin dmax unlim coord_dim \n",
" \u001b[3m\u001b[90m<chr>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<chr>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<dbl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<dbl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<dbl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<int>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<int>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<dbl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<dbl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<lgl>\u001b[39m\u001b[23m \u001b[3m\u001b[90m<lgl>\u001b[39m\u001b[23m \n",
"\u001b[90m1\u001b[39m D0 obs 706 1 706 1 706 1 706 FALSE FALSE "
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "NwipxyhAZuPc"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment