gphys 1.1.1a

Sign up to get free protection for your applications and to get access to all the features.
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
data/doc/varray.html ADDED
@@ -0,0 +1,299 @@
1
+ <?xml version="1.0" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>../lib/numru/gphys/varray.rb</title>
8
+ </head>
9
+ <body>
10
+ <h1><a name="label-0" id="label-0">class NumRu::VArray</a></h1><!-- RDLabel: "class NumRu::VArray" -->
11
+ <p>VArray is a Virtual Array class, in which a multi-dimensional array data is
12
+ stored on memory (NArray, NArrayMiss) or in file (NetCDFVar etc).
13
+ The in-file data handling is left to subclasses such as VArrayNetCDF,
14
+ and this base class handles the following two cases:</p>
15
+ <ol>
16
+ <li>Data are stored on memory using NArray</li>
17
+ <li>Subset of another VArray (possibly a subclass such as VArrayNetCDF).</li>
18
+ </ol>
19
+ <p>Perhaps the latter case needs more explanation. Here, a VArray is defined
20
+ as a subset of another VArray, so the current VArray has only the link
21
+ and info on how the subset is mapped to the other VArray.</p>
22
+ <p>A VArray behaves just like a NArray, i.e., a numeric multi-dimensional
23
+ array. The important difference is that a VArray has a name and can
24
+ have "attributes" like a NetCDF variable. Therefore, VArray can perfectly
25
+ represent a NetCDFVar, which is realized by a sub-class VArrayNetCDF.</p>
26
+ <p>NOMENCLATURE</p>
27
+ <ul>
28
+ <li>value(s): The multi-dimensional numeric array contained in the VArray,
29
+ or its contents</li>
30
+ <li>attribute(s): A combination of name and data that describes a VArray.
31
+ Often realized by NumRu::Attribute class (or it is a NetCDFAttr in
32
+ VArrayNetCDF). The name must be a string, and the type of attribute
33
+ values is restricted to a few classes for compatibility with
34
+ NetCDFAttr (See NumRu::Attribute)</li>
35
+ </ul>
36
+ <h2><a name="label-1" id="label-1">Class Methods</a></h2><!-- RDLabel: "Class Methods" -->
37
+ <dl>
38
+ <dt><h4><a name="label-2" id="label-2"><code>VArray.new(<var>narray</var>=<var>nil</var>, <var>attr</var>=<var>nil</var>, <var>name</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "VArray.new" -->
39
+ <dd>
40
+ <p>A constructor</p>
41
+ <p>ARGUMENTS</p>
42
+ <ul>
43
+ <li>narray (NArray or NArrayMiss; default:nil) The array to be held.
44
+ (nil is used to initialize a mapping to another VArray by a protected
45
+ method).</li>
46
+ <li>attr (NumRu::Attribute; default:nil) Attributes. If nil, an empty </li>
47
+ </ul>
48
+ <pre>attribute object is created and stored.</pre>
49
+ <ul>
50
+ <li>name (String; default nil) Name of the VArray. If nil, it is named "noname".</li>
51
+ </ul>
52
+ <p>RETURN VALUE</p>
53
+ <ul>
54
+ <li>a VArray</li>
55
+ </ul>
56
+ <p>EXAMPLE</p>
57
+ <pre>na = NArray.int(6,3).indgen!
58
+ va1 = VArray.new( na, nil, "test" )</pre></dd>
59
+ <dt><h4><a name="label-3" id="label-3"><code>VArray.new2(<var>ntype</var>, <var>shape</var>, <var>attr</var>=<var>nil</var>, <var>name</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "VArray.new2" -->
60
+ <dd>
61
+ <p>Another constructor. Uses parameters to initialize a NArray to hold.</p>
62
+ <p>ARGUMENTS</p>
63
+ <ul>
64
+ <li>ntype (String or NArray constants): Numeric type of the NArray to be
65
+ held (e.g., "sfloat", "float", NArray::SFLOAT, NArray::FLOAT)</li>
66
+ <li>shape (Array of Integers): shape of the NArray</li>
67
+ <li>attr (Attribute; default:nil) Attributes. If nil, an empty attribute
68
+ object is created and stored.</li>
69
+ <li>name (String; default nil) Name of the VArray.</li>
70
+ </ul>
71
+ <p>RETURN VALUE</p>
72
+ <ul>
73
+ <li>a VArray</li>
74
+ </ul></dd>
75
+ </dl>
76
+ <h2><a name="label-4" id="label-4">Instance Methods</a></h2><!-- RDLabel: "Instance Methods" -->
77
+ <dl>
78
+ <dt><h4><a name="label-5" id="label-5"><code>val</code></a></h4></dt><!-- RDLabel: "val" -->
79
+ <dd>
80
+ <p>Returns the values as a NArray (or NArrayMiss).</p>
81
+ <p>This is the case even when the VArray is a mapping to another. Also,
82
+ this method is to be redefined in subclasses to do the same thing.</p>
83
+ <p>ARGUMENTS -- none</p>
84
+ <p>RETURN VALUE</p>
85
+ <ul>
86
+ <li>a NArray (or NArrayMiss)</li>
87
+ </ul></dd>
88
+ <dt><h4><a name="label-6" id="label-6"><code>val=(<var>narray</var>)</code></a></h4></dt><!-- RDLabel: "val=" -->
89
+ <dd>
90
+ <p>Set values.</p>
91
+ <p>The whole values are set. If you want to set partly, use <a href="#label-9">[]=</a>.
92
+ In this method, values are read from narray and set into the internal
93
+ value holder. Thus, for exampled, the numeric type is not changed
94
+ regardress the numeric type of narray. Use <a href="#label-7">replace_val</a> to
95
+ replace entirely with narray.</p>
96
+ <p>ARGUMENTS</p>
97
+ <ul>
98
+ <li>narray (NArray or NArrayMiss or Numeric): If Numeric, the whole
99
+ values are set to be equal to it. If NArray (or NArrayMiss), its
100
+ shape must agree with the shape of the VArray.</li>
101
+ </ul></dd>
102
+ <dt><h4><a name="label-7" id="label-7"><code>replace_val(<var>narray</var>)</code></a></h4></dt><!-- RDLabel: "replace_val" -->
103
+ <dd>
104
+ <p>Replace the internal array data with the object narray.
105
+ Use <a href="#label-6">val=</a> if you want to copy the values of narray.</p>
106
+ <p>ARGUMENTS</p>
107
+ <ul>
108
+ <li>narray (NArray or NArrayMiss): as pxlained above.
109
+ Its shape must agree with the shape of the VArray (self).</li>
110
+ </ul>
111
+ <p>RETURN VALUE</p>
112
+ <ul>
113
+ <li>if (self.class == VArray), self;
114
+ otherwise (if self.class is a subclass of VArray), a new VArray.</li>
115
+ </ul></dd>
116
+ <dt><h4><a name="label-8" id="label-8"><code>[]</code></a></h4></dt><!-- RDLabel: "[]" -->
117
+ <dd>
118
+ Get a subset. Its usage is the same as NArray#[]</dd>
119
+ <dt><h4><a name="label-9" id="label-9"><code>[] = </code></a></h4></dt><!-- RDLabel: "[]=" -->
120
+ <dd>
121
+ Set a subset. Its usage is the same as NArray#[]=</dd>
122
+ <dt><h4><a name="label-10" id="label-10"><code>attr</code></a></h4></dt><!-- RDLabel: "attr" -->
123
+ <dd>
124
+ To be undefined.</dd>
125
+ <dt><h4><a name="label-11" id="label-11"><code>ntype</code></a></h4></dt><!-- RDLabel: "ntype" -->
126
+ <dd>
127
+ <p>Returns the numeric type.</p>
128
+ <p>ARGUMENTS -- none</p>
129
+ <p>RETURN VALUE</p>
130
+ <ul>
131
+ <li>a String ("byte", "sint", "int", "sfloat", "float", "scomplex"
132
+ "complex", or "obj"). It can be used in NArray.new to initialize
133
+ another NArray.</li>
134
+ </ul></dd>
135
+ <dt><h4><a name="label-12" id="label-12"><code>rank</code></a></h4></dt><!-- RDLabel: "rank" -->
136
+ <dd>
137
+ Returns the rank (number of dimensions)</dd>
138
+ <dt><h4><a name="label-13" id="label-13"><code>shape</code></a></h4></dt><!-- RDLabel: "shape" -->
139
+ <dd>
140
+ Returns the shape</dd>
141
+ <dt><h4><a name="label-14" id="label-14"><code>shape_current</code></a></h4></dt><!-- RDLabel: "shape_current" -->
142
+ <dd>
143
+ aliased to <a href="#label-13">shape</a>.</dd>
144
+ <dt><h4><a name="label-15" id="label-15"><code>length</code></a></h4></dt><!-- RDLabel: "length" -->
145
+ <dd>
146
+ Returns the length of the VArray</dd>
147
+ <dt><h4><a name="label-16" id="label-16"><code>typecode</code></a></h4></dt><!-- RDLabel: "typecode" -->
148
+ <dd>
149
+ Returns the NArray typecode</dd>
150
+ <dt><h4><a name="label-17" id="label-17"><code>name</code></a></h4></dt><!-- RDLabel: "name" -->
151
+ <dd>
152
+ <p>Returns the name</p>
153
+ <p>RETURN VALUE</p>
154
+ <ul>
155
+ <li>(String) name of the VArray</li>
156
+ </ul></dd>
157
+ <dt><h4><a name="label-18" id="label-18"><code>name=(<var>nm</var>)</code></a></h4></dt><!-- RDLabel: "name=" -->
158
+ <dd>
159
+ <p>Changes the name.</p>
160
+ <p>ARGUMENTS</p>
161
+ <ul>
162
+ <li>nm(String): the new name.</li>
163
+ </ul>
164
+ <p>RETURN VALUE</p>
165
+ <ul>
166
+ <li>nm</li>
167
+ </ul></dd>
168
+ <dt><h4><a name="label-19" id="label-19"><code>rename!(<var>nm</var>)</code></a></h4></dt><!-- RDLabel: "rename!" -->
169
+ <dd>
170
+ <p>Changes the name (Same as <a href="#label-18">name=</a>, but returns self)</p>
171
+ <p>ARGUMENTS</p>
172
+ <ul>
173
+ <li>nm(String): the new name.</li>
174
+ </ul>
175
+ <p>RETURN VALUE</p>
176
+ <ul>
177
+ <li>self</li>
178
+ </ul></dd>
179
+ <dt><h4><a name="label-20" id="label-20"><code>rename(<var>nm</var>)</code></a></h4></dt><!-- RDLabel: "rename" -->
180
+ <dd>
181
+ <p>Same as rename! but duplicate the VArray object and set its name.</p>
182
+ <p>This method may not be supported in sub-classes, since it is sometimes
183
+ problematic not to change the original.</p></dd>
184
+ <dt><h4><a name="label-21" id="label-21"><code>copy(<var>to</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "copy" -->
185
+ <dd>
186
+ <p>Copy a VArray. If to is nil, works as the deep cloning (duplication of the entire object).</p>
187
+ <p>Both the values and the attributes are copied.</p>
188
+ <p>ARGUMENTS</p>
189
+ <ul>
190
+ <li>to (VArray (possibly a subclass) or nil): The VArray to which the
191
+ copying is made.</li>
192
+ </ul></dd>
193
+ <dt><h4><a name="label-22" id="label-22"><code>reshape!( *<var>shape</var> )</code></a></h4></dt><!-- RDLabel: "reshape!" -->
194
+ <dd>
195
+ <p>Changes the shape without changing the total size. May not be available in subclasses.</p>
196
+ <p>ARGUMENTS</p>
197
+ <ul>
198
+ <li>shape (Array of Integer): new shape</li>
199
+ </ul>
200
+ <p>RETURN VALUE</p>
201
+ <ul>
202
+ <li>self</li>
203
+ </ul>
204
+ <p>EXAMPLE</p>
205
+ <pre>vary = VArray.new2( "float", [10,2])
206
+ vary.reshape!(5,4) # changes the vary
207
+ vary.copy.reshape!(2,2,5) # make a deep clone and change it
208
+ # This always works with a VArray subclass, since vary.copy
209
+ # makes a deep clone to VArray with NArray.</pre></dd>
210
+ <dt><h4><a name="label-23" id="label-23"><code>file</code></a></h4></dt><!-- RDLabel: "file" -->
211
+ <dd>
212
+ <p>Returns a file object if the data of the VArray is in a file, nil if it is on memory</p>
213
+ <p>ARGUMENTS</p>
214
+ <ul>
215
+ <li>none</li>
216
+ </ul>
217
+ <p>RETURN VALUE</p>
218
+ <ul>
219
+ <li>an object representing the file in which data are stored. Its class
220
+ depends on the file type. nil is returned if the data is not in a file.</li>
221
+ </ul></dd>
222
+ <dt><h4><a name="label-24" id="label-24"><code>transpose(*<var>dims</var>)</code></a></h4></dt><!-- RDLabel: "transpose" -->
223
+ <dd>
224
+ Transpose. Argument specification is as in NArray.</dd>
225
+ <dt><h4><a name="label-25" id="label-25"><code>reshape(*<var>shape</var>)</code></a></h4></dt><!-- RDLabel: "reshape" -->
226
+ <dd>
227
+ Reshape. Argument specification is as in NArray.</dd>
228
+ <dt><h4><a name="label-26" id="label-26"><code>axis_draw_positive</code></a></h4></dt><!-- RDLabel: "axis_draw_positive" -->
229
+ <dd>
230
+ <p>Returns the direction to plot the axis (meaningful only if self is a
231
+ coordinate variable.) </p>
232
+ <p>The current implementation is based on NetCDF conventions,
233
+ so REDEFINE IT IN SUBCLASSES if it is not appropriate.</p>
234
+ <p>RETURN VALUE</p>
235
+ <ul>
236
+ <li>one of the following:
237
+ <ul>
238
+ <li>true: axis should be drawn in the increasing order (to right/upward)</li>
239
+ <li>false: axis should be drawn in the decreasing order</li>
240
+ <li>nil: not specified</li>
241
+ </ul></li>
242
+ </ul></dd>
243
+ <dt><h4><a name="label-27" id="label-27"><code>axis_cyclic?</code></a></h4></dt><!-- RDLabel: "axis_cyclic?" -->
244
+ <dd>
245
+ <p>Returns whether the axis is cyclic (meaningful only if self is a
246
+ coordinate variable.) </p>
247
+ <p>The current implementation is based on NetCDF conventions,
248
+ so REDEFINE IT IN SUBCLASSES if it is not appropriate.</p>
249
+ <p>RETURN VALUE</p>
250
+ <ul>
251
+ <li>one of the following:
252
+ <ul>
253
+ <li>true: cyclic</li>
254
+ <li>false: not cyclic</li>
255
+ <li>nil: not specified</li>
256
+ </ul></li>
257
+ </ul></dd>
258
+ <dt><h4><a name="label-28" id="label-28"><code>axis_modulo</code></a></h4></dt><!-- RDLabel: "axis_modulo" -->
259
+ <dd>
260
+ <p>Returns the modulo of a cyclic axis (meaningful only if self is a
261
+ coordinate variable and it is cyclic.) </p>
262
+ <p>The current implementation is based on NetCDF conventions,
263
+ so REDEFINE IT IN SUBCLASSES if it is not appropriate.</p>
264
+ <p>RETURN VALUE</p>
265
+ <ul>
266
+ <li>one of the following:
267
+ <ul>
268
+ <li>Float if the modulo is defined</li>
269
+ <li>nil if modulo is not found</li>
270
+ </ul></li>
271
+ </ul></dd>
272
+ <dt><h4><a name="label-29" id="label-29"><code>axis_cyclic_extendible?</code></a></h4></dt><!-- RDLabel: "axis_cyclic_extendible?" -->
273
+ <dd>
274
+ (meaningful only if self is a coordinate variable.)
275
+ Returns true if self is cyclic and it is suitable to exend
276
+ cyclically (having the distance between both ends
277
+ equal to (modulo - dx), where dx is the mean increment).</dd>
278
+ <dt><h4><a name="label-30" id="label-30"><code>coerce(<var>other</var>)</code></a></h4></dt><!-- RDLabel: "coerce" -->
279
+ <dd>
280
+ For Numeric operators. (If you do not know it, see a manual or book of Ruby)</dd>
281
+ </dl>
282
+ <h2><a name="label-31" id="label-31">Methods compatible with NArray</a></h2><!-- RDLabel: "Methods compatible with NArray" -->
283
+ <p>VArray is a numeric multi-dimensional array, so it supports most of the
284
+ methods and operators in NArray. Here, the name of those methods are just
285
+ quoted. See the documentation of NArray for their usage.</p>
286
+ <h3><a name="label-32" id="label-32">Math functions</a></h3><!-- RDLabel: "Math functions" -->
287
+ <h4><a name="label-33" id="label-33">sqrt, exp, log, log10, log2, sin, cos, tan, sinh, cosh, tanh, asin, acos, atan, asinh, acosh, atanh, csc, sec, cot, csch, sech, coth, acsc, asec, acot, acsch, asech, acoth</a></h4><!-- RDLabel: "sqrt, exp, log, log10, log2, sin, cos, tan, sinh, cosh, tanh, asin, acos, atan, asinh, acosh, atanh, csc, sec, cot, csch, sech, coth, acsc, asec, acot, acsch, asech, acoth" -->
288
+ <h3><a name="label-34" id="label-34">Binary operators</a></h3><!-- RDLabel: "Binary operators" -->
289
+ <h4><a name="label-35" id="label-35">-, +, *, /, %, **, .add!, .sub!, .mul!, .div!, mod!, &gt;, &gt;=, &lt;, &lt;=, &amp;, |, ^, .eq, .ne, .gt, .ge, .lt, .le, .and, .or, .xor, .not</a></h4><!-- RDLabel: "-, +, *, /, %, **, .add!, .sub!, .mul!, .div!, mod!, >, >=, <, <=, &, |, ^, .eq, .ne, .gt, .ge, .lt, .le, .and, .or, .xor, .not" -->
290
+ <h3><a name="label-36" id="label-36">Unary operators</a></h3><!-- RDLabel: "Unary operators" -->
291
+ <h4><a name="label-37" id="label-37">~ - +</a></h4><!-- RDLabel: "~ - +" -->
292
+ <h3><a name="label-38" id="label-38">Mean etc</a></h3><!-- RDLabel: "Mean etc" -->
293
+ <h4><a name="label-39" id="label-39">mean, sum, stddev, min, max, median</a></h4><!-- RDLabel: "mean, sum, stddev, min, max, median" -->
294
+ <h3><a name="label-40" id="label-40">Other methods</a></h3><!-- RDLabel: "Other methods" -->
295
+ <p>These methods returns a NArray (not a VArray).</p>
296
+ <h4><a name="label-41" id="label-41">all?, any?, none?, where, where2, floor, ceil, round, to_f, to_i, to_a</a></h4><!-- RDLabel: "all?, any?, none?, where, where2, floor, ceil, round, to_f, to_i, to_a" -->
297
+
298
+ </body>
299
+ </html>
@@ -0,0 +1,67 @@
1
+ <?xml version="1.0" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>../lib/numru/gphys/varraycomposite.rb</title>
8
+ </head>
9
+ <body>
10
+ <h1><a name="label-0" id="label-0">class NumRu::VArrayComposite &lt; NumRu::VArray</a></h1><!-- RDLabel: "class NumRu::VArrayComposite < NumRu::VArray" -->
11
+ <p>a VArray that consists of multiple VArrays tiled regularly
12
+ (possibly in multi-dimension). Except for the constructer
13
+ "new" and <!-- Reference, RDLabel "attr_update" doesn't exist --><em class="label-not-found">attr_update</em><!-- Reference end -->, the usage of this class is the same as VArray.</p>
14
+ <p>Note that the name and the attributes of a VArrayComposite is
15
+ borrowed form one of the VArrays contained (actually, the first one
16
+ is used). Currently, no check is made
17
+ regarding whether the names and attributes are the same among the
18
+ VArrays contained. If you rename a VArrayComposite, the change will
19
+ be made with all the VArrays contained. However, currently,
20
+ change of the attributes are only reflected only in the first
21
+ VArray. You have to call <!-- Reference, RDLabel "attr_update" doesn't exist --><em class="label-not-found">attr_update</em><!-- Reference end --> separately.</p>
22
+ <h2><a name="label-1" id="label-1">Class methods</a></h2><!-- RDLabel: "Class methods" -->
23
+ <dl>
24
+ <dt><h4><a name="label-2" id="label-2"><code>VArrayComposite.new(<var>varrays</var>)</code></a></h4></dt><!-- RDLabel: "VArrayComposite.new" -->
25
+ <dd>
26
+ <p>Constructor</p>
27
+ <p>ARGUMENTS</p>
28
+ <ul>
29
+ <li>varrays (NArray of VArray) : VArrays to be included, gridded
30
+ regularly in a NArray.</li>
31
+ </ul>
32
+ <p>RETURN VALUE</p>
33
+ <ul>
34
+ <li>a VArrayComposite</li>
35
+ </ul>
36
+ <p>EXAMPLES</p>
37
+ <ul>
38
+ <li><p>Suppose that you have VArrays va00, va01, va10, va00,
39
+ with va00 and va10 having a same 0th dimension length,
40
+ va01 and va11 having a same 0th dimension length,
41
+ and va00 and va01 having a same 1st dimention length.</p>
42
+ <pre>varrays = NArray[ [ va00, va01 ],
43
+ [ va10, va11 ] ]
44
+ vac = VArrayComposite.new(varrays)</pre>
45
+ <p>This will create a composite VArray tiled two-dimensionally.</p></li>
46
+ <li><p>You can create a VArray that lacks one or more VArrays as
47
+ long as the shape is unambiguous:</p>
48
+ <pre>vac = VArrayComposite.new( NArray[ [ va00, va01 ],
49
+ [ va10, nil ] ] )</pre>
50
+ <p>is allowed, but </p>
51
+ <pre>vac = VArrayComposite.new( NArray[ [ va00, nil ],
52
+ [ va10, nil ] ] )</pre>
53
+ <p>is prohibited.</p>
54
+ <p>NOTICE: At this moment, handling of such nil-contianing
55
+ VArrayComposite is very limited, and many methods do not work.</p></li>
56
+ <li><p>Suppose that you have 3D VArrays va0, va1, va2, va3,
57
+ and you want to concatenate them with the 3rd dimension.</p>
58
+ <pre>varrays = NArray[ va0,va1,va2,va3 ].newdim(0,0)</pre>
59
+ <p>This will create a 3D NArray with a shape of [1,1,4].
60
+ Then you can make the composite as follows:</p>
61
+ <pre>vac = VArrayComposite.new(varrays)</pre></li>
62
+ </ul></dd>
63
+ </dl>
64
+ <p>Usage of all the other class methods are the same as in VArray.</p>
65
+
66
+ </body>
67
+ </html>
data/ext_coord.c ADDED
@@ -0,0 +1,209 @@
1
+ /* ext_coord.c : Extention library related to coordinate handling in GPhys
2
+ */
3
+
4
+ #include<stdio.h>
5
+ #include<string.h>
6
+ #include "ruby.h"
7
+ #include "narray.h"
8
+
9
+ #ifndef RARRAY_PTR
10
+ # define RARRAY_PTR(ary) (RARRAY(ary)->ptr)
11
+ #endif
12
+ #ifndef RARRAY_LEN
13
+ # define RARRAY_LEN(ary) (RARRAY(ary)->len)
14
+ #endif
15
+
16
+ /* cut_range : a private method for AssocCoord (used in AssocCoord#cut)
17
+ */
18
+ static VALUE
19
+ assoc_coord_cut_range(self, vmins, vmaxs, crds, masks, crdaxexist, orgaxlens)
20
+ VALUE self, vmins, vmaxs, crds, masks, crdaxexist, orgaxlens;
21
+ // All input variables are supposed to be Arrays
22
+ {
23
+ VALUE wheres, whna; // return value (Array)
24
+ int nc, ic, na, ia, jlen, j, klen, k, ndimk, dimk;
25
+ int *lens, lentot, lenmax, *mod, *sub, **mlt, *jmlt, *dimk2a;
26
+ int last_non0, l, cidx, *natype, *nomask, included, whcount;
27
+ int32_t **axexist, *whptr, *whbuf;
28
+ double *vmax, *vmin, val, **dval;
29
+ float **fval;
30
+ int8_t **mask;
31
+
32
+ nc = RARRAY_LEN(crds); // lengths of vmins,vmaxs,crds,masks,crdaxexist
33
+ na = RARRAY_LEN(orgaxlens);
34
+ wheres = rb_ary_new();
35
+
36
+ /* input check */
37
+
38
+ if(nc==0){rb_raise(rb_eArgError,"crds empty [%s:%d]",__FILE__,__LINE__);}
39
+ if(na==0){rb_raise(rb_eArgError,"orgaxlens empty [%s:%d]",__FILE__,__LINE__);}
40
+ if ( nc!=RARRAY_LEN(vmins) || nc!=RARRAY_LEN(vmaxs) ||
41
+ nc!=RARRAY_LEN(masks) || nc!=RARRAY_LEN(crdaxexist) ) {
42
+ rb_raise(rb_eArgError,"lengths of array do not agree [%s:%d]",
43
+ __FILE__,__LINE__);
44
+ }
45
+
46
+ /* info regaring lengths of original axes */
47
+
48
+ lentot = 1;
49
+ lenmax = -1;
50
+ lens = ALLOCA_N(int,na);
51
+ for(ia=0; ia<na; ia++){
52
+ lens[ia] = NUM2INT( RARRAY_PTR(orgaxlens)[ia] );
53
+ lentot *= lens[ia];
54
+ if (lens[ia] > lenmax) { lenmax = lens[ia]; }
55
+ }
56
+ ndimk = ( (na==1) ? 1 : (na-1) ) ;
57
+ mod = ALLOCA_N(int,ndimk);
58
+ sub = ALLOCA_N(int,ndimk);
59
+ mlt = ALLOCA_N(int*,nc);
60
+ axexist = ALLOCA_N(int32_t*,nc);
61
+ for(ic=0; ic<nc; ic++){
62
+ mlt[ic] = ALLOCA_N(int,ndimk);
63
+ axexist[ic] = NA_PTR_TYPE( RARRAY_PTR(crdaxexist)[ic], int32_t* );
64
+ }
65
+ jmlt = ALLOCA_N(int,nc);
66
+ dimk2a = ALLOCA_N(int,ndimk);
67
+
68
+ /* ruby objs to C for coordinates and cut params */
69
+
70
+ vmin = ALLOCA_N(double,nc);
71
+ vmax = ALLOCA_N(double,nc);
72
+ dval = ALLOCA_N(double*,nc);
73
+ fval = ALLOCA_N(float*,nc);
74
+ mask = ALLOCA_N(int8_t*,nc);
75
+ nomask = ALLOCA_N(int,nc);
76
+ natype = ALLOCA_N(int,nc);
77
+ for(ic=0; ic<nc; ic++){
78
+ vmin[ic] = NUM2DBL( RARRAY_PTR(vmins)[ic] );
79
+ vmax[ic] = NUM2DBL( RARRAY_PTR(vmaxs)[ic] );
80
+ natype[ic] = NA_TYPE( RARRAY_PTR(crds)[ic]);
81
+ if ( natype[ic] == NA_DFLOAT ) {
82
+ dval[ic] = NA_PTR_TYPE( RARRAY_PTR(crds)[ic], double* );
83
+ } else if ( natype[ic] == NA_SFLOAT ) {
84
+ fval[ic] = NA_PTR_TYPE( RARRAY_PTR(crds)[ic], float* );
85
+ } else {
86
+ rb_raise(rb_eArgError,"Associate coordinates must be float or sfloat [%s:%d]",__FILE__,__LINE__);
87
+ }
88
+ if ( RARRAY_PTR(masks)[ic] == Qnil ){
89
+ mask[ic] = NULL;
90
+ nomask[ic] = 1;
91
+ } else {
92
+ mask[ic] = NA_PTR_TYPE( RARRAY_PTR(masks)[ic], u_int8_t* );
93
+ nomask[ic] = 0;
94
+ }
95
+ }
96
+
97
+ /* prepare output objs */
98
+ whbuf = ALLOCA_N(int32_t,lenmax);
99
+
100
+ /* main loop */
101
+ for(ia=0; ia<na; ia++){
102
+
103
+ /* parameters for positioning */
104
+ jlen = lens[ia];
105
+ klen = lentot / jlen;
106
+
107
+ for(dimk=0; dimk<ndimk; dimk++){
108
+ if (dimk<ia || na==1) {
109
+ dimk2a[dimk] = dimk;
110
+ } else {
111
+ dimk2a[dimk] = dimk+1;
112
+ }
113
+ }
114
+ for(dimk=0; dimk<ndimk; dimk++){
115
+ if(dimk==0){
116
+ mod[dimk] = lens[dimk2a[dimk]];
117
+ sub[dimk] = 1;
118
+ for(ic=0; ic<nc; ic++){
119
+ if( axexist[ic][dimk2a[dimk]] == 1 ){ // has the ax
120
+ mlt[ic][dimk] = 1;
121
+ } else {
122
+ mlt[ic][dimk] = 0;
123
+ }
124
+ }
125
+ } else {
126
+ mod[dimk] = mod[dimk-1] * lens[dimk2a[dimk]];
127
+ sub[dimk] = mod[dimk-1];
128
+ for(ic=0; ic<nc; ic++){
129
+ if( axexist[ic][dimk2a[dimk]] == 1 ){ // has the ax
130
+ last_non0 = 1;
131
+ for(l=dimk-1; l>=0; l--) {
132
+ if( mlt[ic][l] != 0){
133
+ last_non0 = mlt[ic][l];
134
+ break;
135
+ }
136
+ }
137
+ mlt[ic][dimk] = last_non0 * lens[dimk2a[dimk]];
138
+ } else {
139
+ mlt[ic][dimk] = 0;
140
+ }
141
+ }
142
+ }
143
+ for(ic=0; ic<nc; ic++){
144
+ if (dimk>=ia) { mlt[ic][dimk] *= lens[ia];}
145
+ }
146
+ //printf("## %d %d %d %d : ",ia,dimk,mod[dimk],sub[dimk]);//DEL later
147
+ //for(ic=0;ic<nc;ic++){printf(" %d",mlt[ic][dimk]);} //DEL later
148
+ //printf("\n"); //DEL later
149
+ }
150
+ for(ic=0; ic<nc; ic++){
151
+ jmlt[ic] = 1;
152
+ for(dimk=0; dimk<ia; dimk++){
153
+ if( axexist[ic][dimk] == 1 ){ // has the ax
154
+ jmlt[ic] *= lens[dimk];
155
+ }
156
+ }
157
+ }
158
+
159
+ /* judge in/out */
160
+ whcount = 0;
161
+ for(j=0; j<jlen; j++){
162
+ for(k=0; k<klen; k++){
163
+ included = 0; // initialization to avoid -Wall warning
164
+ for(ic=0; ic<nc; ic++){
165
+ cidx = 0;
166
+ for(dimk=0; dimk<ndimk; dimk++){
167
+ cidx += ( (k/sub[dimk]) % mod[dimk] ) * mlt[ic][dimk];
168
+ }
169
+ cidx += jmlt[ic]*j;
170
+ if ( natype[ic] == NA_DFLOAT ) {
171
+ val = dval[ic][cidx];
172
+ } else {
173
+ val = fval[ic][cidx];
174
+ }
175
+ //printf("! %d %d %d %d %f\n",j,k,ic,cidx,val); //DEL later
176
+ included = ( (nomask[ic] || mask[ic][cidx]) &&
177
+ val >= vmin[ic] &&
178
+ val <= vmax[ic] );
179
+ if (!included) {break;}
180
+ }
181
+ if(included){
182
+ whbuf[whcount] = j;
183
+ whcount++;
184
+ break;
185
+ }
186
+ }
187
+ }
188
+ whna = na_make_object(NA_LINT, 1, &whcount, cNArray);
189
+ rb_ary_push( wheres, whna );
190
+ whptr = NA_PTR_TYPE( whna, int32_t* );
191
+ for(j=0; j<whcount; j++){
192
+ whptr[j] = whbuf[j];
193
+ }
194
+ }
195
+
196
+ return( wheres );
197
+ }
198
+
199
+ void
200
+ init_ext_coord()
201
+ {
202
+ static VALUE mNumRu;
203
+ static VALUE cAssocCoords;
204
+
205
+ // rb_require("narray"); // it does not work
206
+ mNumRu = rb_define_module("NumRu");
207
+ cAssocCoords = rb_define_class_under(mNumRu, "AssocCoords", rb_cObject);
208
+ rb_define_private_method(cAssocCoords,"cut_range",assoc_coord_cut_range,6);
209
+ }
data/ext_init.c ADDED
@@ -0,0 +1,7 @@
1
+ void
2
+ Init_gphys_ext()
3
+ {
4
+ init_ext_coord();
5
+ init_gphys_interpo();
6
+ init_gphys_multibitIO();
7
+ }
data/extconf.rb ADDED
@@ -0,0 +1,42 @@
1
+ require "mkmf"
2
+ $extout_prefix = '/numru'
3
+ alias __install_dirs install_dirs
4
+ def install_dirs
5
+ dirs = __install_dirs
6
+ dirs.assoc("RUBYARCHDIR")[1].sub!(/target_prefix/,'extout_prefix')
7
+ dirs
8
+ end
9
+
10
+ #dir_config('narray',$sitearchdir,$sitearchdir)
11
+ hoge = Gem::GemPathSearcher.new.find("narray")
12
+ narray_fullname = hoge.full_name
13
+ narray_installpath = hoge.installation_path
14
+ narray_include = "#{narray_installpath}/gems/#{narray_fullname}/"
15
+ narray_lib = "#{narray_installpath}/gems/#{narray_fullname}/"
16
+ dir_config('narray',narray_include,narray_lib)
17
+
18
+ if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
19
+ print <<EOS
20
+ ** configure error **
21
+ Header narray.h or narray_config.h is not found. If you have these files in
22
+ /narraydir/include, try the following:
23
+
24
+ % ruby extconf.rb --with-narray-include=/narraydir/include
25
+
26
+ EOS
27
+ exit(-1)
28
+ end
29
+
30
+ if /cygwin|mingw/ =~ RUBY_PLATFORM
31
+ unless have_library("narray")
32
+ print <<-EOS
33
+ ** configure error **
34
+ libnarray.a is not found.
35
+ % ruby extconf.rb --with-narray-lib=/narraydir/lib
36
+
37
+ EOS
38
+ exit(-1)
39
+ end
40
+ end
41
+
42
+ create_makefile("numru/gphys_ext")