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
@@ -525,7 +525,7 @@ module NumRu
525
525
  # Single file. Returns a VArrayNetCDF. dim is ignored.
526
526
  file = files
527
527
  var = file.var( varname )
528
- raise "variable '#{varname}' not found in #{file}" if !var
528
+ raise "variable '#{varname}' not found in #{file.inspect}" if !var
529
529
  VArrayNetCDF.new( var )
530
530
  elsif files.is_a?(NArray)
531
531
  # Suppose that files is a NArray of NetCDF. Returns a VArrayCompsite.
@@ -566,9 +566,30 @@ module NumRu
566
566
  [files, ncvar0]
567
567
  end
568
568
 
569
+ #--
570
+ # re-arrange the array of files and check some inconsistencies
571
+ #
572
+ # e.g.)
573
+ # files = NArray[ file0.nc, file1.nc, file2.nc, file3.nc ]
574
+ # The files have a variable, u(lat,lev,time),
575
+ # which is tiled to four parts as the followings:
576
+ # | lat | lev | time |
577
+ # file0.nc | -90...0 | 1000...500 | 0..1 |
578
+ # file1.nc | 0..90 | 1000...500 | 0..1 |
579
+ # file2.nc | -90...0 | 500..100 | 0..1 |
580
+ # file3.nc | 0..90 | 500..100 | 0..1 |
581
+ #
582
+ # Then the output is
583
+ # NArray[ [ [ file0.nc, file1.nc ],
584
+ # [ file2.nc, file3.nc ] ] ].
585
+ #
586
+ # The order of the elements of the input array is arbitrary.
587
+ #
569
588
  def __files_dim_matching( files, varname )
570
589
  # files: NArray of NetCDF
571
590
 
591
+ return files if files.length == 1
592
+
572
593
  # < read the first file and check its rank >
573
594
 
574
595
  file0 = files[0]
@@ -581,44 +602,61 @@ module NumRu
581
602
 
582
603
  #< find correspoding dimensions >
583
604
 
584
- j2i = Array.new
585
-
586
- for ifl in 0...files.rank
587
- for jdt in 0...ncvar0.rank
588
- axpos_last = nil
589
- for kfl in 0...files.shape[ifl]
590
- nvax = files[*([0]*ifl+[kfl]+[0]*(files.rank-ifl-1))].var(axposnames[jdt])
591
- raise "No coordinate variable: #{axposname}' not found" if !nvax
592
- axpos = VArrayNetCDF.new( nvax )
593
- if kfl > 0
594
- if axpos.length != axpos_last.length
595
- # not equal ==> this is the dimension looking for
596
- j2i[jdt] = ifl
597
- break
598
- else
599
- axv0 = axpos.val[0]
600
- axv_last0 = axpos_last.val[0]
601
- if axv0 != axv_last0
602
- # not equal ==> this is the dimension looking for
603
- j2i[jdt] = ifl
604
- break
605
- end
606
- end
607
- end
608
- axpos_last = axpos
609
- end
610
- break if j2i.include?(ifl)
611
- end
612
- if files.shape[ifl]>1 && !j2i.include?(ifl)
613
- raise "No dimension correpodence found for #{ifl}th dim"
614
- end
615
- end
616
-
617
- for d in files.rank...ncvar0.rank
618
- j2i[ (j2i.index(nil) || files.rank) ] = d
619
- files.newdim!(d)
620
- end
621
- files = files.transpose(*j2i)
605
+ rank = axposnames.length
606
+ cvals = Array.new(rank){ Array.new }
607
+ sign = Array.new(rank)
608
+ units = Array.new(rank)
609
+ files.each do |file|
610
+ axposnames.each_with_index do |axposname, i|
611
+ nvax = file.var(axposname)
612
+ raise "No coordinate variable: #{axposname}' not found" if !nvax
613
+ axpos = VArrayNetCDF.new( nvax )
614
+ axv0 = axpos.val[0]
615
+ if units[i]
616
+ un = axpos.units
617
+ axv0 = un.convert2(axv0,units[i]) unless un == units[i]
618
+ else # the first file
619
+ units[i] = axpos.units
620
+ sign[i] = (axpos.val[-1] >= axv0 ? 1 : -1)
621
+ end
622
+ cvals[i].push axv0
623
+ end
624
+ end
625
+ # For the above example,
626
+ # cvals = [ [ -90, 0, -90, 0 ],
627
+ # [ 1000, 1000, 500, 500 ],
628
+ # [ 0, 0, 0, 0 ] ]
629
+ # sign = [ 1, -1, 1 ]
630
+
631
+ axs = Array.new(rank)
632
+ cvals.each_with_index do |cval, i|
633
+ axs[i] = cval.uniq
634
+ axs[i].sort!{|a,b| (a <=> b)*sign[i] }
635
+ end
636
+ # For the above example,
637
+ # axs = [ [ -90, 0 ], [ 1000, 500 ], [ 0 ] ]
638
+ files_new = NArray.object( *axs.map{|ax| ax.length} )
639
+ # For the above example,
640
+ # shape of the files_new is [2, 2, 1]
641
+ files.length.times do |n|
642
+ file = files[n]
643
+ idx = Array.new(rank)
644
+ rank.times do |i|
645
+ axv0 = cvals[i][n]
646
+ idx[i] = axs[i].index(axv0)
647
+ end
648
+ # For the above example,
649
+ # idx =
650
+ # [ 0, 0, 0 ] for n==0
651
+ # [ 1, 0, 0 ] for n==1
652
+ # [ 0, 1, 0 ] for n==2
653
+ # [ 1, 1, 0 ] for n==3
654
+ files_new[*idx] = file
655
+ end
656
+ if files_new.eq(nil).count_true > 0
657
+ raise "No dimension correspondence found"
658
+ end
659
+ files = files_new
622
660
 
