gphys 1.2.2.1 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -25,7 +25,6 @@ module NumRu
25
25
  if slicer.length == 0
26
26
  @maps = Array.new
27
27
  for i in 0...len do
28
- p shape[i],0..-1
29
28
  @maps[i] = SubsetMapping1D.new(shape[i],0..-1)
30
29
  end
31
30
  else
@@ -183,6 +183,50 @@ module NumRu
183
183
  @val, @uni = val, uni
184
184
  end
185
185
 
186
+ ##########################
187
+ # Tentative class to assist basic arithmetic operations between
188
+ # quantities without (like Numeric) and with (like UNumeric) units.
189
+ #
190
+ # The fundamental problem here is that the desired unit conversion
191
+ # to convert the Numeric is different between additional methods (+,-)
192
+ # and multiplicative methods (*,/). In the former, the
193
+ # numeric should be converted to have the same units with
194
+ # the other operand, and in the latter, it should be
195
+ # non-dimensional.
196
+ #
197
+ class Num2Coerce
198
+ # * num (Numeric, NArray etc -- numeric-like object without units).
199
+ # It must be KNOWN by the other operand.
200
+ def initialize(num)
201
+ @num = num
202
+ end
203
+
204
+ def num; @num; end
205
+
206
+ def +(o); o + num; end
207
+ def -(o); (-o) + num; end
208
+ def *(o); o * num; end
209
+ def /(o); o**(-1) * num;end
210
+
211
+ def >(o); o<num; end
212
+ def <(o); o>num; end
213
+ def >=(o); o<=num; end
214
+ def <=(o); o>=num; end
215
+ def ==(o); o==num; end
216
+ def ===(o); o===num; end
217
+
218
+ def <=>(o); c = o<=>num or -c; end
219
+
220
+ ['%','**','divmod'].each do |op|
221
+ eval <<-EOS
222
+ def #{op}(o)
223
+ raise("operation #{op} is unavailable between Numeric and "+o.class.to_s)
224
+ end
225
+ EOS
226
+ end
227
+ end
228
+ ##########################
229
+
186
230
  def self::[](val, uni)
187
231
  new(val, uni)
188
232
  end
@@ -368,11 +412,11 @@ module NumRu
368
412
  def coerce(other)
369
413
  case
370
414
  when Numeric
371
- c_other = UNumeric.new( other, Units.new("1") )
372
- when Array
373
- c_other = VArray.new( NArray.to_na(other) )
374
- when NArray
375
- c_other = VArray.new( other )
415
+ c_other = Num2Coerce.new( other )
416
+ #when Array
417
+ # c_other = VArray.new( NArray.to_na(other) )
418
+ #when NArray
419
+ # c_other = VArray.new( other )
376
420
  else
377
421
  raise "#{self.class}: cannot coerce #{other.class}"
378
422
  end
@@ -518,6 +562,7 @@ if $0 == __FILE__
518
562
  p a*7
519
563
  p -a
520
564
  p a-b, a-1000, a/100
565
+ p 1 + a
521
566
  p a.log, a.sin
522
567
  p UNumeric[1.0,Units['1']].atan2( UNumeric[1.0,Units['1']] )
523
568
 
@@ -547,7 +547,14 @@ These methods returns a NArray (not a VArray).
547
547
  end
548
548
  myunits = self.units
549
549
  if myunits != to
550
- gp = myunits.convert2(self, to)
550
+ if calendar = self.get_att("calendar")
551
+ date0 = UNumeric.new(0,myunits).to_datetime
552
+ un0 = UNumeric.from_date(date0,to,calendar)
553
+ offset = un0.to_f
554
+ gp = self + offset
555
+ else
556
+ gp = myunits.convert2(self, to)
557
+ end
551
558
  gp.units = to
552
559
  gp
553
560
  else
@@ -619,22 +626,7 @@ These methods returns a NArray (not a VArray).
619
626
  end
620
627
 
621
628
  def axis_cyclic?
622
- # Default setting is taken from a widely used netcdf convention.
623
- # You can override it in a sub-class or using convention specific
624
- # mixins.
625
- topology = attr['topology']
626
- case topology
627
- when /circular/i
628
- true
629
- when nil # 'topology' not defined
630
- if /degrees?_east/ =~ attr['units']
631
- true # special treatment a common convention for the earth
632
- else
633
- nil # not defined --> nil
634
- end
635
- else
636
- false
637
- end
629
+ axis_modulo != nil
638
630
  end
639
631
 
640
632
  def axis_modulo
