gphys 1.1.1a

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 (428) hide show
  1. data/ChangeLog +1777 -0
  2. data/LICENSE.txt +34 -0
  3. data/README +33 -0
  4. data/Rakefile +57 -0
  5. data/TODO_ep_flux +6 -0
  6. data/bin/gdir_client +27 -0
  7. data/bin/gdir_server +129 -0
  8. data/bin/gpaop +146 -0
  9. data/bin/gpcat +148 -0
  10. data/bin/gpcut +102 -0
  11. data/bin/gpedit +228 -0
  12. data/bin/gplist +68 -0
  13. data/bin/gpmath +120 -0
  14. data/bin/gpmaxmin +128 -0
  15. data/bin/gpprint +60 -0
  16. data/bin/gpvect +706 -0
  17. data/bin/gpview +704 -0
  18. data/bin/grads2nc_with_gphys +61 -0
  19. data/doc/attribute.html +19 -0
  20. data/doc/attributenetcdf.html +15 -0
  21. data/doc/axis.html +376 -0
  22. data/doc/coordmapping.html +111 -0
  23. data/doc/coordtransform.html +36 -0
  24. data/doc/derivative/gphys-derivative.html +80 -0
  25. data/doc/derivative/index.html +21 -0
  26. data/doc/derivative/index.rd +14 -0
  27. data/doc/derivative/math-doc/document/document.css +30 -0
  28. data/doc/derivative/math-doc/document/document.html +57 -0
  29. data/doc/derivative/math-doc/document/images.aux +1 -0
  30. data/doc/derivative/math-doc/document/images.log +385 -0
  31. data/doc/derivative/math-doc/document/images.pl +186 -0
  32. data/doc/derivative/math-doc/document/images.tex +364 -0
  33. data/doc/derivative/math-doc/document/img1.png +0 -0
  34. data/doc/derivative/math-doc/document/img10.png +0 -0
  35. data/doc/derivative/math-doc/document/img11.png +0 -0
  36. data/doc/derivative/math-doc/document/img12.png +0 -0
  37. data/doc/derivative/math-doc/document/img13.png +0 -0
  38. data/doc/derivative/math-doc/document/img14.png +0 -0
  39. data/doc/derivative/math-doc/document/img15.png +0 -0
  40. data/doc/derivative/math-doc/document/img16.png +0 -0
  41. data/doc/derivative/math-doc/document/img17.png +0 -0
  42. data/doc/derivative/math-doc/document/img18.png +0 -0
  43. data/doc/derivative/math-doc/document/img19.png +0 -0
  44. data/doc/derivative/math-doc/document/img2.png +0 -0
  45. data/doc/derivative/math-doc/document/img20.png +0 -0
  46. data/doc/derivative/math-doc/document/img21.png +0 -0
  47. data/doc/derivative/math-doc/document/img22.png +0 -0
  48. data/doc/derivative/math-doc/document/img23.png +0 -0
  49. data/doc/derivative/math-doc/document/img24.png +0 -0
  50. data/doc/derivative/math-doc/document/img25.png +0 -0
  51. data/doc/derivative/math-doc/document/img26.png +0 -0
  52. data/doc/derivative/math-doc/document/img27.png +0 -0
  53. data/doc/derivative/math-doc/document/img28.png +0 -0
  54. data/doc/derivative/math-doc/document/img29.png +0 -0
  55. data/doc/derivative/math-doc/document/img3.png +0 -0
  56. data/doc/derivative/math-doc/document/img30.png +0 -0
  57. data/doc/derivative/math-doc/document/img4.png +0 -0
  58. data/doc/derivative/math-doc/document/img5.png +0 -0
  59. data/doc/derivative/math-doc/document/img6.png +0 -0
  60. data/doc/derivative/math-doc/document/img7.png +0 -0
  61. data/doc/derivative/math-doc/document/img8.png +0 -0
  62. data/doc/derivative/math-doc/document/img9.png +0 -0
  63. data/doc/derivative/math-doc/document/index.html +57 -0
  64. data/doc/derivative/math-doc/document/labels.pl +13 -0
  65. data/doc/derivative/math-doc/document/next.png +0 -0
  66. data/doc/derivative/math-doc/document/next_g.png +0 -0
  67. data/doc/derivative/math-doc/document/node1.html +238 -0
  68. data/doc/derivative/math-doc/document/node2.html +75 -0
  69. data/doc/derivative/math-doc/document/prev.png +0 -0
  70. data/doc/derivative/math-doc/document/prev_g.png +0 -0
  71. data/doc/derivative/math-doc/document/up.png +0 -0
  72. data/doc/derivative/math-doc/document/up_g.png +0 -0
  73. data/doc/derivative/math-doc/document.pdf +0 -0
  74. data/doc/derivative/math-doc/document.tex +158 -0
  75. data/doc/derivative/numru-derivative.html +129 -0
  76. data/doc/ep_flux/ep_flux.html +469 -0
  77. data/doc/ep_flux/ggraph_on_merdional_section.html +71 -0
  78. data/doc/ep_flux/index.html +31 -0
  79. data/doc/ep_flux/index.rd +24 -0
  80. data/doc/ep_flux/math-doc/document/WARNINGS +1 -0
  81. data/doc/ep_flux/math-doc/document/contents.png +0 -0
  82. data/doc/ep_flux/math-doc/document/crossref.png +0 -0
  83. data/doc/ep_flux/math-doc/document/document.css +30 -0
  84. data/doc/ep_flux/math-doc/document/document.html +101 -0
  85. data/doc/ep_flux/math-doc/document/images.aux +1 -0
  86. data/doc/ep_flux/math-doc/document/images.log +1375 -0
  87. data/doc/ep_flux/math-doc/document/images.pl +1328 -0
  88. data/doc/ep_flux/math-doc/document/images.tex +1471 -0
  89. data/doc/ep_flux/math-doc/document/img1.png +0 -0
  90. data/doc/ep_flux/math-doc/document/img10.png +0 -0
  91. data/doc/ep_flux/math-doc/document/img100.png +0 -0
  92. data/doc/ep_flux/math-doc/document/img101.png +0 -0
  93. data/doc/ep_flux/math-doc/document/img102.png +0 -0
  94. data/doc/ep_flux/math-doc/document/img103.png +0 -0
  95. data/doc/ep_flux/math-doc/document/img104.png +0 -0
  96. data/doc/ep_flux/math-doc/document/img105.png +0 -0
  97. data/doc/ep_flux/math-doc/document/img106.png +0 -0
  98. data/doc/ep_flux/math-doc/document/img107.png +0 -0
  99. data/doc/ep_flux/math-doc/document/img108.png +0 -0
  100. data/doc/ep_flux/math-doc/document/img109.png +0 -0
  101. data/doc/ep_flux/math-doc/document/img11.png +0 -0
  102. data/doc/ep_flux/math-doc/document/img110.png +0 -0
  103. data/doc/ep_flux/math-doc/document/img111.png +0 -0
  104. data/doc/ep_flux/math-doc/document/img112.png +0 -0
  105. data/doc/ep_flux/math-doc/document/img113.png +0 -0
  106. data/doc/ep_flux/math-doc/document/img114.png +0 -0
  107. data/doc/ep_flux/math-doc/document/img115.png +0 -0
  108. data/doc/ep_flux/math-doc/document/img116.png +0 -0
  109. data/doc/ep_flux/math-doc/document/img117.png +0 -0
  110. data/doc/ep_flux/math-doc/document/img118.png +0 -0
  111. data/doc/ep_flux/math-doc/document/img119.png +0 -0
  112. data/doc/ep_flux/math-doc/document/img12.png +0 -0
  113. data/doc/ep_flux/math-doc/document/img120.png +0 -0
  114. data/doc/ep_flux/math-doc/document/img121.png +0 -0
  115. data/doc/ep_flux/math-doc/document/img122.png +0 -0
  116. data/doc/ep_flux/math-doc/document/img123.png +0 -0
  117. data/doc/ep_flux/math-doc/document/img124.png +0 -0
  118. data/doc/ep_flux/math-doc/document/img125.png +0 -0
  119. data/doc/ep_flux/math-doc/document/img126.png +0 -0
  120. data/doc/ep_flux/math-doc/document/img127.png +0 -0
  121. data/doc/ep_flux/math-doc/document/img128.png +0 -0
  122. data/doc/ep_flux/math-doc/document/img129.png +0 -0
  123. data/doc/ep_flux/math-doc/document/img13.png +0 -0
  124. data/doc/ep_flux/math-doc/document/img130.png +0 -0
  125. data/doc/ep_flux/math-doc/document/img131.png +0 -0
  126. data/doc/ep_flux/math-doc/document/img132.png +0 -0
  127. data/doc/ep_flux/math-doc/document/img133.png +0 -0
  128. data/doc/ep_flux/math-doc/document/img134.png +0 -0
  129. data/doc/ep_flux/math-doc/document/img135.png +0 -0
  130. data/doc/ep_flux/math-doc/document/img136.png +0 -0
  131. data/doc/ep_flux/math-doc/document/img137.png +0 -0
  132. data/doc/ep_flux/math-doc/document/img138.png +0 -0
  133. data/doc/ep_flux/math-doc/document/img139.png +0 -0
  134. data/doc/ep_flux/math-doc/document/img14.png +0 -0
  135. data/doc/ep_flux/math-doc/document/img140.png +0 -0
  136. data/doc/ep_flux/math-doc/document/img141.png +0 -0
  137. data/doc/ep_flux/math-doc/document/img142.png +0 -0
  138. data/doc/ep_flux/math-doc/document/img143.png +0 -0
  139. data/doc/ep_flux/math-doc/document/img144.png +0 -0
  140. data/doc/ep_flux/math-doc/document/img145.png +0 -0
  141. data/doc/ep_flux/math-doc/document/img146.png +0 -0
  142. data/doc/ep_flux/math-doc/document/img147.png +0 -0
  143. data/doc/ep_flux/math-doc/document/img148.png +0 -0
  144. data/doc/ep_flux/math-doc/document/img149.png +0 -0
  145. data/doc/ep_flux/math-doc/document/img15.png +0 -0
  146. data/doc/ep_flux/math-doc/document/img150.png +0 -0
  147. data/doc/ep_flux/math-doc/document/img151.png +0 -0
  148. data/doc/ep_flux/math-doc/document/img152.png +0 -0
  149. data/doc/ep_flux/math-doc/document/img153.png +0 -0
  150. data/doc/ep_flux/math-doc/document/img154.png +0 -0
  151. data/doc/ep_flux/math-doc/document/img155.png +0 -0
  152. data/doc/ep_flux/math-doc/document/img156.png +0 -0
  153. data/doc/ep_flux/math-doc/document/img157.png +0 -0
  154. data/doc/ep_flux/math-doc/document/img158.png +0 -0
  155. data/doc/ep_flux/math-doc/document/img159.png +0 -0
  156. data/doc/ep_flux/math-doc/document/img16.png +0 -0
  157. data/doc/ep_flux/math-doc/document/img160.png +0 -0
  158. data/doc/ep_flux/math-doc/document/img161.png +0 -0
  159. data/doc/ep_flux/math-doc/document/img162.png +0 -0
  160. data/doc/ep_flux/math-doc/document/img163.png +0 -0
  161. data/doc/ep_flux/math-doc/document/img164.png +0 -0
  162. data/doc/ep_flux/math-doc/document/img165.png +0 -0
  163. data/doc/ep_flux/math-doc/document/img166.png +0 -0
  164. data/doc/ep_flux/math-doc/document/img167.png +0 -0
  165. data/doc/ep_flux/math-doc/document/img168.png +0 -0
  166. data/doc/ep_flux/math-doc/document/img169.png +0 -0
  167. data/doc/ep_flux/math-doc/document/img17.png +0 -0
  168. data/doc/ep_flux/math-doc/document/img170.png +0 -0
  169. data/doc/ep_flux/math-doc/document/img171.png +0 -0
  170. data/doc/ep_flux/math-doc/document/img172.png +0 -0
  171. data/doc/ep_flux/math-doc/document/img173.png +0 -0
  172. data/doc/ep_flux/math-doc/document/img174.png +0 -0
  173. data/doc/ep_flux/math-doc/document/img175.png +0 -0
  174. data/doc/ep_flux/math-doc/document/img176.png +0 -0
  175. data/doc/ep_flux/math-doc/document/img177.png +0 -0
  176. data/doc/ep_flux/math-doc/document/img178.png +0 -0
  177. data/doc/ep_flux/math-doc/document/img179.png +0 -0
  178. data/doc/ep_flux/math-doc/document/img18.png +0 -0
  179. data/doc/ep_flux/math-doc/document/img180.png +0 -0
  180. data/doc/ep_flux/math-doc/document/img181.png +0 -0
  181. data/doc/ep_flux/math-doc/document/img182.png +0 -0
  182. data/doc/ep_flux/math-doc/document/img183.png +0 -0
  183. data/doc/ep_flux/math-doc/document/img184.png +0 -0
  184. data/doc/ep_flux/math-doc/document/img185.png +0 -0
  185. data/doc/ep_flux/math-doc/document/img186.png +0 -0
  186. data/doc/ep_flux/math-doc/document/img187.png +0 -0
  187. data/doc/ep_flux/math-doc/document/img188.png +0 -0
  188. data/doc/ep_flux/math-doc/document/img189.png +0 -0
  189. data/doc/ep_flux/math-doc/document/img19.png +0 -0
  190. data/doc/ep_flux/math-doc/document/img190.png +0 -0
  191. data/doc/ep_flux/math-doc/document/img191.png +0 -0
  192. data/doc/ep_flux/math-doc/document/img192.png +0 -0
  193. data/doc/ep_flux/math-doc/document/img193.png +0 -0
  194. data/doc/ep_flux/math-doc/document/img194.png +0 -0
  195. data/doc/ep_flux/math-doc/document/img195.png +0 -0
  196. data/doc/ep_flux/math-doc/document/img196.png +0 -0
  197. data/doc/ep_flux/math-doc/document/img197.png +0 -0
  198. data/doc/ep_flux/math-doc/document/img198.png +0 -0
  199. data/doc/ep_flux/math-doc/document/img199.png +0 -0
  200. data/doc/ep_flux/math-doc/document/img2.png +0 -0
  201. data/doc/ep_flux/math-doc/document/img20.png +0 -0
  202. data/doc/ep_flux/math-doc/document/img200.png +0 -0
  203. data/doc/ep_flux/math-doc/document/img21.png +0 -0
  204. data/doc/ep_flux/math-doc/document/img22.png +0 -0
  205. data/doc/ep_flux/math-doc/document/img23.png +0 -0
  206. data/doc/ep_flux/math-doc/document/img24.png +0 -0
  207. data/doc/ep_flux/math-doc/document/img25.png +0 -0
  208. data/doc/ep_flux/math-doc/document/img26.png +0 -0
  209. data/doc/ep_flux/math-doc/document/img27.png +0 -0
  210. data/doc/ep_flux/math-doc/document/img28.png +0 -0
  211. data/doc/ep_flux/math-doc/document/img29.png +0 -0
  212. data/doc/ep_flux/math-doc/document/img3.png +0 -0
  213. data/doc/ep_flux/math-doc/document/img30.png +0 -0
  214. data/doc/ep_flux/math-doc/document/img31.png +0 -0
  215. data/doc/ep_flux/math-doc/document/img32.png +0 -0
  216. data/doc/ep_flux/math-doc/document/img33.png +0 -0
  217. data/doc/ep_flux/math-doc/document/img34.png +0 -0
  218. data/doc/ep_flux/math-doc/document/img35.png +0 -0
  219. data/doc/ep_flux/math-doc/document/img36.png +0 -0
  220. data/doc/ep_flux/math-doc/document/img37.png +0 -0
  221. data/doc/ep_flux/math-doc/document/img38.png +0 -0
  222. data/doc/ep_flux/math-doc/document/img39.png +0 -0
  223. data/doc/ep_flux/math-doc/document/img4.png +0 -0
  224. data/doc/ep_flux/math-doc/document/img40.png +0 -0
  225. data/doc/ep_flux/math-doc/document/img41.png +0 -0
  226. data/doc/ep_flux/math-doc/document/img42.png +0 -0
  227. data/doc/ep_flux/math-doc/document/img43.png +0 -0
  228. data/doc/ep_flux/math-doc/document/img44.png +0 -0
  229. data/doc/ep_flux/math-doc/document/img45.png +0 -0
  230. data/doc/ep_flux/math-doc/document/img46.png +0 -0
  231. data/doc/ep_flux/math-doc/document/img47.png +0 -0
  232. data/doc/ep_flux/math-doc/document/img48.png +0 -0
  233. data/doc/ep_flux/math-doc/document/img49.png +0 -0
  234. data/doc/ep_flux/math-doc/document/img5.png +0 -0
  235. data/doc/ep_flux/math-doc/document/img50.png +0 -0
  236. data/doc/ep_flux/math-doc/document/img51.png +0 -0
  237. data/doc/ep_flux/math-doc/document/img52.png +0 -0
  238. data/doc/ep_flux/math-doc/document/img53.png +0 -0
  239. data/doc/ep_flux/math-doc/document/img54.png +0 -0
  240. data/doc/ep_flux/math-doc/document/img55.png +0 -0
  241. data/doc/ep_flux/math-doc/document/img56.png +0 -0
  242. data/doc/ep_flux/math-doc/document/img57.png +0 -0
  243. data/doc/ep_flux/math-doc/document/img58.png +0 -0
  244. data/doc/ep_flux/math-doc/document/img59.png +0 -0
  245. data/doc/ep_flux/math-doc/document/img6.png +0 -0
  246. data/doc/ep_flux/math-doc/document/img60.png +0 -0
  247. data/doc/ep_flux/math-doc/document/img61.png +0 -0
  248. data/doc/ep_flux/math-doc/document/img62.png +0 -0
  249. data/doc/ep_flux/math-doc/document/img63.png +0 -0
  250. data/doc/ep_flux/math-doc/document/img64.png +0 -0
  251. data/doc/ep_flux/math-doc/document/img65.png +0 -0
  252. data/doc/ep_flux/math-doc/document/img66.png +0 -0
  253. data/doc/ep_flux/math-doc/document/img67.png +0 -0
  254. data/doc/ep_flux/math-doc/document/img68.png +0 -0
  255. data/doc/ep_flux/math-doc/document/img69.png +0 -0
  256. data/doc/ep_flux/math-doc/document/img7.png +0 -0
  257. data/doc/ep_flux/math-doc/document/img70.png +0 -0
  258. data/doc/ep_flux/math-doc/document/img71.png +0 -0
  259. data/doc/ep_flux/math-doc/document/img72.png +0 -0
  260. data/doc/ep_flux/math-doc/document/img73.png +0 -0
  261. data/doc/ep_flux/math-doc/document/img74.png +0 -0
  262. data/doc/ep_flux/math-doc/document/img75.png +0 -0
  263. data/doc/ep_flux/math-doc/document/img76.png +0 -0
  264. data/doc/ep_flux/math-doc/document/img77.png +0 -0
  265. data/doc/ep_flux/math-doc/document/img78.png +0 -0
  266. data/doc/ep_flux/math-doc/document/img79.png +0 -0
  267. data/doc/ep_flux/math-doc/document/img8.png +0 -0
  268. data/doc/ep_flux/math-doc/document/img80.png +0 -0
  269. data/doc/ep_flux/math-doc/document/img81.png +0 -0
  270. data/doc/ep_flux/math-doc/document/img82.png +0 -0
  271. data/doc/ep_flux/math-doc/document/img83.png +0 -0
  272. data/doc/ep_flux/math-doc/document/img84.png +0 -0
  273. data/doc/ep_flux/math-doc/document/img85.png +0 -0
  274. data/doc/ep_flux/math-doc/document/img86.png +0 -0
  275. data/doc/ep_flux/math-doc/document/img87.png +0 -0
  276. data/doc/ep_flux/math-doc/document/img88.png +0 -0
  277. data/doc/ep_flux/math-doc/document/img89.png +0 -0
  278. data/doc/ep_flux/math-doc/document/img9.png +0 -0
  279. data/doc/ep_flux/math-doc/document/img90.png +0 -0
  280. data/doc/ep_flux/math-doc/document/img91.png +0 -0
  281. data/doc/ep_flux/math-doc/document/img92.png +0 -0
  282. data/doc/ep_flux/math-doc/document/img93.png +0 -0
  283. data/doc/ep_flux/math-doc/document/img94.png +0 -0
  284. data/doc/ep_flux/math-doc/document/img95.png +0 -0
  285. data/doc/ep_flux/math-doc/document/img96.png +0 -0
  286. data/doc/ep_flux/math-doc/document/img97.png +0 -0
  287. data/doc/ep_flux/math-doc/document/img98.png +0 -0
  288. data/doc/ep_flux/math-doc/document/img99.png +0 -0
  289. data/doc/ep_flux/math-doc/document/index.html +101 -0
  290. data/doc/ep_flux/math-doc/document/internals.pl +258 -0
  291. data/doc/ep_flux/math-doc/document/labels.pl +265 -0
  292. data/doc/ep_flux/math-doc/document/next.png +0 -0
  293. data/doc/ep_flux/math-doc/document/next_g.png +0 -0
  294. data/doc/ep_flux/math-doc/document/node1.html +104 -0
  295. data/doc/ep_flux/math-doc/document/node10.html +164 -0
  296. data/doc/ep_flux/math-doc/document/node11.html +86 -0
  297. data/doc/ep_flux/math-doc/document/node12.html +166 -0
  298. data/doc/ep_flux/math-doc/document/node13.html +897 -0
  299. data/doc/ep_flux/math-doc/document/node14.html +1065 -0
  300. data/doc/ep_flux/math-doc/document/node15.html +72 -0
  301. data/doc/ep_flux/math-doc/document/node16.html +81 -0
  302. data/doc/ep_flux/math-doc/document/node2.html +82 -0
  303. data/doc/ep_flux/math-doc/document/node3.html +91 -0
  304. data/doc/ep_flux/math-doc/document/node4.html +149 -0
  305. data/doc/ep_flux/math-doc/document/node5.html +330 -0
  306. data/doc/ep_flux/math-doc/document/node6.html +99 -0
  307. data/doc/ep_flux/math-doc/document/node7.html +98 -0
  308. data/doc/ep_flux/math-doc/document/node8.html +83 -0
  309. data/doc/ep_flux/math-doc/document/node9.html +140 -0
  310. data/doc/ep_flux/math-doc/document/prev.png +0 -0
  311. data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
  312. data/doc/ep_flux/math-doc/document/up.png +0 -0
  313. data/doc/ep_flux/math-doc/document/up_g.png +0 -0
  314. data/doc/ep_flux/math-doc/document.pdf +0 -0
  315. data/doc/ep_flux/math-doc/document.tex +2018 -0
  316. data/doc/gdir.html +412 -0
  317. data/doc/gdir_client.html +16 -0
  318. data/doc/gdir_connect_ftp-like.html +61 -0
  319. data/doc/gdir_server.html +45 -0
  320. data/doc/ggraph.html +1615 -0
  321. data/doc/gpcat.html +44 -0
  322. data/doc/gpcut.html +41 -0
  323. data/doc/gphys.html +532 -0
  324. data/doc/gphys_fft.html +324 -0
  325. data/doc/gphys_grads_io.html +69 -0
  326. data/doc/gphys_grib_io.html +82 -0
  327. data/doc/gphys_io.html +120 -0
  328. data/doc/gphys_io_common.html +18 -0
  329. data/doc/gphys_netcdf_io.html +283 -0
  330. data/doc/gplist.html +24 -0
  331. data/doc/gpmath.html +51 -0
  332. data/doc/gpmaxmin.html +31 -0
  333. data/doc/gpprint.html +34 -0
  334. data/doc/gpview.html +270 -0
  335. data/doc/grads2nc_with_gphys.html +21 -0
  336. data/doc/grads_gridded.html +307 -0
  337. data/doc/grib.html +144 -0
  338. data/doc/grid.html +212 -0
  339. data/doc/index.html +133 -0
  340. data/doc/index.rd +127 -0
  341. data/doc/netcdf_convention.html +136 -0
  342. data/doc/unumeric.html +176 -0
  343. data/doc/update +64 -0
  344. data/doc/varray.html +299 -0
  345. data/doc/varraycomposite.html +67 -0
  346. data/ext_coord.c +209 -0
  347. data/ext_init.c +7 -0
  348. data/extconf.rb +42 -0
  349. data/install.rb +130 -0
  350. data/interpo.c +497 -0
  351. data/lib/numru/dcl_mouse.rb +71 -0
  352. data/lib/numru/dclext_datetime_ax.rb +220 -0
  353. data/lib/numru/derivative.rb +348 -0
  354. data/lib/numru/ganalysis/covariance.rb +154 -0
  355. data/lib/numru/ganalysis/eof.rb +298 -0
  356. data/lib/numru/ganalysis/histogram.rb +252 -0
  357. data/lib/numru/ganalysis/met.rb +317 -0
  358. data/lib/numru/ganalysis/planet.rb +182 -0
  359. data/lib/numru/ganalysis.rb +7 -0
  360. data/lib/numru/gdir.rb +1038 -0
  361. data/lib/numru/gdir_connect_ftp-like.rb +149 -0
  362. data/lib/numru/ggraph.rb +5838 -0
  363. data/lib/numru/ggraph_on_merdional_section.rb +178 -0
  364. data/lib/numru/gphys/assoccoords.rb +359 -0
  365. data/lib/numru/gphys/attribute.rb +129 -0
  366. data/lib/numru/gphys/attributenetcdf.rb +80 -0
  367. data/lib/numru/gphys/axis.rb +963 -0
  368. data/lib/numru/gphys/coordmapping.rb +286 -0
  369. data/lib/numru/gphys/coordtransform.rb +209 -0
  370. data/lib/numru/gphys/derivative.rb +314 -0
  371. data/lib/numru/gphys/ep_flux.rb +868 -0
  372. data/lib/numru/gphys/gpcommon.rb +52 -0
  373. data/lib/numru/gphys/gphys.rb +1207 -0
  374. data/lib/numru/gphys/gphys_fft.rb +886 -0
  375. data/lib/numru/gphys/gphys_grads_io.rb +212 -0
  376. data/lib/numru/gphys/gphys_grib_io.rb +214 -0
  377. data/lib/numru/gphys/gphys_gtool3_io.rb +162 -0
  378. data/lib/numru/gphys/gphys_hdfeos5_io.rb +672 -0
  379. data/lib/numru/gphys/gphys_io.rb +452 -0
  380. data/lib/numru/gphys/gphys_io_common.rb +126 -0
  381. data/lib/numru/gphys/gphys_netcdf_io.rb +800 -0
  382. data/lib/numru/gphys/gphys_nusdas_io.rb +132 -0
  383. data/lib/numru/gphys/grads_gridded.rb +1638 -0
  384. data/lib/numru/gphys/grib.rb +2049 -0
  385. data/lib/numru/gphys/grib_params.rb +1465 -0
  386. data/lib/numru/gphys/grid.rb +723 -0
  387. data/lib/numru/gphys/gtool3.rb +771 -0
  388. data/lib/numru/gphys/interpolate.rb +854 -0
  389. data/lib/numru/gphys/narray_ext.rb +34 -0
  390. data/lib/numru/gphys/netcdf_convention.rb +406 -0
  391. data/lib/numru/gphys/subsetmapping.rb +332 -0
  392. data/lib/numru/gphys/unumeric.rb +522 -0
  393. data/lib/numru/gphys/varray.rb +1109 -0
  394. data/lib/numru/gphys/varraycomposite.rb +415 -0
  395. data/lib/numru/gphys/varraygrads.rb +225 -0
  396. data/lib/numru/gphys/varraygrib.rb +177 -0
  397. data/lib/numru/gphys/varraygtool3.rb +226 -0
  398. data/lib/numru/gphys/varrayhdfeos5.rb +451 -0
  399. data/lib/numru/gphys/varraynetcdf.rb +350 -0
  400. data/lib/numru/gphys/varraynusdas.rb +59 -0
  401. data/lib/numru/gphys.rb +9 -0
  402. data/lib/numru/htdir.rb +170 -0
  403. data/multibitIO.c +567 -0
  404. data/sample/cira86_to_nc.rb +122 -0
  405. data/sample/druby_cli1.rb +21 -0
  406. data/sample/druby_cli2.rb +34 -0
  407. data/sample/druby_serv1.rb +30 -0
  408. data/sample/druby_serv2.rb +64 -0
  409. data/sample/ep_flux/demo_NCEP_1.rb +48 -0
  410. data/sample/ep_flux/demo_NCEP_2.rb +57 -0
  411. data/sample/ep_flux/demo_NCEP_3.rb +81 -0
  412. data/sample/ggraph_latlon_labelling_dr002690.rb +159 -0
  413. data/sample/ggraph_mapfit-axes_dr002687.rb +131 -0
  414. data/sample/map_projection.rb +121 -0
  415. data/sample/ncep_theta_coord.rb +79 -0
  416. data/test/eof_slp.rb +28 -0
  417. data/test/mltbit.dat +0 -0
  418. data/test/test_ep_flux.rb +533 -0
  419. data/test/test_multibitIO.rb +19 -0
  420. data/testdata/T.jan.ctl +12 -0
  421. data/testdata/T.jan.dat +0 -0
  422. data/testdata/T.jan.grib +0 -0
  423. data/testdata/T.jan.nc +0 -0
  424. data/testdata/T.jan.packed.withmiss.nc +0 -0
  425. data/testdata/UV.jan.nc +0 -0
  426. data/testdata/assoc_crds.nc +0 -0
  427. data/testdata/cira86.dat +1332 -0
  428. metadata +621 -0