623
661
  files
624
662
  end
@@ -34,6 +34,9 @@ module NumRu
34
34
  unless NuSDaS === nusdas
35
35
  raise ArgumentError, "1st arg must be a NuSDaS of path name"
36
36
  end
37
+ unless (meta = nusdas.instance_variable_get(:@meta)) && meta[:nbasetime] && meta[:nbasetime] > 0
38
+ raise "NuSDaS directory is empty or nusdas_def is inconsistent with data: #{nusdas.path}"
39
+ end
37
40
 
38
41
  var = nusdas.var(varname)
39
42
  var.nil? && raise("#{varname} is not found")
@@ -407,6 +407,12 @@ class GPhys
407
407
  params = PARAMS_JMA
408
408
  end
409
409
  end
410
+ when 200
411
+ if cid == 34 # JMA
412
+ params = PARAMS_JRA55
413
+ else
414
+ warn "parameter table version #{version}, center id #{cid} has not been defined yet"
415
+ end
410
416
  else
411
417
  if cid==98 # ECMWF
412
418
  if version==128
@@ -810,7 +816,7 @@ class GPhys
810
816
  vlat = y*1000
811
817
  grid[4,3] = int2str(vlat[0],3)
812
818
  grid[7,3] = int2str(vlon[0],3)
813
- flag = 1<<7
819
+ flag = 1 << 7
814
820
  grid[10,1] = uint2str(flag,1)
815
821
  grid[11,3] = int2str(vlat[-1],3)
816
822
  grid[14,3] = int2str(vlon[-1],3)
@@ -823,7 +829,7 @@ class GPhys
823
829
  raise "not defined yet"
824
830
  end
825
831
  if rev
826
- flag=1<<5
832
+ flag=1 << 5
827
833
  else
828
834
  flag=0
829
835
  end
@@ -963,7 +969,7 @@ class GPhys
963
969
  end
964
970
  end
965
971
  def get
966
- @gds && uint2str(length,3)<<@gds
972
+ @gds && uint2str(length,3) << @gds
967
973
  end
968
974
  end # end definition of class GribGDS
969
975
  class GribBMS
@@ -1008,12 +1014,12 @@ class GPhys
1008
1014
  def set_map(mask)
1009
1015
  map,n = data2str(mask,1,1)
1010
1016
  @bms[0..0] = uint2str(n,1)
1011
- @bms = @bms[0,3]<<map
1017
+ @bms = @bms[0,3] << map
1012
1018
  @sgm.is.update_total_length
1013
1019
  return true
1014
1020
  end
1015
1021
  def get
