gphys 1.2.2.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -17
  3. data/.rspec +2 -0
  4. data/.travis.yml +3 -0
  5. data/ChangeLog +5762 -753
  6. data/LICENSE.txt +30 -18
  7. data/Rakefile +1 -0
  8. data/bin/console +14 -0
  9. data/bin/gpcat +43 -2
  10. data/bin/gpcut +16 -0
  11. data/bin/gpvect +167 -15
  12. data/bin/gpview +254 -51
  13. data/bin/setup +7 -0
  14. data/dim_op.c +1220 -0
  15. data/doc/attribute.html +19 -0
  16. data/doc/attributenetcdf.html +15 -0
  17. data/doc/axis.html +387 -0
  18. data/doc/coordmapping.html +111 -0
  19. data/doc/coordtransform.html +36 -0
  20. data/doc/dclext.html +821 -0
  21. data/doc/derivative/gphys-derivative.html +100 -0
  22. data/doc/derivative/index.html +21 -0
  23. data/doc/derivative/index.rd +14 -0
  24. data/doc/derivative/math-doc/document.pdf +0 -0
  25. data/doc/derivative/math-doc/document.tex +158 -0
  26. data/doc/derivative/math-doc/document/document.css +30 -0
  27. data/doc/derivative/math-doc/document/document.html +57 -0
  28. data/doc/derivative/math-doc/document/images.aux +1 -0
  29. data/doc/derivative/math-doc/document/images.log +385 -0
  30. data/doc/derivative/math-doc/document/images.pl +186 -0
  31. data/doc/derivative/math-doc/document/images.tex +364 -0
  32. data/doc/derivative/math-doc/document/img1.png +0 -0
  33. data/doc/derivative/math-doc/document/img10.png +0 -0
  34. data/doc/derivative/math-doc/document/img11.png +0 -0
  35. data/doc/derivative/math-doc/document/img12.png +0 -0
  36. data/doc/derivative/math-doc/document/img13.png +0 -0
  37. data/doc/derivative/math-doc/document/img14.png +0 -0
  38. data/doc/derivative/math-doc/document/img15.png +0 -0
  39. data/doc/derivative/math-doc/document/img16.png +0 -0
  40. data/doc/derivative/math-doc/document/img17.png +0 -0
  41. data/doc/derivative/math-doc/document/img18.png +0 -0
  42. data/doc/derivative/math-doc/document/img19.png +0 -0
  43. data/doc/derivative/math-doc/document/img2.png +0 -0
  44. data/doc/derivative/math-doc/document/img20.png +0 -0
  45. data/doc/derivative/math-doc/document/img21.png +0 -0
  46. data/doc/derivative/math-doc/document/img22.png +0 -0
  47. data/doc/derivative/math-doc/document/img23.png +0 -0
  48. data/doc/derivative/math-doc/document/img24.png +0 -0
  49. data/doc/derivative/math-doc/document/img25.png +0 -0
  50. data/doc/derivative/math-doc/document/img26.png +0 -0
  51. data/doc/derivative/math-doc/document/img27.png +0 -0
  52. data/doc/derivative/math-doc/document/img28.png +0 -0
  53. data/doc/derivative/math-doc/document/img29.png +0 -0
  54. data/doc/derivative/math-doc/document/img3.png +0 -0
  55. data/doc/derivative/math-doc/document/img30.png +0 -0
  56. data/doc/derivative/math-doc/document/img4.png +0 -0
  57. data/doc/derivative/math-doc/document/img5.png +0 -0
  58. data/doc/derivative/math-doc/document/img6.png +0 -0
  59. data/doc/derivative/math-doc/document/img7.png +0 -0
  60. data/doc/derivative/math-doc/document/img8.png +0 -0
  61. data/doc/derivative/math-doc/document/img9.png +0 -0
  62. data/doc/derivative/math-doc/document/index.html +57 -0
  63. data/doc/derivative/math-doc/document/labels.pl +13 -0
  64. data/doc/derivative/math-doc/document/next.png +0 -0
  65. data/doc/derivative/math-doc/document/next_g.png +0 -0
  66. data/doc/derivative/math-doc/document/node1.html +238 -0
  67. data/doc/derivative/math-doc/document/node2.html +75 -0
  68. data/doc/derivative/math-doc/document/prev.png +0 -0
  69. data/doc/derivative/math-doc/document/prev_g.png +0 -0
  70. data/doc/derivative/math-doc/document/up.png +0 -0
  71. data/doc/derivative/math-doc/document/up_g.png +0 -0
  72. data/doc/derivative/numru-derivative.html +158 -0
  73. data/doc/ep_flux/ep_flux.html +469 -0
  74. data/doc/ep_flux/ggraph_on_merdional_section.html +71 -0
  75. data/doc/ep_flux/index.html +31 -0
  76. data/doc/ep_flux/index.rd +24 -0
  77. data/doc/ep_flux/math-doc/document.pdf +0 -0
  78. data/doc/ep_flux/math-doc/document.tex +2018 -0
  79. data/doc/ep_flux/math-doc/document/WARNINGS +1 -0
  80. data/doc/ep_flux/math-doc/document/contents.png +0 -0
  81. data/doc/ep_flux/math-doc/document/crossref.png +0 -0
  82. data/doc/ep_flux/math-doc/document/document.css +30 -0
  83. data/doc/ep_flux/math-doc/document/document.html +101 -0
  84. data/doc/ep_flux/math-doc/document/images.aux +1 -0
  85. data/doc/ep_flux/math-doc/document/images.log +1375 -0
  86. data/doc/ep_flux/math-doc/document/images.pl +1328 -0
  87. data/doc/ep_flux/math-doc/document/images.tex +1471 -0
  88. data/doc/ep_flux/math-doc/document/img1.png +0 -0
  89. data/doc/ep_flux/math-doc/document/img10.png +0 -0
  90. data/doc/ep_flux/math-doc/document/img100.png +0 -0
  91. data/doc/ep_flux/math-doc/document/img101.png +0 -0
  92. data/doc/ep_flux/math-doc/document/img102.png +0 -0
  93. data/doc/ep_flux/math-doc/document/img103.png +0 -0
  94. data/doc/ep_flux/math-doc/document/img104.png +0 -0
  95. data/doc/ep_flux/math-doc/document/img105.png +0 -0
  96. data/doc/ep_flux/math-doc/document/img106.png +0 -0
  97. data/doc/ep_flux/math-doc/document/img107.png +0 -0
  98. data/doc/ep_flux/math-doc/document/img108.png +0 -0
  99. data/doc/ep_flux/math-doc/document/img109.png +0 -0
  100. data/doc/ep_flux/math-doc/document/img11.png +0 -0
  101. data/doc/ep_flux/math-doc/document/img110.png +0 -0
  102. data/doc/ep_flux/math-doc/document/img111.png +0 -0
  103. data/doc/ep_flux/math-doc/document/img112.png +0 -0
  104. data/doc/ep_flux/math-doc/document/img113.png +0 -0
  105. data/doc/ep_flux/math-doc/document/img114.png +0 -0
  106. data/doc/ep_flux/math-doc/document/img115.png +0 -0
  107. data/doc/ep_flux/math-doc/document/img116.png +0 -0
  108. data/doc/ep_flux/math-doc/document/img117.png +0 -0
  109. data/doc/ep_flux/math-doc/document/img118.png +0 -0
  110. data/doc/ep_flux/math-doc/document/img119.png +0 -0
  111. data/doc/ep_flux/math-doc/document/img12.png +0 -0
  112. data/doc/ep_flux/math-doc/document/img120.png +0 -0
  113. data/doc/ep_flux/math-doc/document/img121.png +0 -0
  114. data/doc/ep_flux/math-doc/document/img122.png +0 -0
  115. data/doc/ep_flux/math-doc/document/img123.png +0 -0
  116. data/doc/ep_flux/math-doc/document/img124.png +0 -0
  117. data/doc/ep_flux/math-doc/document/img125.png +0 -0
  118. data/doc/ep_flux/math-doc/document/img126.png +0 -0
  119. data/doc/ep_flux/math-doc/document/img127.png +0 -0
  120. data/doc/ep_flux/math-doc/document/img128.png +0 -0
  121. data/doc/ep_flux/math-doc/document/img129.png +0 -0
  122. data/doc/ep_flux/math-doc/document/img13.png +0 -0
  123. data/doc/ep_flux/math-doc/document/img130.png +0 -0
  124. data/doc/ep_flux/math-doc/document/img131.png +0 -0
  125. data/doc/ep_flux/math-doc/document/img132.png +0 -0
  126. data/doc/ep_flux/math-doc/document/img133.png +0 -0
  127. data/doc/ep_flux/math-doc/document/img134.png +0 -0
  128. data/doc/ep_flux/math-doc/document/img135.png +0 -0
  129. data/doc/ep_flux/math-doc/document/img136.png +0 -0
  130. data/doc/ep_flux/math-doc/document/img137.png +0 -0
  131. data/doc/ep_flux/math-doc/document/img138.png +0 -0
  132. data/doc/ep_flux/math-doc/document/img139.png +0 -0
  133. data/doc/ep_flux/math-doc/document/img14.png +0 -0
  134. data/doc/ep_flux/math-doc/document/img140.png +0 -0
  135. data/doc/ep_flux/math-doc/document/img141.png +0 -0
  136. data/doc/ep_flux/math-doc/document/img142.png +0 -0
  137. data/doc/ep_flux/math-doc/document/img143.png +0 -0
  138. data/doc/ep_flux/math-doc/document/img144.png +0 -0
  139. data/doc/ep_flux/math-doc/document/img145.png +0 -0
  140. data/doc/ep_flux/math-doc/document/img146.png +0 -0
  141. data/doc/ep_flux/math-doc/document/img147.png +0 -0
  142. data/doc/ep_flux/math-doc/document/img148.png +0 -0
  143. data/doc/ep_flux/math-doc/document/img149.png +0 -0
  144. data/doc/ep_flux/math-doc/document/img15.png +0 -0
  145. data/doc/ep_flux/math-doc/document/img150.png +0 -0
  146. data/doc/ep_flux/math-doc/document/img151.png +0 -0
  147. data/doc/ep_flux/math-doc/document/img152.png +0 -0
  148. data/doc/ep_flux/math-doc/document/img153.png +0 -0
  149. data/doc/ep_flux/math-doc/document/img154.png +0 -0
  150. data/doc/ep_flux/math-doc/document/img155.png +0 -0
  151. data/doc/ep_flux/math-doc/document/img156.png +0 -0
  152. data/doc/ep_flux/math-doc/document/img157.png +0 -0
  153. data/doc/ep_flux/math-doc/document/img158.png +0 -0
  154. data/doc/ep_flux/math-doc/document/img159.png +0 -0
  155. data/doc/ep_flux/math-doc/document/img16.png +0 -0
  156. data/doc/ep_flux/math-doc/document/img160.png +0 -0
  157. data/doc/ep_flux/math-doc/document/img161.png +0 -0
  158. data/doc/ep_flux/math-doc/document/img162.png +0 -0
  159. data/doc/ep_flux/math-doc/document/img163.png +0 -0
  160. data/doc/ep_flux/math-doc/document/img164.png +0 -0
  161. data/doc/ep_flux/math-doc/document/img165.png +0 -0
  162. data/doc/ep_flux/math-doc/document/img166.png +0 -0
  163. data/doc/ep_flux/math-doc/document/img167.png +0 -0
  164. data/doc/ep_flux/math-doc/document/img168.png +0 -0
  165. data/doc/ep_flux/math-doc/document/img169.png +0 -0
  166. data/doc/ep_flux/math-doc/document/img17.png +0 -0
  167. data/doc/ep_flux/math-doc/document/img170.png +0 -0
  168. data/doc/ep_flux/math-doc/document/img171.png +0 -0
  169. data/doc/ep_flux/math-doc/document/img172.png +0 -0
  170. data/doc/ep_flux/math-doc/document/img173.png +0 -0
  171. data/doc/ep_flux/math-doc/document/img174.png +0 -0
  172. data/doc/ep_flux/math-doc/document/img175.png +0 -0
  173. data/doc/ep_flux/math-doc/document/img176.png +0 -0
  174. data/doc/ep_flux/math-doc/document/img177.png +0 -0
  175. data/doc/ep_flux/math-doc/document/img178.png +0 -0
  176. data/doc/ep_flux/math-doc/document/img179.png +0 -0
  177. data/doc/ep_flux/math-doc/document/img18.png +0 -0
  178. data/doc/ep_flux/math-doc/document/img180.png +0 -0
  179. data/doc/ep_flux/math-doc/document/img181.png +0 -0
  180. data/doc/ep_flux/math-doc/document/img182.png +0 -0
  181. data/doc/ep_flux/math-doc/document/img183.png +0 -0
  182. data/doc/ep_flux/math-doc/document/img184.png +0 -0
  183. data/doc/ep_flux/math-doc/document/img185.png +0 -0
  184. data/doc/ep_flux/math-doc/document/img186.png +0 -0
  185. data/doc/ep_flux/math-doc/document/img187.png +0 -0
  186. data/doc/ep_flux/math-doc/document/img188.png +0 -0
  187. data/doc/ep_flux/math-doc/document/img189.png +0 -0
  188. data/doc/ep_flux/math-doc/document/img19.png +0 -0
  189. data/doc/ep_flux/math-doc/document/img190.png +0 -0
  190. data/doc/ep_flux/math-doc/document/img191.png +0 -0
  191. data/doc/ep_flux/math-doc/document/img192.png +0 -0
  192. data/doc/ep_flux/math-doc/document/img193.png +0 -0
  193. data/doc/ep_flux/math-doc/document/img194.png +0 -0
  194. data/doc/ep_flux/math-doc/document/img195.png +0 -0
  195. data/doc/ep_flux/math-doc/document/img196.png +0 -0
  196. data/doc/ep_flux/math-doc/document/img197.png +0 -0
  197. data/doc/ep_flux/math-doc/document/img198.png +0 -0
  198. data/doc/ep_flux/math-doc/document/img199.png +0 -0
  199. data/doc/ep_flux/math-doc/document/img2.png +0 -0
  200. data/doc/ep_flux/math-doc/document/img20.png +0 -0
  201. data/doc/ep_flux/math-doc/document/img200.png +0 -0
  202. data/doc/ep_flux/math-doc/document/img21.png +0 -0
  203. data/doc/ep_flux/math-doc/document/img22.png +0 -0
  204. data/doc/ep_flux/math-doc/document/img23.png +0 -0
  205. data/doc/ep_flux/math-doc/document/img24.png +0 -0
  206. data/doc/ep_flux/math-doc/document/img25.png +0 -0
  207. data/doc/ep_flux/math-doc/document/img26.png +0 -0
  208. data/doc/ep_flux/math-doc/document/img27.png +0 -0
  209. data/doc/ep_flux/math-doc/document/img28.png +0 -0
  210. data/doc/ep_flux/math-doc/document/img29.png +0 -0
  211. data/doc/ep_flux/math-doc/document/img3.png +0 -0
  212. data/doc/ep_flux/math-doc/document/img30.png +0 -0
  213. data/doc/ep_flux/math-doc/document/img31.png +0 -0
  214. data/doc/ep_flux/math-doc/document/img32.png +0 -0
  215. data/doc/ep_flux/math-doc/document/img33.png +0 -0
  216. data/doc/ep_flux/math-doc/document/img34.png +0 -0
  217. data/doc/ep_flux/math-doc/document/img35.png +0 -0
  218. data/doc/ep_flux/math-doc/document/img36.png +0 -0
  219. data/doc/ep_flux/math-doc/document/img37.png +0 -0
  220. data/doc/ep_flux/math-doc/document/img38.png +0 -0
  221. data/doc/ep_flux/math-doc/document/img39.png +0 -0
  222. data/doc/ep_flux/math-doc/document/img4.png +0 -0
  223. data/doc/ep_flux/math-doc/document/img40.png +0 -0
  224. data/doc/ep_flux/math-doc/document/img41.png +0 -0
  225. data/doc/ep_flux/math-doc/document/img42.png +0 -0
  226. data/doc/ep_flux/math-doc/document/img43.png +0 -0
  227. data/doc/ep_flux/math-doc/document/img44.png +0 -0
  228. data/doc/ep_flux/math-doc/document/img45.png +0 -0
  229. data/doc/ep_flux/math-doc/document/img46.png +0 -0
  230. data/doc/ep_flux/math-doc/document/img47.png +0 -0
  231. data/doc/ep_flux/math-doc/document/img48.png +0 -0
  232. data/doc/ep_flux/math-doc/document/img49.png +0 -0
  233. data/doc/ep_flux/math-doc/document/img5.png +0 -0
  234. data/doc/ep_flux/math-doc/document/img50.png +0 -0
  235. data/doc/ep_flux/math-doc/document/img51.png +0 -0
  236. data/doc/ep_flux/math-doc/document/img52.png +0 -0
  237. data/doc/ep_flux/math-doc/document/img53.png +0 -0
  238. data/doc/ep_flux/math-doc/document/img54.png +0 -0
  239. data/doc/ep_flux/math-doc/document/img55.png +0 -0
  240. data/doc/ep_flux/math-doc/document/img56.png +0 -0
  241. data/doc/ep_flux/math-doc/document/img57.png +0 -0
  242. data/doc/ep_flux/math-doc/document/img58.png +0 -0
  243. data/doc/ep_flux/math-doc/document/img59.png +0 -0
  244. data/doc/ep_flux/math-doc/document/img6.png +0 -0
  245. data/doc/ep_flux/math-doc/document/img60.png +0 -0
  246. data/doc/ep_flux/math-doc/document/img61.png +0 -0
  247. data/doc/ep_flux/math-doc/document/img62.png +0 -0
  248. data/doc/ep_flux/math-doc/document/img63.png +0 -0
  249. data/doc/ep_flux/math-doc/document/img64.png +0 -0
  250. data/doc/ep_flux/math-doc/document/img65.png +0 -0
  251. data/doc/ep_flux/math-doc/document/img66.png +0 -0
  252. data/doc/ep_flux/math-doc/document/img67.png +0 -0
  253. data/doc/ep_flux/math-doc/document/img68.png +0 -0
  254. data/doc/ep_flux/math-doc/document/img69.png +0 -0
  255. data/doc/ep_flux/math-doc/document/img7.png +0 -0
  256. data/doc/ep_flux/math-doc/document/img70.png +0 -0
  257. data/doc/ep_flux/math-doc/document/img71.png +0 -0
  258. data/doc/ep_flux/math-doc/document/img72.png +0 -0
  259. data/doc/ep_flux/math-doc/document/img73.png +0 -0
  260. data/doc/ep_flux/math-doc/document/img74.png +0 -0
  261. data/doc/ep_flux/math-doc/document/img75.png +0 -0
  262. data/doc/ep_flux/math-doc/document/img76.png +0 -0
  263. data/doc/ep_flux/math-doc/document/img77.png +0 -0
  264. data/doc/ep_flux/math-doc/document/img78.png +0 -0
  265. data/doc/ep_flux/math-doc/document/img79.png +0 -0
  266. data/doc/ep_flux/math-doc/document/img8.png +0 -0
  267. data/doc/ep_flux/math-doc/document/img80.png +0 -0
  268. data/doc/ep_flux/math-doc/document/img81.png +0 -0
  269. data/doc/ep_flux/math-doc/document/img82.png +0 -0
  270. data/doc/ep_flux/math-doc/document/img83.png +0 -0
  271. data/doc/ep_flux/math-doc/document/img84.png +0 -0
  272. data/doc/ep_flux/math-doc/document/img85.png +0 -0
  273. data/doc/ep_flux/math-doc/document/img86.png +0 -0
  274. data/doc/ep_flux/math-doc/document/img87.png +0 -0
  275. data/doc/ep_flux/math-doc/document/img88.png +0 -0
  276. data/doc/ep_flux/math-doc/document/img89.png +0 -0
  277. data/doc/ep_flux/math-doc/document/img9.png +0 -0
  278. data/doc/ep_flux/math-doc/document/img90.png +0 -0
  279. data/doc/ep_flux/math-doc/document/img91.png +0 -0
  280. data/doc/ep_flux/math-doc/document/img92.png +0 -0
  281. data/doc/ep_flux/math-doc/document/img93.png +0 -0
  282. data/doc/ep_flux/math-doc/document/img94.png +0 -0
  283. data/doc/ep_flux/math-doc/document/img95.png +0 -0
  284. data/doc/ep_flux/math-doc/document/img96.png +0 -0
  285. data/doc/ep_flux/math-doc/document/img97.png +0 -0
  286. data/doc/ep_flux/math-doc/document/img98.png +0 -0
  287. data/doc/ep_flux/math-doc/document/img99.png +0 -0
  288. data/doc/ep_flux/math-doc/document/index.html +101 -0
  289. data/doc/ep_flux/math-doc/document/internals.pl +258 -0
  290. data/doc/ep_flux/math-doc/document/labels.pl +265 -0
  291. data/doc/ep_flux/math-doc/document/next.png +0 -0
  292. data/doc/ep_flux/math-doc/document/next_g.png +0 -0
  293. data/doc/ep_flux/math-doc/document/node1.html +104 -0
  294. data/doc/ep_flux/math-doc/document/node10.html +164 -0
  295. data/doc/ep_flux/math-doc/document/node11.html +86 -0
  296. data/doc/ep_flux/math-doc/document/node12.html +166 -0
  297. data/doc/ep_flux/math-doc/document/node13.html +897 -0
  298. data/doc/ep_flux/math-doc/document/node14.html +1065 -0
  299. data/doc/ep_flux/math-doc/document/node15.html +72 -0
  300. data/doc/ep_flux/math-doc/document/node16.html +81 -0
  301. data/doc/ep_flux/math-doc/document/node2.html +82 -0
  302. data/doc/ep_flux/math-doc/document/node3.html +91 -0
  303. data/doc/ep_flux/math-doc/document/node4.html +149 -0
  304. data/doc/ep_flux/math-doc/document/node5.html +330 -0
  305. data/doc/ep_flux/math-doc/document/node6.html +99 -0
  306. data/doc/ep_flux/math-doc/document/node7.html +98 -0
  307. data/doc/ep_flux/math-doc/document/node8.html +83 -0
  308. data/doc/ep_flux/math-doc/document/node9.html +140 -0
  309. data/doc/ep_flux/math-doc/document/prev.png +0 -0
  310. data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
  311. data/doc/ep_flux/math-doc/document/up.png +0 -0
  312. data/doc/ep_flux/math-doc/document/up_g.png +0 -0
  313. data/doc/gdir.html +412 -0
  314. data/doc/gdir_client.html +16 -0
  315. data/doc/gdir_connect_ftp-like.html +61 -0
  316. data/doc/gdir_server.html +45 -0
  317. data/doc/ggraph.html +1119 -0
  318. data/doc/gpcat.html +45 -0
  319. data/doc/gpcut.html +47 -0
  320. data/doc/gphys.html +624 -0
  321. data/doc/gphys_fft.html +324 -0
  322. data/doc/gphys_grads_io.html +69 -0
  323. data/doc/gphys_grib_io.html +82 -0
  324. data/doc/gphys_io.html +183 -0
  325. data/doc/gphys_io_common.html +18 -0
  326. data/doc/gphys_netcdf_io.html +283 -0
  327. data/doc/gplist.html +24 -0
  328. data/doc/gpmath.html +52 -0
  329. data/doc/gpmaxmin.html +32 -0
  330. data/doc/gpprint.html +35 -0
  331. data/doc/gpview.html +349 -0
  332. data/doc/grads2nc_with_gphys.html +21 -0
  333. data/doc/grads_gridded.html +307 -0
  334. data/doc/grib.html +149 -0
  335. data/doc/grid.html +224 -0
  336. data/doc/index.html +145 -0
  337. data/doc/index.rd +138 -0
  338. data/doc/netcdf_convention.html +136 -0
  339. data/doc/unumeric.html +176 -0
  340. data/doc/update +69 -0
  341. data/doc/update_rdoc +8 -0
  342. data/doc/varray.html +299 -0
  343. data/doc/varraycomposite.html +67 -0
  344. data/ext_init.c +1 -0
  345. data/extconf.rb +16 -6
  346. data/gphys.gemspec +33 -26
  347. data/interpo.c +1 -1
  348. data/lib/numru/dclext.rb +718 -546
  349. data/lib/numru/derivative.rb +2 -0
  350. data/lib/numru/ganalysis.rb +38 -0
  351. data/lib/numru/ganalysis/beta_plane.rb +103 -0
  352. data/lib/numru/ganalysis/eof.rb +3 -2
  353. data/lib/numru/ganalysis/fitting.rb +559 -0
  354. data/lib/numru/ganalysis/histogram.rb +36 -19
  355. data/lib/numru/ganalysis/log_p.rb +130 -0
  356. data/lib/numru/ganalysis/met.rb +396 -2
  357. data/lib/numru/ganalysis/met_z.rb +300 -0
  358. data/lib/numru/ganalysis/planet.rb +17 -7
  359. data/lib/numru/ganalysis/qg.rb +685 -0
  360. data/lib/numru/ganalysis/sigma_coord.rb +90 -0
  361. data/lib/numru/gdir.rb +2 -1
  362. data/lib/numru/ggraph.rb +204 -60
  363. data/lib/numru/ggraph_on_merdional_section.rb +1 -1
  364. data/lib/numru/gphys.rb +6 -0
  365. data/lib/numru/gphys/assoccoords.rb +18 -3
  366. data/lib/numru/gphys/axis.rb +209 -8
  367. data/lib/numru/gphys/derivative.rb +11 -0
  368. data/lib/numru/gphys/gphys.rb +539 -48
  369. data/lib/numru/gphys/gphys_dim_op.rb +331 -0
  370. data/lib/numru/gphys/gphys_fft.rb +48 -2
  371. data/lib/numru/gphys/gphys_io.rb +241 -13
  372. data/lib/numru/gphys/gphys_netcdf_io.rb +77 -39
  373. data/lib/numru/gphys/gphys_nusdas_io.rb +3 -0
  374. data/lib/numru/gphys/grib.rb +133 -54
  375. data/lib/numru/gphys/grib_params.rb +26 -3
  376. data/lib/numru/gphys/grid.rb +75 -34
  377. data/lib/numru/gphys/interpolate.rb +24 -10
  378. data/lib/numru/gphys/mdstorage.rb +160 -0
  379. data/lib/numru/gphys/netcdf_convention.rb +4 -2
  380. data/lib/numru/gphys/subsetmapping.rb +0 -1
  381. data/lib/numru/gphys/unumeric.rb +50 -5
  382. data/lib/numru/gphys/varray.rb +15 -30
  383. data/lib/numru/gphys/varraycomposite.rb +107 -24
  384. data/lib/numru/gphys/varraynetcdf.rb +9 -3
  385. data/lib/numru/gphys/version.rb +5 -0
  386. data/sample/druby_cli1.rb +2 -0
  387. data/sample/druby_cli2.rb +0 -6
  388. data/sample/druby_serv2.rb +0 -13
  389. data/spec/gphys_spec.rb +11 -0
  390. data/spec/spec_helper.rb +2 -0
  391. data/test/test_assoccoords.rb +102 -0
  392. data/test/test_axis.rb +61 -0
  393. data/test/test_fitting.rb +116 -0
  394. data/test/test_gphys.rb +20 -0
  395. data/test/test_met_z.rb +96 -0
  396. data/test/test_sigma_coord.rb +50 -0
  397. data/{test → test_old}/eof_slp.rb +0 -0
  398. data/{test → test_old}/mltbit.dat +0 -0
  399. data/{test → test_old}/test_ep_flux.rb +0 -0
  400. data/{test → test_old}/test_multibitIO.rb +0 -0
  401. metadata +530 -191
  402. data/README.md +0 -29
  403. data/lib/gphys.rb +0 -2
  404. data/lib/numru/dclext_datetime_ax.rb +0 -220
  405. data/lib/version.rb +0 -3