@@ -0,0 +1,286 @@
1
+ require "narray"
2
+
3
+ =begin
4
+ = class CoordMapping
5
+
6
+ == Overview
7
+ Mapping of a coordinate to another. It supports analytic and
8
+ grid-point-based mapping in subclasses. Here in this root
9
+ CoordMapping class only the invariant unity mapping (or no mapping)
10
+ is defined.
11
+
12
+ == Class methods
13
+ ---CoordMapping.new
14
+ Constructor. One or more arguments can be needed in subclasses
15
+
16
+ == Methods
17
+ ---map(x,y,z,...)
18
+ Maps data point(s)
19
+
20
+ ARGUMENTS
21
+ * x,y,z,... (one or more Numeric or NArray) : data points.
22
+ Mapping is made of [x,y,z,..] (if Numeric) or
23
+ [x[0],y[0],z[0],..], [x[1],y[1],z[1],..], ..(if NArray).
24
+ Thus, the number of arguments must be equal to the rank of
25
+ the mapping. Also, their lengths must agree with each other.
26
+
27
+ RETURN VALUE
28
+ * Array of p,q,r,... (Numeric or NArray) : mapping result
29
+
30
+ ---map_grid(x,y,z,...)
31
+ Same as ((<map>)) but for a regular grid.
32
+
33
+ ARGUMENTS
34
+ * x,y,z,... (one or more 1D NArray) : coordinate values of
35
+ a regular grid [x_i, y_j, z_k,..]. The shape of the grid is thus
36
+ [x.length, y.length, z.length,..]. This method needs no redefinition,
37
+ since it calls ((<map>)) inside.
38
+
39
+ ---inverse_map(p,q,r,...)
40
+ Inversely maps data point(s).
41
+
42
+ ARGUMENTS
43
+ * p,q,r,... (one or more Numeric or NArray) : data points.
44
+ Inverse mapping is made of [p,q,r,..] (if Numeric) or
45
+ [p[0],q[0],r[0],..], [p[1],q[1],r[1],..], ..(if NArray).
46
+ Thus, the number of arguments must be equal to the rank of
47
+ the mapping. Also, if NArray, their lengths must agree with each other.
48
+
49
+ RETURN VALUE
50
+ * Array of x,y,z,... (Numeric or NArray) : inverse mapping result
51
+
52
+ ---inverse
53
+ Returns the inverse mapping.
54
+
55
+ RETURN VALUE
56
+ * a CoordMapping
57
+
58
+ ---inversion_rigorous?
59
+ Whether the inversion is rigorous (analytical)
60
+
61
+ RETURN VALUE
62
+ * true or false
63
+
64
+ = class LinearCoordMapping < CoordMapping
65
+
66
+ == Overview
67
+ Linear coordinate mapping expressed as offset + factor*x,
68
+ where offset is a vector (NVect) and factor is a matrix (NMatrix).
69
+
70
+ Methods listed below are only those newly defined or those whose
71
+ arguments are changed.
72
+
73
+ == Class methods
74
+ ---LinearCoordMapping.new(offset=nil, factor=nil)
75
+ Constructor. If one of offset and factor is not
76
+ specified (nil), a zero vector / a unit matrix is used (at least
77
+ one of them must be given).
78
+
79
+ ARGUMENTS
80
+ * offset (NVector or nil) : the offset. Its length represents the rank
81
+ of mapping. (if nil a zero vector is assumed)
82
+ * factor (NMatrix or nil) : the factor. For consistency,
83
+ ( offset.length == factor.shape[0] == factor.shape[1] ) is required.
84
+
85
+ == Methods
86
+ ---offset
87
+ Returns the internally stored offset.
88
+
89
+ ---factor
90
+ Returns the internally stored factor.
91
+
92
+ =end
93
+
94
+ module NumRu
95
+
96
+ class CoordMapping
97
+ def initialize
98
+ @rank = nil # nil means any (set a positive integer to specify)
99
+ @inversion_rigorous = true
100
+ end
101
+
102
+ attr_reader :rank
103
+
104
+ def inversion_rigorous?
105
+ @inversion_rigorous
106
+ end
107
+
108
+ def map(*args)
109
+ __check_args_m(*args)
110
+ args.collect{|v| v.dup}
111
+ end
112
+ def inverse_map
113
+ __check_args_m(*args)
114
+ args.collect{|v| v.dup}
115
+ end
116
+
117
+ def map_grid(*args)
118
+ args.each{|v| raise ArgumentError,"all args must be 1D" if v.rank!=1}
119
+ shape = args.collect{|v| v.length}
120
+ rank = shape.length
121
+ expanded=Array.new
122
+ (0...args.length).each{|i|
123
+ to_insert = (0...i).collect{|j| 0} + ((i+1)...rank).collect{|j| 1}
124
+ x = args[i]
125
+ if to_insert.length > 0
126
+ x = x.newdim(*to_insert)
127
+ x += NArray.float(*shape)
128
+ end
129
+ expanded.push(x)
130
+ }
131
+ map(*expanded)
132
+ end
133
+
134
+ def inverse
135
+ self.clone
136
+ end
137
+
138
+ private
139
+ def __check_args_m(*args)
140
+ if @rank
141
+ if args.length != @rank
142
+ raise ArgementError,
143
+ "# of the arguments must agree with the rank #{@rank}"
144
+ end
145
+ else
146
+ if args.length == 0
147
+ raise ArgementError,"# of the arguments must be 1 or greater"
148
+ end
149
+ end
150
+ if args[0].is_a?(Numeric)
151
+ for i in 1...args.length
152
+ if !args[i].is_a?(Numeric)
153
+ raise ArgumentError,
154
+ "If the first arg is a numeric, the remaing must be so."
155
+ end
156
+ end
157
+ else
158
+ for i in 1...args.length
159
+ if args[i-1].length != args[i].length
160
+ raise ArgumentError,"lengths of the args must be the same"
161
+ end
162
+ end
163
+ end
164
+ end
165
+ end
166
+
167
+ ############################
168
+
169
+ class LinearCoordMapping < CoordMapping
170
+
171
+ def initialize(offset=nil, factor=nil)
172
+
173
+ #< argument check & set rank, offset, factor >
174
+
175
+ if !offset && !factor
176
+ raise ArgumentError,"One of offset and factor must be specified"
177
+ elsif !factor
178
+ raise ArgumentError,"offset is not a NVector" if !offset.is_a?(NVector)
179
+ @rank = offset.length
180
+ @factor = NMatrix.float(@rank,@rank)
181
+ @factor.diagonal!(1)
182
+ else
183
+ raise ArgumentError,"factor is not a NMAtrix" if !factor.is_a?(NMatrix)
184
+ nx,ny = factor.shape
185
+ raise ArgumentError,"factor must be a square matrix" if nx != ny
186
+ @rank = nx
187
+ if offset
188
+ raise ArgumentError,"offset is not a NVector" if !offset.is_a?(NVector)
189
+ if offset.length != @rank
190
+ raise ArgumentError,"inconsistent dimensionarity between "+
191
+ "offset #{offset.length} and factor #{factor.shape}"
192
+ end
193
+ @offset = offset
194
+ else
195
+ @offset = NVector.float(@rank)
196
+ end
197
+ @factor = factor
198
+ end
199
+
200
+ #< other parameters >
201
+
202
+ @inversion_rigorous = true
203
+ @inv_factor = nil # deferred until needed (might not be invertible)
204
+
205
+ end
206
+
207
+ attr_reader :factor, :offset
208
+
209
+ def map(*args)
210
+ __check_args_m(*args)
211
+ x = __to_NVector(*args)
212
+ p = @offset + @factor*x
213
+ (0...@rank).collect{|i| p[i,false]}
214
+ end
215
+
216
+ def inverse_map(*args)
217
+ __check_args_m(*args)
218
+ p = __to_NVector(*args)
219
+ __set_inv_factor if !@inv_factor
220
+ x = @inv_factor * ( p - @offset )
221
+ (0...@rank).collect{|i| x[i,false]}
222
+ end
223
+
224
+ def inverse
225
+ __set_inv_factor if !@inv_factor
226
+ LinearCoordMapping.new( -@inv_factor*@offset, @inv_factor )
227
+ # Here, LinearCoordMapping.new is better than class.new,
228
+ # since the constructor may change in subclasses.
229
+ end
230
+
231
+ private
232
+ def __to_NVector(*args)
233
+ if args[0].is_a?(Numeric)
234
+ NVector[*args]
235
+ else
236
+ v = NVector.float(@rank,*args[0].shape)
237
+ for i in 0...@rank
238
+ v[i,false] = args[i]
239
+ end
240
+ v
241
+ end
242
+ end
243
+
244
+ def __set_inv_factor
245
+ begin
246
+ @inv_factor = @factor.inverse
247
+ rescue
248
+ raise $!,"mapping factor (which is a Matrix) is not invertible"
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end
255
+
256
+ ################################################################
257
+ if $0 == __FILE__
258
+ include NumRu
259
+
260
+ puts "\n** The default unity mapping class CoordMapping **\n\n"
261
+
262
+ mp = CoordMapping.new
263
+ x = y = z = NArray.float(10).indgen!
264
+ p,q,r = mp.map(x,y,z)
265
+ p p,q,r
266
+
267
+ puts "\n** LinearCoordMapping **\n\n"
268
+ include Math
269
+
270
+ offset = NVector[ 100.0, 0.0, 100.0 ]
271
+ theta = PI/6
272
+ factor = NMatrix[ [cos(theta), -sin(theta), 0],
273
+ [sin(theta), cos(theta) , 0],
274
+ [0 , 0 , 1] ]
275
+ mp = LinearCoordMapping.new(offset, factor)
276
+ y = z = NArray.float(10)
277
+ p,q,r = mp.map(x,y,z)
278
+ puts "<<forward>>"
279
+ p p,q,r
280
+ puts "<<inverse>>"
281
+ p *mp.inverse_map(p,q,r)
282
+ puts "<<map grid>>"
283
+ x = y = NArray[0.0, 1.0]
284
+ z = NArray[0.0,1.0,2.0]
285
+ p *mp.map_grid(x,y,z)
286
+ end
@@ -0,0 +1,209 @@
1
+ require "numru/gphys/coordmapping"
2
+ require "numru/gphys/gphys"
3
+ begin
4
+ require "numru/ssl2"
5
+ HAVE_NUMRU_SSL2 = true
6
+ rescue LoadError
7
+ HAVE_NUMRU_SSL2 = false
8
+ end
9
+
10
+ =begin
11
+ =class NumRu::GPhys
12
+
13
+ Additional methods regarding coordinate transformation.
14
+
15
+ == Methods
16
+
17
+ ---coordtransform( coordmapping, axes_to, *dims )
18
+
19
+ Coordinate transformation with ((|coordmapping|)) into ((|axes_to|)).
20
+
21
+ ARGUMENTS
22
+ * ((|coordmapping|)) (CoordMapping) : relation between the new and
23
+ original coordinate systems. Mapping is defined from the new one to
24
+ the orinal one. If the rank of the mapping is smaller than
25
+ the rank of self, ((|dims|)) must be used to specify the
26
+ correspondence. e.g., if the rank of the mapping is 2 and that
27
+ of self is 3 and the mapping is regarding the first 2 dimensions
28
+ of the three, ((|dims|)) must be [0,1].
29
+ * ((|axes_to|)) (Array of Axis) : grid in the new coordinate system.
30
+ Its length must be the same as the rank of ((|coordmapping|))
31
+ * ((|dims|)) (integers) : Specifies the dimensions to which
32
+ ((|coordmapping|)) is applied. Needed if
33
+ (({self.rank!=coordmapping.rank})) (neglected otherwise).
34
+ The number of integers must agree with the rank of the mapping.
35
+
36
+ =end
37
+
38
+ module NumRu
39
+ class GPhys
40
+
41
+ def coordtransform( coordmapping, axes_to, *dims )
42
+
43
+ rankmp = coordmapping.rank
44
+
45
+ #< check arguments >
46
+ if axes_to.length != rankmp
47
+ raise ArgumentError,
48
+ "length of axes_to must be equal to the rank of coordmapping"
49
+ end
50
+ if self.rank == rankmp
51
+ dims = (0...rankmp).collect{|i| i}
52
+ elsif self.rank < rankmp
53
+ raise ArgumentError,"rank of coordmapping is greater than self.rank"
54
+ elsif dims.length != rankmp
55
+ raise ArguemntError,
56
+ "# of dimensions speficied is not equal to the rank of coordmapping"
57
+ elsif dims != dims.sort
58
+ raise ArguementErroor,"dims must be in the increasing order"
59
+ end
60
+
61
+ #< get grid points >
62
+ vt = coordmapping.map_grid( *dims.collect{|d| axes_to[d].pos.val} )
63
+ x = dims.collect{|d| self.grid.axis(d).pos.val}
64
+ #< prepare the output object >
65
+ axes = (0...self.rank).collect{|i| grid.axis(i)}
66
+ dims.each_with_index{|d,j| axes[d]=axes_to[j]}
67
+ grid_to = Grid.new( *axes )
68
+ vnew = VArray.new( NArray.new( self.data.ntype, *grid_to.shape ),
69
+ self.data, self.name )
70
+
71
+ #< do interpolation (so far only 2D is supported) >
72
+ case dims.length
73
+ when 2
74
+ if !HAVE_NUMRU_SSL2
75
+
76
+ p "interpolation without SSL2"
77
+ # raise "Sorry, so far I need SSL2 (ruby-ssl2)"
78
+ self.each_subary_at_dims_with_index( *dims ){ |fxy,idx|
79
+
80
+ wgts = Array.new
81
+ idxs = Array.new
82
+
83
+ for d in 0..dims.length-1
84
+ wgt = vt[d].dup.fill!(-1.0)
85
+ idx0 = vt[d].dup.to_i.fill!(-1)
86
+ idx1 = idx0.dup.fill!(x[d].length)
87
+
88
+ xsort = x[d].sort
89
+ xsortindex = x[d].sort_index
90
+ for i in 0..x[d].length-1
91
+ idx0[ xsort[i] <= vt[d] ] = xsortindex[i]
92
+ idx1[ xsort[-1-i] >= vt[d] ] = xsortindex[-1-i]
93
+ end
94
+
95
+ # where idx0=idx1
96
+ wgt[ idx0.eq(idx1) ] = 1.0
97
+
98
+ # where vt[d] < x[d].min
99
+ wgt[ idx0 <= -1 ] = 1.0
100
+ idx0[ idx0 <= -1 ] = 0
101
+
102
+ # where vt[d] > x[d].max
103
+ wgt[ idx1 >= x[d].length ] = 0.0
104
+ idx1[ idx1 >= x[d].length ] = x[d].length-1
105
+
106
+ # normal points
107
+ mask = wgt.eq(-1.0)
108
+ wgt[mask] = (vt[d][mask]-x[d][idx0[mask]])/(x[d][idx1[mask]]-x[d][idx0[mask]])
109
+
110
+ wgts.push(wgt)
111
+ idxs[d*2] = idx0
112
+ idxs[d*2+1] = idx1
113
+
114
+ end
115
+
116
+ case dims.length
117
+ # when 1
118
+ # f = fxy.data.val[idxs[0]]*(1-wgts[0]) +
119
+ # fxy.data.val[idxs[1]]*wgts[0]
120
+ # f = f.to_na if( f.class.to_s == "NArrayMiss" )
121
+ when 2
122
+ lx = fxy.shape[0]
123
+ f = ( fxy.data.val[idxs[0]+idxs[2]*lx]*(1-wgts[0]) +
124
+ fxy.data.val[idxs[1]+idxs[2]*lx]*wgts[0]
125
+ ) * (1-wgts[1]) +
126
+ ( fxy.data.val[idxs[0]+idxs[3]*lx]*(1-wgts[0]) +
127
+ fxy.data.val[idxs[1]+idxs[3]*lx]*wgts[0]
128
+ ) * wgts[1]
129
+ f = f.to_na if( f.class.to_s == "NArrayMiss" )
130
+ else
131
+ raise "Sorry, #{v.length}D interpolation is yet to be supported"
132
+ end
133
+
134
+ if(idx==false)
135
+ vnew[] = f
136
+ else
137
+ vnew[*idx] = f
138
+ end
139
+ }
140
+
141
+ else
142
+ ix=iy=0
143
+ m=3
144
+ self.each_subary_at_dims_with_index( *dims ){ |fxy,idx|
145
+ c,xt = SSL2.bicd3(x[0],x[1],fxy.val,m)
146
+ begin
147
+ ix,iy,f = SSL2.bifd3(x[0],x[1],m,c,xt,0,vt[0],ix,0,vt[1],iy)
148
+ rescue
149
+ $stderr.print "Interpolation into", vt[0].inspect, vt[1].inspect
150
+ raise $!
151
+ end
152
+ vnew[*idx] = f
153
+ }
154
+ end
155
+ else
156
+ raise "Sorry, #{v.length}D interpolation is yet to be supported"
157
+ end
158
+
159
+ #< finish >
160
+ GPhys.new( grid_to, vnew )
161
+ end
162
+
163
+ end
164
+ end
165
+
166
+ ########################################
167
+
168
+ if __FILE__ == $0
169
+ include NumRu
170
+ include NMath
171
+
172
+ #< make a GPhys >
173
+
174
+ puts "** preparation **"
175
+
176
+ nx=ny=10
177
+ nz=3
178
+ xv = VArray.new( xx=NArray.sfloat(nx).indgen!.mul!(4*PI/(nx-1)) ).rename("x")
179
+ yv = VArray.new( yy=NArray.sfloat(ny).indgen!.mul!(4*PI/(ny-1)) ).rename("y")
180
+ zv = VArray.new( NArray.sfloat(nz).indgen! ).rename("z")
181
+ xax = Axis.new.set_pos(xv)
182
+ yax = Axis.new.set_pos(yv)
183
+ zax = Axis.new.set_pos(zv)
184
+ grid = Grid.new(xax,yax,zax)
185
+ fxy = sin(yy).newdim(0,1) + NArray.sfloat(nx).newdim(1,1) +
186
+ NArray.sfloat(nz).indgen!.newdim(0,0)
187
+ p fxy.shape, fxy
188
+ z = VArray.new( fxy )
189
+ gp = GPhys.new( grid, z )
190
+
191
+
192
+ #< make the new coordinate >
193
+
194
+ puts "** transformation **"
195
+
196
+ theta = PI/6
197
+ factor = NMatrix[ [cos(theta), -sin(theta)],
198
+ [sin(theta), cos(theta) ] ]
199
+ offset = NVector[ 0.0, 0.0 ]
200
+ coordmapping = LinearCoordMapping.new(offset, factor)
201
+
202
+ axes_to = [ Axis.new.set_pos( xv[0..(nx/2)] + 1.5*PI ),
203
+ Axis.new.set_pos( yv[0..(ny/2)] ) ]
204
+
205
+ gprot = gp.coordtransform( coordmapping, axes_to, 0, 1 )
206
+ p gprot.val
207
+
208
+ end
209
+