1016
- @bms && uint2str(length,3)<<@bms
1022
+ @bms && uint2str(length,3) << @bms
1017
1023
  end
1018
1024
  end # end definition of class GribBMS
1019
1025
  class GribBDS
@@ -1194,7 +1200,7 @@ class GPhys
1194
1200
  @efactor = 2.0**str2int2( @sgm.file.read(2) )
1195
1201
  return @efactor
1196
1202
  end
1197
- def value(shape,*arg)
1203
+ def value(shape,index=nil)
1198
1204
  nbits_unuse = oct4&15
1199
1205
  @sgm.file.seek(@pos+7, ::IO::SEEK_SET)
1200
1206
  nbits_pack = @sgm.file.read(1).to_uint1
@@ -1215,8 +1221,7 @@ class GPhys
1215
1221
  nlen = ((length-3-8)*8-nbits_unuse)/nbits_pack
1216
1222
  nlon,nlat = shape
1217
1223
  (nlon*nlat)==nlen+nmiss || raise("length is not collect")
1218
- if arg.length!=0
1219
- index, shape2 = arg
1224
+ if index
1220
1225
  index = index.collect{|el| Fixnum===el ? el..el : el}
1221
1226
  il = index[0]
1222
1227
  i0 = il.first
@@ -1230,10 +1235,10 @@ class GPhys
1230
1235
  i0 = i0 < 0 ? nlat+i0 : i0
1231
1236
  i1 = i1 < 0 ? nlat+i1 : i1
1232
1237
  index[1] = il.exclude_end? ? i0...i1 : i0..i1
1233
- j = nil
1234
- i = nil
1238
+ #j = nil
1239
+ #i = nil
1235
1240
  if map
1236
- var = NArrayMiss.sfloat(*shape2)
1241
+ var = NArrayMiss.sfloat(index[0].count, index[1].count)
1237
1242
  map.reshape!(nlon,nlat)
1238
1243
  mask = map[*index]
1239
1244
  nd = mask.count_true
@@ -1323,13 +1328,13 @@ class GPhys
1323
1328
  a = 127 if a>127
1324
1329
  b = ref*2**24*16**(64-a)
1325
1330
  a = a*s
1326
- @bds[3,4] = int2str(a,1)<<uint2str(b,3)
1331
+ @bds[3,4] = int2str(a,1) << uint2str(b,3)
1327
1332
  @bds[7,1] = uint2str(nbits,1)
1328
- @bds = @bds[0,8]<<str
1333
+ @bds = @bds[0,8] << str
1329
1334
  @sgm.is.update_total_length
1330
1335
  end
1331
1336
  def get
1332
- uint2str(length,3)<<@bds
1337
+ uint2str(length,3) << @bds
1333
1338
  end
1334
1339
  end # end definition of class GribBDS
1335
1340
  class GribES
@@ -1366,7 +1371,7 @@ class GPhys
1366
1371
 
1367
1372
  public
1368
1373
  =begin
1369
- =NumRu::Grib -- a class for Grib datasets
1374
+ =NumRu::GPhys::Grib -- a class for Grib datasets
1370
1375
 
1371
1376
  ==Class Methods
1372
1377
  ---Grib.new(filename, mode="r")
@@ -1555,7 +1560,7 @@ class GPhys
1555
1560
  end # end of definition of class Grib
1556
1561
 
1557
1562
  =begin
1558
- =NumRu::GribDim
1563
+ =NumRu::GPhys::GribDim
1559
1564
 
1560
1565
  ==Class Methods
1561
1566
  ---new( vat, name, length )
@@ -1611,10 +1616,25 @@ class GPhys
1611
1616
  return @ary
1612
1617
  end
1613
1618
  end
1614
- def [](*ind)
1615
- return val[*ind]
1619
+ def [](ind)
1620
+ v = val
1621
+ if Hash === ind # {range=>step} --> array of indices
1622
+ ran, step = ind.to_a[0]
1623
+ dlen = v.length
1624
+ f = ran.first
1625
+ f += dlen if f<0
1626
+ e = ran.end
1627
+ e += dlen if e<0
1628
+ e -= 1 if ran.exclude_end?
1629
+ ind = Array.new
1630
+ (f..e).step(step){|n| ind.push(n)}
1631
+ end
1632
+ return v[ind]
1616
1633
  end