@@ -262,7 +262,7 @@ PARAM_RDN_LWTOP = 114
262
262
  PARAM_RDN_LW = 115
263
263
  PARAM_RDN_SW = 116
264
264
  PARAM_RDN_GLBL = 117
265
- #PARAM_BRTMP = 118
265
+ PARAM_BRTMP = 118
266
266
  #PARAM_LWRAD = 119
267
267
  #PARAM_SWRAD = 120
268
268
  PARAM_LAT_HT = 121
@@ -529,7 +529,7 @@ NAMES_UNITS = {
529
529
  PARAM_PTND => ["Pressure tendency", "PTEND", "Pa/s", "tendency_of_air_pressure"],
530
530
  # PARAM_ICAHT => nil,
531
531
  PARAM_GPT => ["Geopotential", "GP", "m2/s2", "geopotential"],
532
- PARAM_GPT_HGT => ["Geopotential height", "HGTZ", "Gpm", "geopotential_height"],
532
+ PARAM_GPT_HGT => ["Geopotential height", "HGT", "Gpm", "geopotential_height"],
533
533
  PARAM_GEOM_HGT => ["Geometric height", "DIST", "M", "altitude"],
534
534
  PARAM_HSTDV => ["Standard deviation of height", "HSTDV", "M", "equivalent_thickness_at_stp_of_atmosphere_o3_content"],
535
535
  PARAM_TOZNE => ["Total ozone", "TOZNE", "Dobson", "equivalent_thickness_at_stp_of_atmosphere_o3_content"],
@@ -640,7 +640,7 @@ NAMES_UNITS = {
640
640
  PARAM_RDN_LW => ["Long wave radiation", "LWAVR", "W/m2", "net_upward_longwave_flux_in_air"],
641
641
  PARAM_RDN_SW => ["Short wave radiation", "SWAVR", "W/m2", "net_upward_shortwave_flux_in_air"],
642
642
  PARAM_RDN_GLBL => ["Global radiation", "GRAD", "W/m2", "surface_downwelling_shortwave_flux"],
643
- # PARAM_BRTMP => nil,
643
+ PARAM_BRTMP => ["Brightness temperature", "BRTMP", "K", "brightness_temperature"],
644
644
  # PARAM_LWRAD => nil,
645
645
  # PARAM_SWRAD => nil,
646
646
  PARAM_LAT_HT => ["Latent heat net flux", "LHTFL", "W/m2", "surface_upward_latent_heat_flux"],
@@ -1463,3 +1463,26 @@ PARAMS_JMA = {
1463
1463
  251 => PARAM_LWHR,
1464
1464
  253 => PARAM_LRGMR,
1465
1465
  }
1466
+
1467
+ ## JRA parameter code table
1468
+ ## JRA-55: Code Table 200:
1469
+ ## http://rda.ucar.edu/datasets/ds628.0/#metadata/grib.html?_do=y
1470
+ ## Ref JRA-25:
1471
+ ## http://rda.ucar.edu/datasets/ds625.0/docs/jra-25_grib_table.html
1472
+ ## POT_VOR is also 4 in JRA-25. Otherwise, JRA-25 is supported by
1473
+ ## the PARAMS_JMA table (as of 2014-08)
1474
+ PARAMS_JRA55 = PARAMS_2.merge( PARAMS_JMA )
1475
+ PARAMS_JRA55[4] = PARAM_POT_VOR
1476
+ PARAMS_JRA55[118] = PARAM_BRTMP # 118 is mean surface pressure in JRA-25
1477
+ PARAMS_JRA55[221] = PARAM_CLWMR
1478
+ PARAMS_JRA55[225] = PARAM_SOILW
1479
+ =begin
1480
+ Yet to be supported (JRA-55)
1481
+ 190 UTHE Zonal thermal energy flux W m-1
1482
+ 191 VTHE Meridional thermal energy flux W m-1
1483
+ 226 SMC Mass concentration of condensed water in soil kg m-3
1484
+ 227 CW Cloud liquid water kg m-2
1485
+ 228 CLWC Cloud liquid water kg kg-1
1486
+ 229 CIWC Cloud ice kg kg-1
1487
+ 252 VTYPE Type of vegetation code
1488
+ =end
@@ -186,16 +186,16 @@ A class to handle discretized grids of physical quantities.
186
186
  # RETURN VALUE
187
187
  # * self
188
188
  #
189
- #---insert_axis(dim_or_dimname, axis)
190
- # Inserts an axis. (Returns a new object)
191
- #
192
- # ARGUMENTS
193
- # * dim_or_dimname (String or Integer) to specify an axis.
194
- # * axis (Axis)
195
- #
196
- # RETURN VALUE
197
- # * a Grid
198
- #
189
+ ---insert_axis(dim, axis)
190
+ Inserts an axis. (non destructive; returns a new object)
191
+
192
+ ARGUMENTS
193
+ * dim (Integer) to specify the position to insert
194
+ * axis (Axis)
195
+
196
+ RETURN VALUE
197
+ * a Grid
198
+
199
199
  #---insert_axis!(dim_or_dimname, axis)
200
200
  # Inserts an axis. (overwrites self)
201
201
  #
@@ -225,11 +225,12 @@ module NumRu
225
225
  def initialize( *axes )
226
226
  @axes = Array.new
227
227
  axes.each{|ag|
228
- if ag.is_a?(Axis)
229
- @axes.push(ag)
230
- else
231
- raise ArgumentError, "each argument must be an Axis"
232
- end
228
+ ### commented out for the duck typing:
229
+ #if ag.is_a?(Axis)
230
+ @axes.push(ag)
231
+ #else
232
+ # raise ArgumentError, "each argument must be an Axis"
233
+ #end
233
234
  }
234
235
  @lost_axes = Array.new # Array of String
235
236
  @rank = @axes.length
@@ -409,7 +410,18 @@ module NumRu
409
410
  newgrid = self.class.new( *newaxes )
410
411
  newgrid.set_lost_axes( @lost_axes.dup )
411
412
  if @assoc_coords
412
- newgrid.assoc_coords=@assoc_coords.subset_having_axnames(newgrid.axnames)
413
+ if deleted_by && VArray::NArray_type3_methods.include?(deleted_by)
414
+ assoc_coords = Array.new
415
+ assoccoordnames.each do |aname|
416
+ g = assoc_coord_gphys(aname)
417
+ args = g.axnames & at.collect{|i| @axnames[i]}
418
+ g = g.mean(*args) unless args.empty?
419
+ assoc_coords.push g if GPhys === g
420
+ end
421
+ newgrid.set_assoc_coords assoc_coords
422
+ else
423
+ newgrid.assoc_coords = @assoc_coords.subset_having_axnames(newgrid.axnames)
424
+ end
413
425
  end
414
426
 
415
427
  if !deleted_by
@@ -466,6 +478,26 @@ module NumRu
466
478
  end
467
479
  alias shape_current shape
468
480
 
481
+ # similar to [] but only for cut
482
+ def _new_grid_for_cut(slicer, axes)
483
+ axs = Array.new
484
+ lost = self.lost_axes #Array.new
485
+ for i in 0...rank
486
+ if axes[i].is_a?(String)
487
+ lost.push( axes[i] )
488
+ else
489
+ axs.push( axes[i] )
490
+ end
491
+ end
492
+ grid = self.class.new( *axs )
493
+ grid.set_lost_axes( lost ) if lost.length != 0
494
+ if @assoc_coords
495
+ grid.assoc_coords = @assoc_coords[*slicer]
496
+ end
497
+ grid
498
+ end
499
+ private :_new_grid_for_cut
500
+
469
501
  def [] (*slicer)
470
502
  if slicer.length == 0
471
503
  # make a clone
@@ -481,15 +513,14 @@ module NumRu
481
513
  lost = self.lost_axes #Array.new
482
514
  for i in 0...rank
483
515
  ax = @axes[i][slicer[i]]
484
- if ax.is_a?(Axis) # else its rank became zero (lost)
485
- axes.push( ax )
516
+ if ax.is_a?(String)
517
+ lost.push( ax )
486
518
  else
487
- lost.push( ax )
519
+ axes.push( ax )
488
520
  end
489
521
  end
490
522
  grid = self.class.new( *axes )
491
523
  grid.set_lost_axes( lost ) if lost.length != 0
492
- grid
493
524
  end
494
525
  if @assoc_coords
495
526
  grid.assoc_coords = @assoc_coords[*slicer]
@@ -550,17 +581,18 @@ module NumRu
550
581
  end
551
582
 
552
583
  slicer = Array.new
584
+ axes = Array.new
553
585
 
554
586
  for dim in 0...rank
555
587
  ax = @axes[dim]
556
588
  if conserve_rank
557
- dummy, slicer[dim] = ax.cut_rank_conserving(args[dim])
589
+ axes[dim], slicer[dim] = ax.cut_rank_conserving(args[dim])
558
590
  else
559
- dummy, slicer[dim] = ax.cut(args[dim])
591
+ axes[dim], slicer[dim] = ax.cut(args[dim])
560
592
  end
561
593
  end
562
594
 
563
- [ self[*slicer], slicer ]
595
+ [ _new_grid_for_cut(slicer,axes), slicer ]
564
596
  end
565
597
  private :_cut_
566
598
 
@@ -599,17 +631,6 @@ module NumRu
599
631
  # self
600
632
  # end
601
633
 
602
- # def insert_axis(dim_or_dimname, axis)
603
- # dim = dim_index(dim_or_dimname)
604
- # axes = @axes.dup
605
- # if axis.is_a?(Axis)
606
- # axes[dim+1,0] = axis # axes.insert(dim, axis) if ruby 1.7
607
- # else
608
- # # do nothing
609
- # end
610
- # self.class.new( *axes )
611
- # end
612
-
613
634
  # def insert_axis!(dim_or_dimname, axis)
614
635
  # dim = dim_index(dim_or_dimname)
615
636
  # if axis == nil
@@ -622,6 +643,20 @@ module NumRu
622
643
  # self
623
644
  # end
624
645
 
646
+ def insert_axis(dim, axis)
647
+ axes = @axes.dup
648
+ ### commented out for the duck typing:
649
+ #if axis.is_a?(Axis)
650
+ axes.insert(dim, axis)
651
+ #else
652
+ # raise ArgumentError, "2nd arg must be an Axis"
653
+ #end
654
+ grid = self.class.new( *axes )
655
+ grid.set_lost_axes( lost_axes )
656
+ grid.assoc_coords = @assoc_coords.dup if @assoc_coords
657
+ grid
658
+ end
659
+
625
660
  def transpose( *dims )
626
661
  if dims.sort != NArray.int(rank).indgen!.to_a
627
662
  raise ArgumentError,
@@ -719,5 +754,11 @@ if $0 == __FILE__
719
754
  p grid.delete_axes([0,1], 'mean').lost_axes
720
755
 
721
756
  p grid, grid.transpose(1,0)
757
+
758
+ puts "Test insert_axis..."
759
+ vz = VArray.new( NArray.float(3).indgen! + 10 ).rename("z")
760
+ zax = Axis.new().set_pos(vz)
761
+ grid3 = grid.insert_axis(-1,zax)
762
+ p grid3
722
763
  end
723
764
 
@@ -477,11 +477,18 @@ module NumRu
477
477
  f2 = NArray.float(len)
478
478
  for j in 0...len
479
479
  ## [�J������] (������) ���̃��[�v��C�ɂ����ق��������i1D�Ȃ̂ł܂��������ǁC����2D�̂�����Ȃ�ꏏ�Ɂj�D���̍ہCg2ictr �͒T�������������ĂȂ��̂ŁCinterpo_find_loc_1D ��2D�ł̒T����������� g2ibl2 �𒼐ڌĂԕ��������D
480
- uxi, uyi = DCL.g2ictr(txi[j], tyi[j])
481
- ids1[j] = [ [uxi.floor,0].max, uxg.length-2 ].min
482
- ids2[j] = [ [uyi.floor,0].max, uyg.length-2 ].min
483
- f1[j] = uxi - ids1[j]
484
- f2[j] = uyi - ids2[j]
480
+ begin
481
+ uxi, uyi = DCL.g2ictr(txi[j], tyi[j])
482
+ ids1[j] = [ [uxi.floor,0].max, uxg.length-2 ].min
483
+ ids2[j] = [ [uyi.floor,0].max, uyg.length-2 ].min
484
+ f1[j] = uxi - ids1[j]
485
+ f2[j] = uyi - ids2[j]
486
+ rescue
487
+ ids1[j] = -999
488
+ ids2[j] = -999
489
+ f1[j] = 0.0
490
+ f2[j] = 0.0
491
+ end
485
492
  end
486
493
  idxmap.push( [ od[0], m[1][0][0], nil, ids1, f1] ) # mapping from 1D
487
494
  idxmap.push( [ od[1], m[1][0][0], nil, ids2, f2] ) # mapping from 1D
@@ -497,11 +504,18 @@ module NumRu
497
504
  for k in 0...leny
498
505
  for j in 0...lenx
499
506
  ## [�J������] (������) ���̃��[�v��C�ɂ����ق�������(2D��������)�D���̍ہCg2ictr �͒T�������������ĂȂ��̂ŁCinterpo_find_loc_1D ��2D�ł̒T����������� g2ibl2 �𒼐ڌĂԕ��������D
500
- uxi, uyi = DCL.g2ictr(txi[j], tyi[k])
501
- ids1[j,k] = [ [uxi.floor,0].max, uxg.length-2 ].min
502
- ids2[j,k] = [ [uyi.floor,0].max, uyg.length-2 ].min
503
- f1[j,k] = uxi - ids1[j,k]
504
- f2[j,k] = uyi - ids2[j,k]
507
+ begin
508
+ uxi, uyi = DCL.g2ictr(txi[j], tyi[k])
509
+ ids1[j,k] = [ [uxi.floor,0].max, uxg.length-2 ].min
510
+ ids2[j,k] = [ [uyi.floor,0].max, uyg.length-2 ].min
511
+ f1[j,k] = uxi - ids1[j,k]
512
+ f2[j,k] = uyi - ids2[j,k]
513
+ rescue
514
+ ids1[j,k] = -999
515
+ ids2[j,k] = -999
516
+ f1[j] = 0.0
517
+ f2[j] = 0.0
518
+ end
505
519
  end
506
520
  end
507
521
  idxmap.push( [ od[0], m[1][0][0], [m[1][1][0]], ids1, f1] ) # mapping from 2D
@@ -0,0 +1,160 @@
1
+ require "narray"
2
+
3
+ module NumRu
4
+ class MDStorage
5
+ def initialize(rank=1)
6
+ raise(ArgumentError,"rank must be a positive integer") if !(rank>0)
7
+ @rank = rank
8
+ @shape = []
9
+ rank.times{@shape.push(1)}
10
+ @data = [nil]
11
+ (rank-1).times{
12
+ @data = [@data]
13
+ }
14
+ end
15
+
16
+ attr_reader :rank
17
+
18
+ def shape
19
+ @shape.dup
20
+ end
21
+
22
+ # add a new dimension to the last
23
+ def add_dim
24
+ @rank += 1
25
+ @shape.push(1)
26
+ @data = [@data]
27
+ end
28
+
29
+ # increase the length of a dimension by one
30
+ def extend(dim)
31
+ if dim<0 or dim>=rank
32
+ raise(ArgumentError,"invalid dim (#{dim}): not in #{0..rank-1}")
33
+ end
34
+ yield_at_depth(@data,rank-1-dim){|a|
35
+ a.push( dim==0 ? nil : make_nested_array(shape[0..dim-1]) )
36
+ }
37
+ @shape[dim] += 1
38
+ self
39
+ end
40
+
41
+ # substituion at a position specified with integers (only one element)
42
+ def []=(*args)
43
+ val = args.pop
44
+ raise(ArgumentError,"# of args != rank (#{rank})") if args.length != rank
45
+ x = @data
46
+ (rank-1).downto(1) do |d|
47
+ idx = args[d]
48
+ raise(ArgumentError,"all args must be integers") if !idx.is_a?(Integer)
49
+ len = shape[d]
50
+ idx += len if idx<0
51
+ raise("Too big negative index for dim #{d}: #{idx-len}") if idx<0
52
+ if 0<=idx and idx<len
53
+ x = x[idx]
54
+ elsif idx >= len
55
+ (idx-len+1).times{extend(d)}
56
+ x = x[idx]
57
+ else
58
+ raise(ArgumentError,"invalid specification")
59
+ end
60
+ end
61
+
62
+ idx = args[0]
63
+ len = shape[0]
64
+ idx += len if idx<0
65
+ raise("Too big negative index for dim #{0}: #{idx-len}") if idx<0
66
+ if idx >= len
67
+ (idx-len+1).times{extend(0)}
68
+ end
69
+ x[idx] = val
70
+ end
71
+
72
+ # read from a position specified with integers (only one element)
73
+ def [](*args)
74
+ raise(ArgumentError,"# of args != rank (#{rank})") if args.length != rank
75
+ x = @data
76
+ args.reverse_each do |idx|
77
+ raise(ArgumentError,"all args must be integers") if !idx.is_a?(Integer)
78
+ x = x[idx]
79
+ return(x) if x.nil?
80
+ end
81
+ x
82
+ end
83
+
84
+ def to_na
85
+ NArray.to_na(@data)
86
+ end
87
+
88
+ # count the total length (including nil)
89
+ def length
90
+ len = 1
91
+ @shape.each{|s| len *= s}
92
+ len
93
+ end
94
+
95
+ # count the number of non-nil objects
96
+ def count_non_nil
97
+ a = @data.flatten
98
+ a.delete(nil)
99
+ a.length
100
+ end
101
+
102
+ #############################################
103
+ ## < private methods >
104
+ private
105
+ =begin
106
+ def __rubber_expansion( args )
107
+ if (id = args.index(false)) # substitution into id
108
+ # false is incuded
109
+ alen = args.length
110
+ if args.rindex(false) != id
111
+ raise ArguemntError,"only one rubber dimension is permitted"
112
+ elsif alen > rank+1
113
+ raise ArgumentError, "too many args"
114
+ end
115
+ ar = ( id!=0 ? args[0..id-1] : [] )
116
+ args = ar + [true]*(rank-alen+1) + args[id+1..-1]
117
+ end
118
+ args
119
+ end
120
+ =end
121
+
122
+ # make a neste multi-D Array filled with nil
123
+ def make_nested_array(shape)
124
+ if shape.length == 1
125
+ Array.new(shape[0]) # => [nil,nil,...,nil]
126
+ elsif shape.length > 1 # recursive construction
127
+ (0...shape[-1]).collect{make_nested_array(shape[0..-2])}
128
+ else
129
+ raise ArgumentError, "shape must have 1 or more elements"
130
+ end
131
+ end
132
+
133
+ # call the block at the depth in the nested array
134
+ def yield_at_depth(ary,depth, &blk)
135
+ if depth==0
136
+ blk.call(ary) # call the block
137
+ elsif depth>0
138
+ ary.each{|sub| yield_at_depth(sub,depth-1,&blk)}
139
+ else
140
+ raise ArgumentError, "depth must be >= 0"
141
+ end
142
+ end
143
+ end
144
+ end
145
+
146
+ if $0 == __FILE__
147
+ include NumRu
148
+ a = MDStorage.new(3)
149
+ p a
150
+ p a.extend(2)
151
+ p a.extend(2)
152
+ p a.extend(0)
153
+ a[0,0,0] = 10.9
154
+ a[1,0,-1] = "XX"
155
+ p a, a[0,0,0], a[1,0,-1]
156
+ a[2,0,2] = '###'
157
+ p a
158
+ p a.to_na
159
+ p a.length, a.count_non_nil
160
+ end
@@ -328,10 +328,12 @@ module NumRu
328
328
  nms = s.split(/ +/)
329
329
  case data.file
330
330
  when NArray
331
- nms.delete_if{|nm| !data.file[0].var(nm)}
331
+ fl = data.file[0]
332
332
  else
333
- nms.delete_if{|nm| !data.file.var(nm)}
333
+ fl = data.file
334
334
  end
335
+ nms.delete_if{|nm| !fl.var(nm)}
336
+ nms.delete_if{|nm| fl.dim_names.include?(nm)}
335
337
  nms
336
338
  else
337
339
  nil