@@ -681,23 +673,16 @@ These methods returns a NArray (not a VArray).
681
673
  ## ToDo: coerce
682
674
 
683
675
  def coerce(other)
684
- oattr = self.attr_copy
685
676
  case other
686
677
  when UNumeric
678
+ oattr = self.attr_copy
687
679
  oattr['units'] = other.units.to_s
688
680
  na_other, = NArray.new(self.typecode, 1).coerce(other.val) # scalar
689
681
  c_other = VArray.new(na_other, oattr, self.name)
690
682
  else
691
- oattr['units'] = self.get_att('units') # Assume the same units
692
683
  case other
693
- when Numeric
694
- na_other, = NArray.new(self.typecode, 1).coerce(other) # scalar
695
- c_other = VArray.new(na_other, oattr, self.name)
696
- when Array
697
- na = NArray.to_na(other)
698
- c_other = VArray.new(na, oattr, self.name)
699
- when NArray, NArrayMiss
700
- c_other = VArray.new(other, oattr, self.name)
684
+ when Numeric, Array, NArrayMiss
685
+ c_other = UNumeric::Num2Coerce.new( other )
701
686
  else
702
687
  raise "Cannot coerse #{other.class}"
703
688
  end
@@ -799,7 +784,7 @@ These methods returns a NArray (not a VArray).
799
784
  ary = NArrayMiss.to_nam(vl)#{f}(vr)
800
785
  end
801
786
  va = VArray.new( ary, self.attr_copy, self.name )
802
- va.units= self.units#{f}(other.units)
787
+ va.units= self.units#{f}(other.units) if "#{f}" != "**"
803
788
  va
804
789
  when Numeric, NArray, NArrayMiss, Array
805
790
  vl = self.val
@@ -810,7 +795,7 @@ These methods returns a NArray (not a VArray).
810
795
  ary = NArrayMiss.to_nam(vl)#{f}(vr)
811
796
  end
812
797
  va = VArray.new( ary, self.attr_copy, self.name )
813
- if "#{f}" == "**"
798
+ if "#{f}" == "**" && other.is_a?(Numeric)
814
799
  va.units= self.units#{f}(other)
815
800
  end
816
801
  va
@@ -1072,7 +1057,7 @@ if $0 == __FILE__
1072
1057
  p "*3*",vt.log10
1073
1058
  p "*4*",(vt < vs)
1074
1059
  vt.name='vvvttt'
1075
- p "*5*",(3+vt), vt.sin, vt.cos
1060
+ p "*5*",(3+vt).units.to_s, (3*vt).units.to_s, vt.sin, vt.cos
1076
1061
  vc = vt.copy
1077
1062
  p 'atan2'
1078
1063
  vv = VArray.new( NArray.sfloat(5).indgen!, nil, 'vv' )
@@ -77,24 +77,31 @@ module NumRu
77
77
 
78
78
  nvas = varrays.shape
79
79
  vrank = nvas.length
80
- rank=0
81
80
  varrays.each{|va|
82
- if va.is_a?(VArray)
81
+ if !va.nil?
83
82
  @first_vary = va
84
- @attr = @first_vary.attr
83
+ @attr = @first_vary.attr_copy
85
84
  @name = @first_vary.name
86
- @rank = va.rank
85
+ @crank = va.rank # rank of the component VArrays
87
86
  break
88
87
  end
89
88
  }
90
- if vrank > @rank
91
- raise ArgumentError, "rank of varrays > rank of the VArray"
92
- elsif vrank < @rank
93
- (@rank - vrank).times{
94
- varrays = varrays.newdim(vrank)
95
- nvas.push(1)
96
- }
97
- vrank = @rank
89
+ if vrank > @crank
90
+ @rank = vrank #=> @rank > @crank
91
+ else
92
+ @rank = @crank
93
+ if vrank < @crank
94
+ (@crank - vrank).times{
95
+ varrays = varrays.newdim(vrank)
96
+ nvas.push(1)
97
+ }
98
+ vrank = @crank # rank of varrays is increased to @crank (==@rank)
99
+ end
100
+ end
101
+ un0 = varrays[0].units
102
+ for i in 1...varrays.length
103
+ va = varrays[i]
104
+ varrays[i] = va.convert_units(un0) if va && va.units != un0
98
105
  end
99
106
 
100
107
  @bound_idx = Array.new # will be Array of Array
@@ -106,14 +113,24 @@ module NumRu
106
113
  len=0