1617
1634
  def put(ary)
1635
+ if ary.typecode <= NArray::INT # 2014-09-22 horinouchi
1636
+ ary = ary.to_type(NArray::DFLOAT)
1637
+ end
1618
1638
  @ary = ary
1619
1639
  @length = val.length
1620
1640
  return @ary
@@ -1635,9 +1655,13 @@ class GPhys
1635
1655
  end
1636
1656
 
1637
1657
  =begin
1638
- =NumRu::GribVar
1658
+ =NumRu::GPhys::GribVar
1639
1659
 
1640
1660
  ==Class Methods
1661
+ ---always_time_seq=(t_or_f)
1662
+ If true is given, a GribVar will always have a time dimension,
1663
+ even when the time is unique (i.e., length of the time coordinate is 1).
1664
+
1641
1665
  ---new( file, name, obj, dims )
1642
1666
 
1643
1667
  ==Methods
@@ -1666,6 +1690,15 @@ class GPhys
1666
1690
  include GribUtils
1667
1691
  class << self
1668
1692
  include GribUtils
1693
+
1694
+ @@always_time_seq = false
1695
+ def always_time_seq=(t_or_f)
1696
+ @@always_time_seq = t_or_f
1697
+ end
1698
+ def always_time_seq
1699
+ @@always_time_seq
1700
+ end
1701
+
1669
1702
  private
1670
1703
  def vars_same?(var1,var2)
1671
1704
  pds1 = var1.pds
@@ -1816,7 +1849,7 @@ class GPhys
1816
1849
  # time.push( get_time(sgm.pds.date) )
1817
1850
  # }
1818
1851
  time.uniq!
1819
- if time.length>1
1852
+ if @@always_time_seq or time.length>1
1820
1853
  time = NArray.to_na(time)
1821
1854
  d = va.def_dim("time",-1)
1822
1855
  d.put(time)
@@ -1909,55 +1942,96 @@ class GPhys
1909
1942
  return @obj[*indices]
1910
1943
  else
1911
1944
  sha = shape
1945
+ ndims = sha.length
1946
+ after_slice = false
1947
+ dimdel = nil
1912
1948
  if indices.length!=0
1949
+ after_slicer = Array.new(2,true)
1950
+ imap = (3..ndims).collect{Hash.new} # index map org-->current for z,t
1913
1951
  if indices[0] == false
1914
- indices[0] = [true]*(sha.length-indices.length+1)
1952
+ indices[0] = [true]*(ndims-indices.length+1)
1915
1953
  elsif indices[-1] == false
1916
- indices[-1] = [true]*(sha.length-indices.length+1)
1954
+ indices[-1] = [true]*(ndims-indices.length+1)
1917
1955
  elsif indices.include?(false)
1918
1956
  raise "invalid indices"
1919
- elsif sha.length!=indices.length
1957
+ elsif ndims!=indices.length
1920
1958
  raise "invalid indices"
1921
1959
  end
1922
- sha.length.times{|n|
1960
+ dimdel = []
1961
+ ndims.times{|n|
1923
1962
  ind = indices[n]
1924
- if ind==true
1925
- indices[n] = 0..sha[n]-1
1963
+ dlen = sha[n]
1964
+ case ind
1965
+ when true
1966
+ if n<=1
1967
+ indices[n] = 0..dlen-1
1968
+ else
1969
+ (0..dlen-1).each{|i| imap[n-2][i] = i}
1970
+ end
1926
1971
  next
1927
- elsif Fixnum===ind
1972
+ when Fixnum
1928
1973
  sha[n] = 1
1974
+ imap[n-2][ind] = 0
1975
+ dimdel.push(n)
1929
1976
  next
1930
- elsif Range===ind
1977
+ when Range
1931
1978
  f = ind.first
1979
+ f += dlen if f<0
1932
1980
  e = ind.end
1933
- e = sha[n]-1 if e==-1
1981
+ e += dlen if e<0
1934
1982
  e -= 1 if ind.exclude_end?
1935
1983
  sha[n] = e-f+1
1936
- indices[n] = f..e
1984
+ if n<=1
1985
+ indices[n] = f..e
1986
+ else
1987
+ (f..e).each{|i| imap[n-2][i] = i-f}
1988
+ end
1937
1989
  next
1990
+ when Hash
1991
+ ran, step = ind.to_a[0]
1992
+ f = ran.first
1993
+ f += dlen if f<0
1994
+ e = ran.end
1995
+ e += dlen if e<0
1996
+ e -= 1 if ran.exclude_end?
1997
+ sha[n] = (e-f)/step + 1
1998
+ if n<=1
1999
+ indices[n] = f..e
2000
+ after_slice = true
2001
+ after_slicer[n] = (0...sha[n]).collect{|i| i*step}
2002
+ else
2003
+ ia = NArray.int(sha[n]).indgen! * step + f
2004
+ indices[n] = NArray.to_na(ia)
2005
+ j=0
2006
+ (f..e).step(step){|i| imap[n-2][i] = j; j+=1} if n>=2
2007
+ end
2008
+ next
2009
+ when Array, NArray
2010
+ ind = ind.collect{|i|
2011
+ raise("Array indices must be integers") unless Integer===i
2012
+ i>=0 ? i : i+dlen
2013
+ }
2014
+ sha[n] = ind.length
2015
+ if n<=1
2016
+ f = ind.min
2017
+ e = ind.max
2018
+ indices[n] = f..e
2019
+ after_slice = true
2020
+ after_slicer[n] = ind.collect{|i| i-f}
2021
+ else
2022
+ (0...ind.length).each{|i| imap[n-2][ind[i]] = i }
2023
+ end
1938
2024
  else
1939
2025
  raise "invalid indices"
1940
2026
  end
1941
2027
  }
1942
2028
  if rank>2
1943
- mask = NArray.byte(*shape[2..-1])
1944
- mask[*indices[2..-1]]= 1
1945
- first = Array.new(indices.length-2)
1946
- first.length.times{|i|
1947
- ind = indices[2+i]
1948
- if Fixnum===ind
1949
- first[i] = ind < 0 ? shape[2+i]+ind : ind
1950
- elsif Range===ind
1951
- first[i] = ind.first
1952
- else
1953
- raise "invalid indices"
1954
- end
1955
- }
2029
+ subsetzt = true
1956
2030
  else
1957
- mask = true
2031
+ subsetzt = false
1958
2032
  end
1959
2033
  else
1960
- mask = true
2034
+ subsetzt = false
1961
2035
  end
1962
2036
  value = @miss ? NArrayMiss.sfloat(*sha) : NArray.sfloat(*sha)
1963
2037
  if rank==2
@@ -1985,24 +2059,29 @@ class GPhys
1985
2059
  if vt
1986
2060
  index[-1] = vt.eq(get_time(pds.date)).where[0]
1987
2061
  end
1988
- next if (NArray===mask && mask[*index]==0)
2062
+ if subsetzt
2063
+ to_read = true
2064
+ index.each_with_index{|i,d| to_read &&= imap[d][i]}
2065
+ next unless to_read
2066
+ end
1989
2067
  bds = sgm.bds
1990
2068
  if indices.length==0 || (indices[0]==true&&indices[1]==true)
1991
2069
  val = bds.value(shape[0..1])
1992
2070
  else
1993
- val = bds.value(shape[0..1],indices[0..1],sha[0..1])
2071
+ val = bds.value(shape[0..1],indices[0..1])
1994
2072
  end
1995
2073
  d = pds.dfact
1996
2074
  val = val*10.0**(-d)
1997
- if NArray === mask
1998
- index.length==first.length || raise("invalide indices")
1999
- index.length.times{|i|
2000
- index[i] = index[i]-first[i]
2001
- }
2075
+ val = val[*after_slicer] if after_slice
2076
+ if !subsetzt
2077
+ idx = index
2078
+ else
2079
+ idx = []
2080
+ index.each_with_index{|i,d| idx.push(imap[d][i])}
2002
2081
  end
2003
- value[true,true,*index] = val
2082
+ value[true,true,*idx] = val
2004
2083
  }
2005
- sha.delete(1)
2084
+ dimdel.reverse_each{|d| sha.delete_at(d)} if dimdel
2006
2085
  value.reshape!(*sha)
2007
2086
  return value
2008
2087
  end