107
114
  varrays[*idx].each{|va|
108
115
  if !set && va
109
- if !va.is_a?(VArray)
110
- raise ArgumentError,"Not a VArray: #{va.inspect}"
111
- end
112
- len = va.shape_current[dim]
116
+ ### commented out for the duck typing:
117
+ #if !va.is_a?(VArray)
118
+ # raise ArgumentError,"Not a VArray: #{va.inspect}"
119
+ #end
120
+ if dim < @crank
121
+ len = va.shape_current[dim]
122
+ else
123
+ len = 1
124
+ end
113
125
  @bound_idx[dim][i+1] = @bound_idx[dim][i] + len
114
126
  set=true
115
127
  elsif va
116
- if va.shape_current[dim] != len
128
+ if dim < @crank
129
+ lc = va.shape_current[dim]
130
+ else
131
+ lc = 1
132
+ end
133
+ if lc != len
117
134
  raise ArgumentError,"Non-uniformity in the #{i}th element"+
118
135
  " of the #{dim}th dimension (#{va.shape_current[dim]} for #{len})"
119
136
  end
@@ -165,9 +182,18 @@ module NumRu
165
182
  loop_multi_dim_index( @varrays.shape ){|index|
166
183
  vidx = Array.new
167
184
  for d in 0...@rank
168
- vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
185
+ if d < @crank
186
+ vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
187
+ else
188
+ vidx[d] = @bound_idx[d][index[d]]
189
+ end
169
190
  end
170
- v = @varrays[*index].val
191
+ units = @attr["units"]
192
+ if units
193
+ v = @varrays[*index].convert_units(units).val
194
+ else
195
+ v = @varrays[*index].val
196
+ end
171
197
  if !val
172
198
  if NArray===v
173
199
  val = NArray.new(v.typecode,*@shape)
@@ -177,7 +203,7 @@ module NumRu
177
203
  raise TypeError, "Unexpected type #{v.class}"
178
204
  end
179
205
  end
180
- val[*vidx] = @varrays[*index].val
206
+ val[*vidx] = v
181
207
  }
182
208
  val
183
209
  end
@@ -190,7 +216,11 @@ module NumRu
190
216
  __check_ary_class(narray)
191
217
  vidx = Array.new
192
218
  for d in 0...@rank
193
- vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
219
+ if d < @crank
220
+ vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
221
+ else
222
+ vidx[d] = @bound_idx[d][index[d]]
223
+ end
194
224
  end
195
225
  sub=narray[*vidx]
196
226
  end
@@ -286,12 +316,12 @@ module NumRu
286
316
  idx.each_with_index{ |ix, dim|
287
317
  size = @bound_idx[dim][-1]
288
318
  imask[dim] = Array.new
289
- isub[dim] = Array.new
319
+ isub[dim] = Array.new if dim < @crank
290
320
  for j in 0...(@bound_idx[dim].length)
291
321
  match, isb = _imatch( size, ix, @bound_idx[dim][j..j+1] )
292
322
  if match
293
323
  imask[dim].push(j)
294
- isub[dim].push(isb)
324
+ isub[dim].push(isb) if dim < @crank
295
325
  end
296
326
  end
297
327
  }
@@ -334,6 +364,11 @@ module NumRu
334
364
  stp = 1
335
365
  else # Hash
336
366
  range, stp = index.to_a[0]
367
+ if stp<=0
368
+ raise(ArgumentError,"Currently only positive step is supported")
369
+ # development note: current handling of fst and lst assumes a
370
+ # positive step
371
+ end
337
372
  range = 0..-1 if range==true
338
373
  fst = range.first
339
374
  fst += size if fst < 0
@@ -349,11 +384,28 @@ module NumRu
349
384
  if stp==1
350
385
  return [true, a..b ]
351
386
  else
352
- return [true, {(a..b) => stp} ]
387
+ len = last-first+1
388
+ if a<len
389
+ return [true, {(a..b) => stp} ]
390
+ else
391
+ return [false, nil]
392
+ end
353
393
  end
354
394
  else
355
395
  return [false, nil]
356
396
  end
397
+ when Array
398
+ match = false
399
+ isb = []
400
+ index.each{ |idx|
401
+ idx += size if idx < 0
402
+ if first <= idx && idx <= last
403
+ match = true
404
+ isb.push(idx-first)
405
+ end
406
+ }
407
+ isb = nil if isb == []
408
+ return [match, isb]
357
409
  else
358
410
  raise "Unsupported type for indexing: #{index.class}"
359
411
  end
@@ -412,4 +464,35 @@ if __FILE__ == $0
412
464
  p vac.get_att('long_name')
413
465
  p va01.get_att('long_name')
414
466
  p vac.typecode,vac.ntype
467
+
468
+ puts "testing rank extension.."
469
+ va0 = VArray.new( NArray.float(3,2).indgen!, {"units"=>"m/s"}, 'V' )
470
+ va1 = VArray.new( NArray.float(3,2).indgen!+100, {"units"=>"m/s"}, 'V' )
471
+ va2 = VArray.new( NArray.float(3,2).indgen!+200, {"units"=>"m/s"}, 'V' )
472
+ va3 = VArray.new( NArray.float(3,2).indgen!+300, {"units"=>"m/s"}, 'V' )
473
+ varrays = NArray.to_na([ [[va0]], [[va1]], [[va2]], [[va3]] ])
474
+ vac = VArrayComposite.new(varrays)
475
+ p vac, vac.val
476
+ if vac[1,1,1].val == 104.0
477
+ puts "test OK"
478
+ else
479
+ raise "test failed"
480
+ end
481
+
482
+ v = vac[0..1,0,{1..-1=>2}].val
483
+ ans = NArray.to_na( [ [100.0,101.0], [300.0, 301.0] ] )
484
+ if v==ans
485
+ puts "test OK"
486
+ else
487
+ raise "test failed"
488
+ end
489
+
490
+ vac[-1,true,1..2] = -999.0
491
+ if vac[-1,true,1..2].val.to_a.flatten.uniq == [-999.0 ]
492
+ puts "test OK"
493
+ else
494
+ raise "test failed"
495
+ end
496
+ #vac.val = NArray.float(3,2,4).random!
497
+ #p vac.val
415
498
  end
@@ -55,7 +55,7 @@ module NumRu
55
55
  end
56
56
  end
57
57
  def close
58
- enddef
58
+ enddef rescue nil
59
59
  super
60
60
  end
61
61
  end # module NetCDFDeferred
@@ -216,9 +216,15 @@ module NumRu
216
216
  ## < redefined instance methods > ##
217
217
 
218
218
  def val
219
- mode_switched = @ary.file.enddef
219
+ begin
220
+ mode_switched = @ary.file.enddef
221
+ rescue
222
+ end
220
223
  v = @ary.get
221
- if mode_switched; @ary.file.redef; end
224
+ begin
225
+ if mode_switched; @ary.file.redef; end
226
+ rescue
227
+ end
222
228
  v
223
229
  end
224
230
 
@@ -0,0 +1,5 @@
1
+ module NumRu
2
+ class GPhys
3
+ VERSION = "1.4.3"
4
+ end
5
+ end
@@ -4,6 +4,8 @@
4
4
  # See ./druby_serv1.rb
5
5
 
6
6
  require "drb/drb"
7
+ require "numru/gphys"
8
+ include NumRu
7
9
 
8
10
  DRb.start_service
9
11
  uri = ARGV.shift || raise("Usage: % #{$0} uri")
@@ -17,10 +17,6 @@ p gp.grid.axis(0).pos.name
17
17
  gpmean = gp.mean(0)
18
18
  p gpmean.class, gpmean.name, gpmean.rank
19
19
 
20
- class NArray
21
- def self._load(o) to_na(*Marshal::load(o)).ntoh end
22
- end
23
-
24
20
  p ( gpmean_copy = gpmean.copy )
25
21
  DCL.gropn(1)
26
22
  DCL.sgpset('lfull',true)
@@ -30,5 +26,3 @@ GGraph.set_fig('viewport'=>[0.25,0.7,0.15,0.6], 'itr'=>2 )
30
26
  GGraph.contour( gpmean_copy )
31
27
  DCL.grcls
32
28
 
33
- print "\nThe following will be a DRbObject rather than GPhys since the size is too large\n(see druby_serv2.rb):\n"
34
- p ( gpcopy = gp.copy )
@@ -41,19 +41,6 @@ port = ARGV.shift
41
41
  usage if port && port.to_i.to_s != port
42
42
  usage if ARGV.length > 0
43
43
 
44
- class NArray
45
- DUMP_SIZE_LIMIT = 5000
46
- def self._load(o) to_na(*Marshal::load(o)).ntoh end
47
- def _dump(limit)
48
- if size <= DUMP_SIZE_LIMIT
49
- Marshal::dump([hton.to_s, typecode, *shape])
50
- else
51
- raise "size of the NArray (#{size}) is too large to dump "+
52
- "(limit: #{DUMP_SIZE_LIMIT})"
53
- end
54
- end
55
- end
56
-
57
44
  file = NetCDF.open("../testdata/T.jan.nc")
58
45
  gp = GPhys::NetCDF_IO.open(file,"T")
59
46