gphys 1.2.2.1 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (405) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -17
  3. data/.rspec +2 -0
  4. data/.travis.yml +3 -0
  5. data/ChangeLog +5762 -753
  6. data/LICENSE.txt +30 -18
  7. data/Rakefile +1 -0
  8. data/bin/console +14 -0
  9. data/bin/gpcat +43 -2
  10. data/bin/gpcut +16 -0
  11. data/bin/gpvect +167 -15
  12. data/bin/gpview +254 -51
  13. data/bin/setup +7 -0
  14. data/dim_op.c +1220 -0
  15. data/doc/attribute.html +19 -0
  16. data/doc/attributenetcdf.html +15 -0
  17. data/doc/axis.html +387 -0
  18. data/doc/coordmapping.html +111 -0
  19. data/doc/coordtransform.html +36 -0
  20. data/doc/dclext.html +821 -0
  21. data/doc/derivative/gphys-derivative.html +100 -0
  22. data/doc/derivative/index.html +21 -0
  23. data/doc/derivative/index.rd +14 -0
  24. data/doc/derivative/math-doc/document.pdf +0 -0
  25. data/doc/derivative/math-doc/document.tex +158 -0
  26. data/doc/derivative/math-doc/document/document.css +30 -0
  27. data/doc/derivative/math-doc/document/document.html +57 -0
  28. data/doc/derivative/math-doc/document/images.aux +1 -0
  29. data/doc/derivative/math-doc/document/images.log +385 -0
  30. data/doc/derivative/math-doc/document/images.pl +186 -0
  31. data/doc/derivative/math-doc/document/images.tex +364 -0
  32. data/doc/derivative/math-doc/document/img1.png +0 -0
  33. data/doc/derivative/math-doc/document/img10.png +0 -0
  34. data/doc/derivative/math-doc/document/img11.png +0 -0
  35. data/doc/derivative/math-doc/document/img12.png +0 -0
  36. data/doc/derivative/math-doc/document/img13.png +0 -0
  37. data/doc/derivative/math-doc/document/img14.png +0 -0
  38. data/doc/derivative/math-doc/document/img15.png +0 -0
  39. data/doc/derivative/math-doc/document/img16.png +0 -0
  40. data/doc/derivative/math-doc/document/img17.png +0 -0
  41. data/doc/derivative/math-doc/document/img18.png +0 -0
  42. data/doc/derivative/math-doc/document/img19.png +0 -0
  43. data/doc/derivative/math-doc/document/img2.png +0 -0
  44. data/doc/derivative/math-doc/document/img20.png +0 -0
  45. data/doc/derivative/math-doc/document/img21.png +0 -0
  46. data/doc/derivative/math-doc/document/img22.png +0 -0
  47. data/doc/derivative/math-doc/document/img23.png +0 -0
  48. data/doc/derivative/math-doc/document/img24.png +0 -0
  49. data/doc/derivative/math-doc/document/img25.png +0 -0
  50. data/doc/derivative/math-doc/document/img26.png +0 -0
  51. data/doc/derivative/math-doc/document/img27.png +0 -0
  52. data/doc/derivative/math-doc/document/img28.png +0 -0
  53. data/doc/derivative/math-doc/document/img29.png +0 -0
  54. data/doc/derivative/math-doc/document/img3.png +0 -0
  55. data/doc/derivative/math-doc/document/img30.png +0 -0
  56. data/doc/derivative/math-doc/document/img4.png +0 -0
  57. data/doc/derivative/math-doc/document/img5.png +0 -0
  58. data/doc/derivative/math-doc/document/img6.png +0 -0
  59. data/doc/derivative/math-doc/document/img7.png +0 -0
  60. data/doc/derivative/math-doc/document/img8.png +0 -0
  61. data/doc/derivative/math-doc/document/img9.png +0 -0
  62. data/doc/derivative/math-doc/document/index.html +57 -0
  63. data/doc/derivative/math-doc/document/labels.pl +13 -0
  64. data/doc/derivative/math-doc/document/next.png +0 -0
  65. data/doc/derivative/math-doc/document/next_g.png +0 -0
  66. data/doc/derivative/math-doc/document/node1.html +238 -0
  67. data/doc/derivative/math-doc/document/node2.html +75 -0
  68. data/doc/derivative/math-doc/document/prev.png +0 -0
  69. data/doc/derivative/math-doc/document/prev_g.png +0 -0
  70. data/doc/derivative/math-doc/document/up.png +0 -0
  71. data/doc/derivative/math-doc/document/up_g.png +0 -0
  72. data/doc/derivative/numru-derivative.html +158 -0
  73. data/doc/ep_flux/ep_flux.html +469 -0
  74. data/doc/ep_flux/ggraph_on_merdional_section.html +71 -0
  75. data/doc/ep_flux/index.html +31 -0
  76. data/doc/ep_flux/index.rd +24 -0
  77. data/doc/ep_flux/math-doc/document.pdf +0 -0
  78. data/doc/ep_flux/math-doc/document.tex +2018 -0
  79. data/doc/ep_flux/math-doc/document/WARNINGS +1 -0
  80. data/doc/ep_flux/math-doc/document/contents.png +0 -0
  81. data/doc/ep_flux/math-doc/document/crossref.png +0 -0
  82. data/doc/ep_flux/math-doc/document/document.css +30 -0
  83. data/doc/ep_flux/math-doc/document/document.html +101 -0
  84. data/doc/ep_flux/math-doc/document/images.aux +1 -0
  85. data/doc/ep_flux/math-doc/document/images.log +1375 -0
  86. data/doc/ep_flux/math-doc/document/images.pl +1328 -0
  87. data/doc/ep_flux/math-doc/document/images.tex +1471 -0
  88. data/doc/ep_flux/math-doc/document/img1.png +0 -0
  89. data/doc/ep_flux/math-doc/document/img10.png +0 -0
  90. data/doc/ep_flux/math-doc/document/img100.png +0 -0
  91. data/doc/ep_flux/math-doc/document/img101.png +0 -0
  92. data/doc/ep_flux/math-doc/document/img102.png +0 -0
  93. data/doc/ep_flux/math-doc/document/img103.png +0 -0
  94. data/doc/ep_flux/math-doc/document/img104.png +0 -0
  95. data/doc/ep_flux/math-doc/document/img105.png +0 -0
  96. data/doc/ep_flux/math-doc/document/img106.png +0 -0
  97. data/doc/ep_flux/math-doc/document/img107.png +0 -0
  98. data/doc/ep_flux/math-doc/document/img108.png +0 -0
  99. data/doc/ep_flux/math-doc/document/img109.png +0 -0
  100. data/doc/ep_flux/math-doc/document/img11.png +0 -0
  101. data/doc/ep_flux/math-doc/document/img110.png +0 -0
  102. data/doc/ep_flux/math-doc/document/img111.png +0 -0
  103. data/doc/ep_flux/math-doc/document/img112.png +0 -0
  104. data/doc/ep_flux/math-doc/document/img113.png +0 -0
  105. data/doc/ep_flux/math-doc/document/img114.png +0 -0
  106. data/doc/ep_flux/math-doc/document/img115.png +0 -0
  107. data/doc/ep_flux/math-doc/document/img116.png +0 -0
  108. data/doc/ep_flux/math-doc/document/img117.png +0 -0
  109. data/doc/ep_flux/math-doc/document/img118.png +0 -0
  110. data/doc/ep_flux/math-doc/document/img119.png +0 -0
  111. data/doc/ep_flux/math-doc/document/img12.png +0 -0
  112. data/doc/ep_flux/math-doc/document/img120.png +0 -0
  113. data/doc/ep_flux/math-doc/document/img121.png +0 -0
  114. data/doc/ep_flux/math-doc/document/img122.png +0 -0
  115. data/doc/ep_flux/math-doc/document/img123.png +0 -0
  116. data/doc/ep_flux/math-doc/document/img124.png +0 -0
  117. data/doc/ep_flux/math-doc/document/img125.png +0 -0
  118. data/doc/ep_flux/math-doc/document/img126.png +0 -0
  119. data/doc/ep_flux/math-doc/document/img127.png +0 -0
  120. data/doc/ep_flux/math-doc/document/img128.png +0 -0
  121. data/doc/ep_flux/math-doc/document/img129.png +0 -0
  122. data/doc/ep_flux/math-doc/document/img13.png +0 -0
  123. data/doc/ep_flux/math-doc/document/img130.png +0 -0
  124. data/doc/ep_flux/math-doc/document/img131.png +0 -0
  125. data/doc/ep_flux/math-doc/document/img132.png +0 -0
  126. data/doc/ep_flux/math-doc/document/img133.png +0 -0
  127. data/doc/ep_flux/math-doc/document/img134.png +0 -0
  128. data/doc/ep_flux/math-doc/document/img135.png +0 -0
  129. data/doc/ep_flux/math-doc/document/img136.png +0 -0
  130. data/doc/ep_flux/math-doc/document/img137.png +0 -0
  131. data/doc/ep_flux/math-doc/document/img138.png +0 -0
  132. data/doc/ep_flux/math-doc/document/img139.png +0 -0
  133. data/doc/ep_flux/math-doc/document/img14.png +0 -0
  134. data/doc/ep_flux/math-doc/document/img140.png +0 -0
  135. data/doc/ep_flux/math-doc/document/img141.png +0 -0
  136. data/doc/ep_flux/math-doc/document/img142.png +0 -0
  137. data/doc/ep_flux/math-doc/document/img143.png +0 -0
  138. data/doc/ep_flux/math-doc/document/img144.png +0 -0
  139. data/doc/ep_flux/math-doc/document/img145.png +0 -0
  140. data/doc/ep_flux/math-doc/document/img146.png +0 -0
  141. data/doc/ep_flux/math-doc/document/img147.png +0 -0
  142. data/doc/ep_flux/math-doc/document/img148.png +0 -0
  143. data/doc/ep_flux/math-doc/document/img149.png +0 -0
  144. data/doc/ep_flux/math-doc/document/img15.png +0 -0
  145. data/doc/ep_flux/math-doc/document/img150.png +0 -0
  146. data/doc/ep_flux/math-doc/document/img151.png +0 -0
  147. data/doc/ep_flux/math-doc/document/img152.png +0 -0
  148. data/doc/ep_flux/math-doc/document/img153.png +0 -0
  149. data/doc/ep_flux/math-doc/document/img154.png +0 -0
  150. data/doc/ep_flux/math-doc/document/img155.png +0 -0
  151. data/doc/ep_flux/math-doc/document/img156.png +0 -0
  152. data/doc/ep_flux/math-doc/document/img157.png +0 -0
  153. data/doc/ep_flux/math-doc/document/img158.png +0 -0
  154. data/doc/ep_flux/math-doc/document/img159.png +0 -0
  155. data/doc/ep_flux/math-doc/document/img16.png +0 -0
  156. data/doc/ep_flux/math-doc/document/img160.png +0 -0
  157. data/doc/ep_flux/math-doc/document/img161.png +0 -0
  158. data/doc/ep_flux/math-doc/document/img162.png +0 -0
  159. data/doc/ep_flux/math-doc/document/img163.png +0 -0
  160. data/doc/ep_flux/math-doc/document/img164.png +0 -0
  161. data/doc/ep_flux/math-doc/document/img165.png +0 -0
  162. data/doc/ep_flux/math-doc/document/img166.png +0 -0
  163. data/doc/ep_flux/math-doc/document/img167.png +0 -0
  164. data/doc/ep_flux/math-doc/document/img168.png +0 -0
  165. data/doc/ep_flux/math-doc/document/img169.png +0 -0
  166. data/doc/ep_flux/math-doc/document/img17.png +0 -0
  167. data/doc/ep_flux/math-doc/document/img170.png +0 -0
  168. data/doc/ep_flux/math-doc/document/img171.png +0 -0
  169. data/doc/ep_flux/math-doc/document/img172.png +0 -0
  170. data/doc/ep_flux/math-doc/document/img173.png +0 -0
  171. data/doc/ep_flux/math-doc/document/img174.png +0 -0
  172. data/doc/ep_flux/math-doc/document/img175.png +0 -0
  173. data/doc/ep_flux/math-doc/document/img176.png +0 -0
  174. data/doc/ep_flux/math-doc/document/img177.png +0 -0
  175. data/doc/ep_flux/math-doc/document/img178.png +0 -0
  176. data/doc/ep_flux/math-doc/document/img179.png +0 -0
  177. data/doc/ep_flux/math-doc/document/img18.png +0 -0
  178. data/doc/ep_flux/math-doc/document/img180.png +0 -0
  179. data/doc/ep_flux/math-doc/document/img181.png +0 -0
  180. data/doc/ep_flux/math-doc/document/img182.png +0 -0
  181. data/doc/ep_flux/math-doc/document/img183.png +0 -0
  182. data/doc/ep_flux/math-doc/document/img184.png +0 -0
  183. data/doc/ep_flux/math-doc/document/img185.png +0 -0
  184. data/doc/ep_flux/math-doc/document/img186.png +0 -0
  185. data/doc/ep_flux/math-doc/document/img187.png +0 -0
  186. data/doc/ep_flux/math-doc/document/img188.png +0 -0
  187. data/doc/ep_flux/math-doc/document/img189.png +0 -0
  188. data/doc/ep_flux/math-doc/document/img19.png +0 -0
  189. data/doc/ep_flux/math-doc/document/img190.png +0 -0
  190. data/doc/ep_flux/math-doc/document/img191.png +0 -0
  191. data/doc/ep_flux/math-doc/document/img192.png +0 -0
  192. data/doc/ep_flux/math-doc/document/img193.png +0 -0
  193. data/doc/ep_flux/math-doc/document/img194.png +0 -0
  194. data/doc/ep_flux/math-doc/document/img195.png +0 -0
  195. data/doc/ep_flux/math-doc/document/img196.png +0 -0
  196. data/doc/ep_flux/math-doc/document/img197.png +0 -0
  197. data/doc/ep_flux/math-doc/document/img198.png +0 -0
  198. data/doc/ep_flux/math-doc/document/img199.png +0 -0
  199. data/doc/ep_flux/math-doc/document/img2.png +0 -0
  200. data/doc/ep_flux/math-doc/document/img20.png +0 -0
  201. data/doc/ep_flux/math-doc/document/img200.png +0 -0
  202. data/doc/ep_flux/math-doc/document/img21.png +0 -0
  203. data/doc/ep_flux/math-doc/document/img22.png +0 -0
  204. data/doc/ep_flux/math-doc/document/img23.png +0 -0
  205. data/doc/ep_flux/math-doc/document/img24.png +0 -0
  206. data/doc/ep_flux/math-doc/document/img25.png +0 -0
  207. data/doc/ep_flux/math-doc/document/img26.png +0 -0
  208. data/doc/ep_flux/math-doc/document/img27.png +0 -0
  209. data/doc/ep_flux/math-doc/document/img28.png +0 -0
  210. data/doc/ep_flux/math-doc/document/img29.png +0 -0
  211. data/doc/ep_flux/math-doc/document/img3.png +0 -0
  212. data/doc/ep_flux/math-doc/document/img30.png +0 -0
  213. data/doc/ep_flux/math-doc/document/img31.png +0 -0
  214. data/doc/ep_flux/math-doc/document/img32.png +0 -0
  215. data/doc/ep_flux/math-doc/document/img33.png +0 -0
  216. data/doc/ep_flux/math-doc/document/img34.png +0 -0
  217. data/doc/ep_flux/math-doc/document/img35.png +0 -0
  218. data/doc/ep_flux/math-doc/document/img36.png +0 -0
  219. data/doc/ep_flux/math-doc/document/img37.png +0 -0
  220. data/doc/ep_flux/math-doc/document/img38.png +0 -0
  221. data/doc/ep_flux/math-doc/document/img39.png +0 -0
  222. data/doc/ep_flux/math-doc/document/img4.png +0 -0
  223. data/doc/ep_flux/math-doc/document/img40.png +0 -0
  224. data/doc/ep_flux/math-doc/document/img41.png +0 -0
  225. data/doc/ep_flux/math-doc/document/img42.png +0 -0
  226. data/doc/ep_flux/math-doc/document/img43.png +0 -0
  227. data/doc/ep_flux/math-doc/document/img44.png +0 -0
  228. data/doc/ep_flux/math-doc/document/img45.png +0 -0
  229. data/doc/ep_flux/math-doc/document/img46.png +0 -0
  230. data/doc/ep_flux/math-doc/document/img47.png +0 -0
  231. data/doc/ep_flux/math-doc/document/img48.png +0 -0
  232. data/doc/ep_flux/math-doc/document/img49.png +0 -0
  233. data/doc/ep_flux/math-doc/document/img5.png +0 -0
  234. data/doc/ep_flux/math-doc/document/img50.png +0 -0
  235. data/doc/ep_flux/math-doc/document/img51.png +0 -0
  236. data/doc/ep_flux/math-doc/document/img52.png +0 -0
  237. data/doc/ep_flux/math-doc/document/img53.png +0 -0
  238. data/doc/ep_flux/math-doc/document/img54.png +0 -0
  239. data/doc/ep_flux/math-doc/document/img55.png +0 -0
  240. data/doc/ep_flux/math-doc/document/img56.png +0 -0
  241. data/doc/ep_flux/math-doc/document/img57.png +0 -0
  242. data/doc/ep_flux/math-doc/document/img58.png +0 -0
  243. data/doc/ep_flux/math-doc/document/img59.png +0 -0
  244. data/doc/ep_flux/math-doc/document/img6.png +0 -0
  245. data/doc/ep_flux/math-doc/document/img60.png +0 -0
  246. data/doc/ep_flux/math-doc/document/img61.png +0 -0
  247. data/doc/ep_flux/math-doc/document/img62.png +0 -0
  248. data/doc/ep_flux/math-doc/document/img63.png +0 -0
  249. data/doc/ep_flux/math-doc/document/img64.png +0 -0
  250. data/doc/ep_flux/math-doc/document/img65.png +0 -0
  251. data/doc/ep_flux/math-doc/document/img66.png +0 -0
  252. data/doc/ep_flux/math-doc/document/img67.png +0 -0
  253. data/doc/ep_flux/math-doc/document/img68.png +0 -0
  254. data/doc/ep_flux/math-doc/document/img69.png +0 -0
  255. data/doc/ep_flux/math-doc/document/img7.png +0 -0
  256. data/doc/ep_flux/math-doc/document/img70.png +0 -0
  257. data/doc/ep_flux/math-doc/document/img71.png +0 -0
  258. data/doc/ep_flux/math-doc/document/img72.png +0 -0
  259. data/doc/ep_flux/math-doc/document/img73.png +0 -0
  260. data/doc/ep_flux/math-doc/document/img74.png +0 -0
  261. data/doc/ep_flux/math-doc/document/img75.png +0 -0
  262. data/doc/ep_flux/math-doc/document/img76.png +0 -0
  263. data/doc/ep_flux/math-doc/document/img77.png +0 -0
  264. data/doc/ep_flux/math-doc/document/img78.png +0 -0
  265. data/doc/ep_flux/math-doc/document/img79.png +0 -0
  266. data/doc/ep_flux/math-doc/document/img8.png +0 -0
  267. data/doc/ep_flux/math-doc/document/img80.png +0 -0
  268. data/doc/ep_flux/math-doc/document/img81.png +0 -0
  269. data/doc/ep_flux/math-doc/document/img82.png +0 -0
  270. data/doc/ep_flux/math-doc/document/img83.png +0 -0
  271. data/doc/ep_flux/math-doc/document/img84.png +0 -0
  272. data/doc/ep_flux/math-doc/document/img85.png +0 -0
  273. data/doc/ep_flux/math-doc/document/img86.png +0 -0
  274. data/doc/ep_flux/math-doc/document/img87.png +0 -0
  275. data/doc/ep_flux/math-doc/document/img88.png +0 -0
  276. data/doc/ep_flux/math-doc/document/img89.png +0 -0
  277. data/doc/ep_flux/math-doc/document/img9.png +0 -0
  278. data/doc/ep_flux/math-doc/document/img90.png +0 -0
  279. data/doc/ep_flux/math-doc/document/img91.png +0 -0
  280. data/doc/ep_flux/math-doc/document/img92.png +0 -0
  281. data/doc/ep_flux/math-doc/document/img93.png +0 -0
  282. data/doc/ep_flux/math-doc/document/img94.png +0 -0
  283. data/doc/ep_flux/math-doc/document/img95.png +0 -0
  284. data/doc/ep_flux/math-doc/document/img96.png +0 -0
  285. data/doc/ep_flux/math-doc/document/img97.png +0 -0
  286. data/doc/ep_flux/math-doc/document/img98.png +0 -0
  287. data/doc/ep_flux/math-doc/document/img99.png +0 -0
  288. data/doc/ep_flux/math-doc/document/index.html +101 -0
  289. data/doc/ep_flux/math-doc/document/internals.pl +258 -0
  290. data/doc/ep_flux/math-doc/document/labels.pl +265 -0
  291. data/doc/ep_flux/math-doc/document/next.png +0 -0
  292. data/doc/ep_flux/math-doc/document/next_g.png +0 -0
  293. data/doc/ep_flux/math-doc/document/node1.html +104 -0
  294. data/doc/ep_flux/math-doc/document/node10.html +164 -0
  295. data/doc/ep_flux/math-doc/document/node11.html +86 -0
  296. data/doc/ep_flux/math-doc/document/node12.html +166 -0
  297. data/doc/ep_flux/math-doc/document/node13.html +897 -0
  298. data/doc/ep_flux/math-doc/document/node14.html +1065 -0
  299. data/doc/ep_flux/math-doc/document/node15.html +72 -0
  300. data/doc/ep_flux/math-doc/document/node16.html +81 -0
  301. data/doc/ep_flux/math-doc/document/node2.html +82 -0
  302. data/doc/ep_flux/math-doc/document/node3.html +91 -0
  303. data/doc/ep_flux/math-doc/document/node4.html +149 -0
  304. data/doc/ep_flux/math-doc/document/node5.html +330 -0
  305. data/doc/ep_flux/math-doc/document/node6.html +99 -0
  306. data/doc/ep_flux/math-doc/document/node7.html +98 -0
  307. data/doc/ep_flux/math-doc/document/node8.html +83 -0
  308. data/doc/ep_flux/math-doc/document/node9.html +140 -0
  309. data/doc/ep_flux/math-doc/document/prev.png +0 -0
  310. data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
  311. data/doc/ep_flux/math-doc/document/up.png +0 -0
  312. data/doc/ep_flux/math-doc/document/up_g.png +0 -0
  313. data/doc/gdir.html +412 -0
  314. data/doc/gdir_client.html +16 -0
  315. data/doc/gdir_connect_ftp-like.html +61 -0
  316. data/doc/gdir_server.html +45 -0
  317. data/doc/ggraph.html +1119 -0
  318. data/doc/gpcat.html +45 -0
  319. data/doc/gpcut.html +47 -0
  320. data/doc/gphys.html +624 -0
  321. data/doc/gphys_fft.html +324 -0
  322. data/doc/gphys_grads_io.html +69 -0
  323. data/doc/gphys_grib_io.html +82 -0
  324. data/doc/gphys_io.html +183 -0
  325. data/doc/gphys_io_common.html +18 -0
  326. data/doc/gphys_netcdf_io.html +283 -0
  327. data/doc/gplist.html +24 -0
  328. data/doc/gpmath.html +52 -0
  329. data/doc/gpmaxmin.html +32 -0
  330. data/doc/gpprint.html +35 -0
  331. data/doc/gpview.html +349 -0
  332. data/doc/grads2nc_with_gphys.html +21 -0
  333. data/doc/grads_gridded.html +307 -0
  334. data/doc/grib.html +149 -0
  335. data/doc/grid.html +224 -0
  336. data/doc/index.html +145 -0
  337. data/doc/index.rd +138 -0
  338. data/doc/netcdf_convention.html +136 -0
  339. data/doc/unumeric.html +176 -0
  340. data/doc/update +69 -0
  341. data/doc/update_rdoc +8 -0
  342. data/doc/varray.html +299 -0
  343. data/doc/varraycomposite.html +67 -0
  344. data/ext_init.c +1 -0
  345. data/extconf.rb +16 -6
  346. data/gphys.gemspec +33 -26
  347. data/interpo.c +1 -1
  348. data/lib/numru/dclext.rb +718 -546
  349. data/lib/numru/derivative.rb +2 -0
  350. data/lib/numru/ganalysis.rb +38 -0
  351. data/lib/numru/ganalysis/beta_plane.rb +103 -0
  352. data/lib/numru/ganalysis/eof.rb +3 -2
  353. data/lib/numru/ganalysis/fitting.rb +559 -0
  354. data/lib/numru/ganalysis/histogram.rb +36 -19
  355. data/lib/numru/ganalysis/log_p.rb +130 -0
  356. data/lib/numru/ganalysis/met.rb +396 -2
  357. data/lib/numru/ganalysis/met_z.rb +300 -0
  358. data/lib/numru/ganalysis/planet.rb +17 -7
  359. data/lib/numru/ganalysis/qg.rb +685 -0
  360. data/lib/numru/ganalysis/sigma_coord.rb +90 -0
  361. data/lib/numru/gdir.rb +2 -1
  362. data/lib/numru/ggraph.rb +204 -60
  363. data/lib/numru/ggraph_on_merdional_section.rb +1 -1
  364. data/lib/numru/gphys.rb +6 -0
  365. data/lib/numru/gphys/assoccoords.rb +18 -3
  366. data/lib/numru/gphys/axis.rb +209 -8
  367. data/lib/numru/gphys/derivative.rb +11 -0
  368. data/lib/numru/gphys/gphys.rb +539 -48
  369. data/lib/numru/gphys/gphys_dim_op.rb +331 -0
  370. data/lib/numru/gphys/gphys_fft.rb +48 -2
  371. data/lib/numru/gphys/gphys_io.rb +241 -13
  372. data/lib/numru/gphys/gphys_netcdf_io.rb +77 -39
  373. data/lib/numru/gphys/gphys_nusdas_io.rb +3 -0
  374. data/lib/numru/gphys/grib.rb +133 -54
  375. data/lib/numru/gphys/grib_params.rb +26 -3
  376. data/lib/numru/gphys/grid.rb +75 -34
  377. data/lib/numru/gphys/interpolate.rb +24 -10
  378. data/lib/numru/gphys/mdstorage.rb +160 -0
  379. data/lib/numru/gphys/netcdf_convention.rb +4 -2
  380. data/lib/numru/gphys/subsetmapping.rb +0 -1
  381. data/lib/numru/gphys/unumeric.rb +50 -5
  382. data/lib/numru/gphys/varray.rb +15 -30
  383. data/lib/numru/gphys/varraycomposite.rb +107 -24
  384. data/lib/numru/gphys/varraynetcdf.rb +9 -3
  385. data/lib/numru/gphys/version.rb +5 -0
  386. data/sample/druby_cli1.rb +2 -0
  387. data/sample/druby_cli2.rb +0 -6
  388. data/sample/druby_serv2.rb +0 -13
  389. data/spec/gphys_spec.rb +11 -0
  390. data/spec/spec_helper.rb +2 -0
  391. data/test/test_assoccoords.rb +102 -0
  392. data/test/test_axis.rb +61 -0
  393. data/test/test_fitting.rb +116 -0
  394. data/test/test_gphys.rb +20 -0
  395. data/test/test_met_z.rb +96 -0
  396. data/test/test_sigma_coord.rb +50 -0
  397. data/{test → test_old}/eof_slp.rb +0 -0
  398. data/{test → test_old}/mltbit.dat +0 -0
  399. data/{test → test_old}/test_ep_flux.rb +0 -0
  400. data/{test → test_old}/test_multibitIO.rb +0 -0
  401. metadata +530 -191
  402. data/README.md +0 -29
  403. data/lib/gphys.rb +0 -2
  404. data/lib/numru/dclext_datetime_ax.rb +0 -220
  405. data/lib/version.rb +0 -3
@@ -0,0 +1,90 @@
1
+
2
+ require "numru/ganalysis/planet"
3
+ require "numru/ganalysis/met"
4
+
5
+ module NumRu
6
+ module GAnalysis
7
+
8
+ # Library to handle the sigma coordinate of atmospheric GCMs
9
+ #
10
+ module SigmaCoord
11
+
12
+ module_function
13
+
14
+ # Find the sigma coordinate in a GPhys object (empirically)
15
+ #
16
+ # ARGUMENT
17
+ # * gphys [GPhys]
18
+ # * error [nil/false or true] change the behavior if a
19
+ # pressure coordinate is not found. Default: returns nil;
20
+ # if error is true, an exception is raised.
21
+ # RETURN VALUE
22
+ # * Integer to indicate the dimension of the sigma coordinate,
23
+ # or nil if not found (by default; see above)
24
+ def find_sigma_d(gphys, error=nil)
25
+ un0 = Units.new("1")
26
+ (gphys.rank-1).downto(0) do |d|
27
+ crd = gphys.coord(d)
28
+ if crd.units =~ un0 and
29
+ ( crd.get_att('standard_name')=="atmosphere_sigma_coordinate" or
30
+ /sigma/i =~ crd.long_name or /^sig/i =~ crd.name )
31
+ # then, it's assumed that this is the sigma coordinate
32
+ return(d)
33
+ end
34
+ end
35
+ if error
36
+ raise("Could not find a pressure coordinate.")
37
+ else
38
+ nil
39
+ end
40
+ end
41
+
42
+ # Derive pressure from sigma and surface pressure
43
+ #
44
+ # ARGUMENTS
45
+ # * ps [GPhys or VArray or NArray] : surface pressure (multi-D)
46
+ # * sig [GPhys or VArray or NArray] : sigma (1D)
47
+ # * zdim [Integer] : dimension at which the vertical dim is incorpolated
48
+ # RETURN VALUE
49
+ # * pressure [GPhys or VArray or NArray depending the class of ps]
50
+ def sig_ps2p(ps, sig, zdim)
51
+ if sig.is_a?(VArray) or sig.is_a?(GPhys)
52
+ sigval = sig.val
53
+ else
54
+ sigval = sig
55
+ end
56
+ if ps.is_a?(VArray) or ps.is_a?(GPhys)
57
+ psval = ps.val
58
+ else
59
+ psval = ps
60
+ end
61
+ psval = psval.newdim(zdim)
62
+ zdim.times{sigval = sigval.newdim(0)}
63
+ (ps.rank-zdim).times{sigval = sigval.newdim(-1)}
64
+ pval = psval * sigval
65
+ case ps
66
+ when VArray, GPhys
67
+ p = VArray.new(pval,
68
+ {"long_name"=>"pressure","units"=>ps.units.to_s}, "p")
69
+ if ps.is_a?(GPhys)
70
+ case sig
71
+ when GPhys
72
+ sigax = sig.axis(0)
73
+ when VArray
74
+ sigax = Axis.new().set_pos(sig)
75
+ else
76
+ sigc = VArray.new(sig,{"units"=>"","long_name"=>"sigma"},"sigma")
77
+ sigax = Axis.new().set_pos(sigc)
78
+ end
79
+ grid = ps.grid.insert_axis(zdim,sigax)
80
+ p = GPhys.new(grid, p)
81
+ end
82
+ p
83
+ else
84
+ pval
85
+ end
86
+ end
87
+
88
+ end
89
+ end
90
+ end
@@ -946,7 +946,8 @@ module NumRu
946
946
 
947
947
  def __can_be_a_gdir(path)
948
948
  ftype = __ftype(path)
949
- if ftype=="directory" || ftype=="file" && GPhys::IO::file2type(path)
949
+ if ftype=="directory" || ftype=="file" &&
950
+ ( GPhys::IO::file2type(path) rescue false )
950
951
  true
951
952
  else
952
953
  false
@@ -1,4 +1,4 @@
1
- # -*- coding: cp932 -*-
1
+ # -*- coding: utf-8 -*-
2
2
  require "numru/gphys"
3
3
  require "numru/misc"
4
4
  require "date"
@@ -49,8 +49,16 @@ require "numru/dclext"
49
49
  * ((<line>))
50
50
  Plot a poly-line by selecting the first dimension (with GPhys#first1D)
51
51
  if (({gphys})) is more than 2D.
52
+ * ((<set_line>))
53
+ Change the default option values for ((<line>)).
54
+ * ((<next_line>))
55
+ Set the option values effective only in the next call of ((<line>))
52
56
  * ((<mark>))
53
57
  Similar to ((<line>)) but plots marks instead of drawing a poly-line.
58
+ * ((<set_mark>))
59
+ Change the default option values for ((<mark>)).
60
+ * ((<next_mark>))
61
+ Set the option values effective only in the next call of ((<mark>))
54
62
  * ((<scatter>))
55
63
  Scatter diagram (using uumrkz, as in ((<mark>))).
56
64
  * ((<color_scatter>))
@@ -1072,8 +1080,10 @@ module NumRu
1072
1080
 
1073
1081
  module GGraph
1074
1082
 
1075
- TONE_TONF_THRES = 10000 # thresfold to swith uetonf and uetone under
1076
- # the auto=true option in the tone method
1083
+ # thresfold to swith uetonf and uetone under
1084
+ # the auto=true option in the tone method
1085
+ TONE_TONF_THRES_LEN = 100 # thresfold of length of each dimension
1086
+ TONE_TONF_THRES_SIZE = 20000 # thresfold of total size
1077
1087
 
1078
1088
  @@nannot = 0
1079
1089
 
@@ -1096,9 +1106,7 @@ module NumRu
1096
1106
  module_function
1097
1107
 
1098
1108
  def gropn_1_if_not_yet
1099
- begin
1100
- DCL.stqwrc
1101
- rescue
1109
+ if DCL.sgpget("iws") == 0
1102
1110
  DCL.gropn(1)
1103
1111
  end
1104
1112
  end
@@ -1190,7 +1198,8 @@ module NumRu
1190
1198
  ['map_radius', nil, '(for itr>=20: conical/azimuhal map projections) raidus around the tangential point. (units: degrees)'],
1191
1199
  ['map_fit',nil,'(Only for itr=10(cylindrical) and 11 (Mercator)) true: fit the plot to the data window (overrides map_window and map_axis); false: do not fit (then map_window and map_axis are used); nil: true if itr==10, false if itr==11'],
1192
1200
  ['map_rsat',nil,'(Only for itr=30) satellite distance from the earth\'s center (Parameter "RSAT" for sgpack)'],
1193
- ['map_window', [-180,180,-75,75], '(for itr<20: cylindrical map projections) lon-lat window [lon_min, lon_max, lat_min, lat_max ] to draw the map (units: degres)']
1201
+ ['map_window', [-180,180,-75,75], '(for itr<20: cylindrical map projections) lon-lat window [lon_min, lon_max, lat_min, lat_max ] to draw the map (units: degrees)'],
1202
+ ['keep_axis_offset', false, 'keep offset of titles/labels from each axis (ROFFzs in UZPACK, effective only when new_frame is false)']
1194
1203
  )
1195
1204
 
1196
1205
  def set_fig(options)
@@ -1213,12 +1222,7 @@ module NumRu
1213
1222
  else
1214
1223
  itr = DCL.sgqtrn
1215
1224
  end
1216
- case itr
1217
- when 1..9,51..99
1218
- false
1219
- else
1220
- true
1221
- end
1225
+ !((1..9).include?(itr) || (51..99).include?(itr))
1222
1226
  end
1223
1227
 
1224
1228
  def itr_is?( itr, fig_yet_to_be_called=false )
@@ -1235,13 +1239,7 @@ module NumRu
1235
1239
  end
1236
1240
 
1237
1241
  def sim_trn?
1238
- itr = DCL.sgqtrn
1239
- case itr
1240
- when 5..7
1241
- true
1242
- else
1243
- false
1244
- end
1242
+ (5..7).include?(DCL.sgqtrn)
1245
1243
  end
1246
1244
 
1247
1245
  def fig(xax=nil, yax=nil, options=nil)
@@ -1259,6 +1257,9 @@ module NumRu
1259
1257
  elsif opts['new_frame']
1260
1258
  DCL.grfrm
1261
1259
  else
1260
+ if opts['keep_axis_offset'] # SAVE OFFSET VALUES
1261
+ offset_org = (%w(XT XB YL YR)).map{|zs| DCL::uzpget("ROFF#{zs}")}
1262
+ end
1262
1263
  DCL.grfig
1263
1264
  end
1264
1265
  raise "viewport's length must be 4" if opts['viewport'].length != 4
@@ -1484,6 +1485,9 @@ module NumRu
1484
1485
 
1485
1486
  DCL.grstrf
1486
1487
  DCL.umpset('lglobe', sv)
1488
+ if (!opts['new_frame']) && opts['keep_axis_offset'] # RESTORE OFFSET VALUES
1489
+ (%w(XT XB YL YR)).each_with_index{|zs, izs| DCL::uzpset("ROFF#{zs}", offset_org[izs])}
1490
+ end
1487
1491
  nil
1488
1492
  end
1489
1493
 
@@ -1561,45 +1565,49 @@ module NumRu
1561
1565
  t0 = window[2]
1562
1566
  t1 = window[3]
1563
1567
  end
1564
- time = UNumeric.new(t0,sunits)
1568
+ ts = [t0,t1].min
1569
+ time = UNumeric.new(ts,sunits)
1565
1570
  tstr = time.to_datetime(0.1,calendar)
1566
1571
  jd0 = tstr.strftime('%Y%m%d').to_i
1567
- tlen = tun.convert( t1-t0, dayun )
1568
- if !axtype
1569
- if tlen < 5
1570
- axtype = 'h'
1571
- else
1572
- axtype = 'ymd'
1573
- end
1574
- end
1572
+ tlen = tun.convert( t1-t0, dayun ).abs
1573
+ axtype ||= (tlen < 5) ? 'h' : 'ymd'
1574
+ reverse = t1 < t0
1575
1575
 
1576
1576
  if xax
1577
- DCL.grswnd(0.0, tlen, window[2], window[3] )
1577
+ unless(reverse)
1578
+ DCL.grswnd(0.0, tlen, window[2], window[3] )
1579
+ else
1580
+ DCL.grswnd(tlen, 0.0, window[2], window[3] )
1581
+ end
1578
1582
  DCL.grstrf
1583
+ opts = {'cside'=>side}
1584
+ opts['dtick1'] = tickint if tickint
1585
+ opts['dtick2'] = labelint if labelint
1579
1586
  if axtype == 'h'
1580
- opts = {'cside'=>side}
1581
- opts['dtick1'] = tickint if tickint
1582
- opts['dtick2'] = labelint if labelint
1583
1587
  DCLExt.datetime_ax(tstr, tstr+tlen, opts )
1584
1588
  else
1585
- DCL.ucxacl(side,jd0,tlen)
1589
+ DCLExt.date_ax(tstr, tstr+tlen, opts )
1590
+ ## DCL.ucxacl(side,jd0,tlen) #Old: use it again if UCPACK is improved
1586
1591
  end
1587
- DCL.grswnd(*window)
1588
- DCL.grstrf
1589
1592
  else
1590
- DCL.grswnd(window[0], window[1], 0.0, tlen)
1593
+ unless(reverse)
1594
+ DCL.grswnd(window[0], window[1], 0.0, tlen)
1595
+ else
1596
+ DCL.grswnd(window[0], window[1], tlen, 0.0)
1597
+ end
1591
1598
  DCL.grstrf
1599
+ opts = {'yax'=>true, 'cside'=>side}
1600
+ opts['dtick1'] = tickint if tickint
1601
+ opts['dtick2'] = labelint if labelint
1592
1602
  if axtype == 'h'
1593
- opts = {'yax'=>true, 'cside'=>side}
1594
- opts['dtick1'] = tickint if tickint
1595
- opts['dtick2'] = labelint if labelint
1596
1603
  DCLExt.datetime_ax(tstr, tstr+tlen, opts )
1597
1604
  else
1598
- DCL.ucyacl(side,jd0,tlen)
1605
+ DCLExt.date_ax(tstr, tstr+tlen, opts )
1606
+ ## DCL.ucyacl(side,jd0,tlen) #Old: use it again if UCPACK is improved
1599
1607
  end
1600
- DCL.grswnd(*window)
1601
- DCL.grstrf
1602
1608
  end
1609
+ DCL.grswnd(*window)
1610
+ DCL.grstrf
1603
1611
  end
1604
1612
  private :__calendar_ax
1605
1613
 
@@ -1891,10 +1899,10 @@ module NumRu
1891
1899
  yd = gps[0].coord(1)
1892
1900
  end
1893
1901
  # <-- ///
1894
- gps.collect!{|gp| gp.cyclic_ext(0, 360.0)} #cyclic extentn along lon
1902
+ gps.collect!{|gp| gp.cyclic_ext(0)} #cyclic extentn along lon
1895
1903
  xd = gps[0].coord(0)
1896
1904
  elsif itr_is?(5, newframe)
1897
- gps.collect!{|gp| gp.cyclic_ext(1, 360.0)} #cyclic ext along azimuth
1905
+ gps.collect!{|gp| gp.cyclic_ext_with_modulo(1, 360.0)} #cyclic ext along azimuth
1898
1906
  yd = gps[0].coord(1)
1899
1907
  end
1900
1908
  [xd, yd, closer, *gps]
@@ -2012,14 +2020,47 @@ module NumRu
2012
2020
  ['legend_vy', nil, '(effective if legend) viewport y value of the legend (Float; or nil for automatic settting)'],
2013
2021
  ['legend_size', nil, '(effective if legend) character size of the legend'],
2014
2022
  ['map_axes', false, '[USE IT ONLY WHEN itr=10 (cylindrical)] If true, draws axes by temprarilly switching to itr=1 and calling GGraph::axes.'],
2023
+ ['step_plot', false, 'If true, draw stair step plot (piecewise constant line plot).'],
2024
+ # ['step_extend_ends', false, 'If true, extend both ends of stair step plot.'], # NOT YET IMPLEMENTED
2025
+ ['step_position', 0, 'Data point will be at the right corner of each step if negative, center if 0, and left corner if positive.'],
2015
2026
  @@data_prep_options
2016
2027
  )
2017
2028
 
2029
+ def set_line(options)
2030
+ @@line_options.set(options)
2031
+ end
2032
+
2033
+ @@next_line = nil
2034
+ def next_line(options)
2035
+ if options.is_a?(Hash)
2036
+ @@next_line = options
2037
+ else
2038
+ raise TypeError,"Hash expected"
2039
+ end
2040
+ nil
2041
+ end
2042
+
2043
+ def set_step_plot_position(val, postype)
2044
+ if postype == 0
2045
+ val = NArray.to_na([val[0]] + (val[0..-2] + val[1..-1]).mul!(0.5).to_a + [val[-1]])
2046
+ elsif postype > 0
2047
+ val = NArray.to_na([val[0]] + val.to_a)
2048
+ else
2049
+ val = NArray.to_na(val.to_a + [val[-1]])
2050
+ end
2051
+ return val
2052
+ end
2053
+ private :set_step_plot_position
2054
+
2018
2055
  def line(gphys, newframe=true, options=nil)
2019
2056
  gropn_1_if_not_yet
2020
2057
  if newframe!=true && newframe!=false
2021
2058
  raise ArgumentError, "2nd arg (newframe) must be true or false"
2022
2059
  end
2060
+ if @@next_line
2061
+ options = ( options ? @@next_line.update(options) : @@next_line )
2062
+ @@next_line = nil
2063
+ end
2023
2064
  opts = @@line_options.interpret(options)
2024
2065
  x, y, closer, gp, window = data_prep_1D(gphys, opts)
2025
2066
  if newframe
@@ -2032,7 +2073,17 @@ module NumRu
2032
2073
  DCL.sgpset('lchar',true)
2033
2074
  DCL.sgsplc(opts['label'])
2034
2075
  end
2035
- DCL.uulinz(x.val, y.val, opts['type'], opts['index'])
2076
+ if opts['step_plot']
2077
+ if opts['exchange']
2078
+ yval = set_step_plot_position(y.val, opts['step_position'])
2079
+ DCL.uhbxlz(x.val, yval, opts['type'], opts['index'])
2080
+ else
2081
+ xval = set_step_plot_position(x.val, opts['step_position'])
2082
+ DCL.uvbxlz(xval, y.val, opts['type'], opts['index'])
2083
+ end
2084
+ else
2085
+ DCL.uulinz(x.val, y.val, opts['type'], opts['index'])
2086
+ end
2036
2087
  DCL.sgpset('lchar',lcharbk) if opts['label']
2037
2088
 
2038
2089
  legend = opts['legend']
@@ -2087,6 +2138,7 @@ module NumRu
2087
2138
  opts['legend_size'],opts['legend_vx'],opts['legend_dx'],
2088
2139
  opts['legend_vy'],newframe)
2089
2140
  end
2141
+ closer.call if closer
2090
2142
  nil
2091
2143
  end
2092
2144
  #-----------------------------------------------------------------------------
@@ -2107,11 +2159,29 @@ module NumRu
2107
2159
  @@data_prep_options
2108
2160
  )
2109
2161
 
2162
+ def set_mark(options)
2163
+ @@mark_options.set(options)
2164
+ end
2165
+
2166
+ @@next_mark = nil
2167
+ def next_mark(options)
2168
+ if options.is_a?(Hash)
2169
+ @@next_mark = options
2170
+ else
2171
+ raise TypeError,"Hash expected"
2172
+ end
2173
+ nil
2174
+ end
2175
+
2110
2176
  def mark(gphys, newframe=true, options=nil)
2111
2177
  gropn_1_if_not_yet
2112
2178
  if newframe!=true && newframe!=false
2113
2179
  raise ArgumentError, "2nd arg (newframe) must be true or false"
2114
2180
  end
2181
+ if @@next_mark
2182
+ options = ( options ? @@next_mark.update(options) : @@next_mark )
2183
+ @@next_mark = nil
2184
+ end
2115
2185
  opts = @@mark_options.interpret(options)
2116
2186
  x, y, closer, gp, window = data_prep_1D(gphys, opts)
2117
2187
  if newframe
@@ -2441,9 +2511,9 @@ module NumRu
2441
2511
  end
2442
2512
  trn = DCL.sgqtrn
2443
2513
  if map_fit
2444
- fig(xax,yax, {'itr'=>1, 'new_frame'=>false, 'viewport'=>vpt})
2514
+ fig(xax,yax, {'itr'=>1, 'new_frame'=>false, 'viewport'=>vpt, 'keep_axis_offset'=>true})
2445
2515
  axes(xax, yax, 'title'=>ttl)
2446
- fig(xax,yax,{'itr'=>trn, 'new_frame'=>false, 'viewport'=>vpt, 'map_fit'=>true})
2516
+ fig(xax,yax,{'itr'=>trn, 'new_frame'=>false, 'viewport'=>vpt, 'map_fit'=>true, 'keep_axis_offset'=>true})
2447
2517
  else
2448
2518
  xax_map = xax[0..1].copy
2449
2519
  xax_map[0] = cnt[0] + wnd[0]
@@ -2451,9 +2521,9 @@ module NumRu
2451
2521
  yax_map = yax[0..1].copy
2452
2522
  yax_map[0] = wnd[2]
2453
2523
  yax_map[1] = wnd[3]
2454
- fig(xax_map,yax_map,{'itr'=>1, 'new_frame'=>false, 'viewport'=>vpt})
2524
+ fig(xax_map,yax_map,{'itr'=>1, 'new_frame'=>false, 'viewport'=>vpt, 'keep_axis_offset'=>true})
2455
2525
  axes(xax_map, yax_map, 'title'=>ttl)
2456
- fig(xax_map,yax_map,{'itr'=>trn, 'new_frame'=>false, 'viewport'=>vpt, 'map_fit'=>false, 'map_axis'=>cnt, 'map_window'=>wnd})
2526
+ fig(xax_map,yax_map,{'itr'=>trn, 'new_frame'=>false, 'viewport'=>vpt, 'map_fit'=>false, 'map_axis'=>cnt, 'map_window'=>wnd, 'keep_axis_offset'=>true})
2457
2527
  end
2458
2528
  else
2459
2529
  title( ttl )
@@ -2598,8 +2668,8 @@ module NumRu
2598
2668
  @@tone_options = Misc::KeywordOptAutoHelp.new(
2599
2669
  ['title', nil, 'Title of the figure(if nil, internally determined)'],
2600
2670
  ['annotate', true, 'if false, do not put texts on the right margin even when newframe==true'],
2601
- ['ltone', true, 'Same as udpack parameter ltone'],
2602
- ['auto', false, 'Swith DCL.uetone and DCL.uetonf depending on the data size'],
2671
+ ['ltone', true, 'Same as uepack parameter ltone'],
2672
+ ['auto', true, 'Swith DCL.uetone and DCL.uetonf depending on the data size'],
2603
2673
  ['tonf', false, 'Use DCL.uetonf instead of DCL.uetone'],
2604
2674
  ['tonb', false, 'Use DCL.uetonb instead of DCL.uetone'],
2605
2675
  ['tonc', false, 'Use DCL.uetonc instead of DCL.uetone'],
@@ -2668,7 +2738,8 @@ module NumRu
2668
2738
 
2669
2739
  val = gp.data.val
2670
2740
  if ( opts['ltone'] &&
2671
- ( opts['tonf'] || opts['auto'] && val.length > TONE_TONF_THRES ) )
2741
+ ( opts['tonf'] || opts['auto'] &&
2742
+ ( val.length >= TONE_TONF_THRES_SIZE || val.shape.min >= TONE_TONF_THRES_LEN ) ) )
2672
2743
  DCL.uetonf(val)
2673
2744
  elsif opts['tonb'] && opts['ltone']
2674
2745
  DCL.uetonb(val)
@@ -2948,8 +3019,20 @@ module NumRu
2948
3019
  @@vxfxratio=nil # for flow_vect
2949
3020
  @@vyfyratio=nil # for flow_vect
2950
3021
  @@vfratio=nil # for flow_vect_anyproj
3022
+ @@flenmax=nil # for flow_vect_anyproj
3023
+ %w!vxfxratio vyfyratio vfratio flenmax!.each do |param|
3024
+ eval <<-EOS
3025
+ def #{param}
3026
+ @@#{param}
3027
+ end
3028
+ def #{param}=(x)
3029
+ @@#{param} = x
3030
+ end
3031
+ EOS
3032
+ end
2951
3033
 
2952
3034
  @@vector_options = Misc::KeywordOptAutoHelp.new(
3035
+ ['index', nil, 'Line index of vectors.'],
2953
3036
  ['title', nil, 'Title of the figure(if nil, internally determined)'],
2954
3037
  ['annotate', true, 'if false, do not put texts on the right margin even when newframe==true'],
2955
3038
  ['map_axes', false, '[USE IT ONLY WHEN itr=10 (cylindrical)] If true, draws axes by temprarilly switching to itr=1 and calling GGraph::axes.'],
@@ -2986,27 +3069,34 @@ module NumRu
2986
3069
  yaxv = yax.val
2987
3070
  DCL.uwsgxa(xaxv)
2988
3071
  DCL.uwsgya(yaxv)
3072
+
3073
+ oldindex = DCLExt.ug_set_params("index" => opts['index']) if opts['index']
3074
+
2989
3075
  if opts['flow_itr5']
2990
3076
  if itr_is?(5)
2991
3077
  DCLExt.flow_itr5( fx, fy, opts['factor'], opts['unit_vect'] )
3078
+ returnval = nil
2992
3079
  else
2993
3080
  raise "flow_itr5 option should use with itr=5."
2994
3081
  end
2995
3082
  elsif opts['flow_vect_anyproj'] ||
2996
3083
  ( opts['flow_vect_anyproj'].nil? && opts['flow_vect'] && itr >=2 )
2997
- @@vfratio, flenmax =
3084
+ @@vfratio, @@flenmax =
2998
3085
  DCLExt.flow_vect_anyproj(fx.val, fy.val, xaxv, yaxv,
2999
3086
  opts['factor'], 1, 1, opts['distvect_map'],
3000
3087
  (opts['keep'] && @@vfratio),
3088
+ (opts['keep'] && @@flenmax),
3001
3089
  opts['polar_thinning'] )
3090
+ returnval = { "vfratio"=> @@vfratio, "flenmax"=>@@flenmax }
3002
3091
  if opts['unit_vect']
3003
- len_unit = opts['len_unit'] || flenmax
3092
+ len_unit = opts['len_unit'] || @@flenmax
3004
3093
  DCLExt.unit_vect_single(@@vfratio, len_unit)
3005
3094
  end
3006
3095
  elsif opts['flow_vect']
3007
3096
  uninfo = DCLExt.flow_vect(fx.val, fy.val, opts['factor'], 1, 1,
3008
3097
  (opts['keep']&& @@vxfxratio), (opts['keep'] && @@vyfyratio) )
3009
3098
  @@vxfxratio, @@vyfyratio, = uninfo
3099
+ returnval = { "vxfxratio"=>@@vxfxratio, "vyfyratio"=>@@vyfyratio }
3010
3100
  if opts['unit_vect']
3011
3101
  unless opts['max_unit_vect']
3012
3102
  uninfo[2] = opts['ux_unit'] # nil or a Numeric to specify the len
@@ -3017,10 +3107,12 @@ module NumRu
3017
3107
  else
3018
3108
  before=DCLExt.ug_set_params({'lunit'=>true}) if opts['unit_vect']
3019
3109
  DCL.ugvect(fx.val, fy.val)
3110
+ returnval = nil
3020
3111
  DCLExt.ug_set_params(before) if opts['unit_vect']
3021
3112
  end
3113
+ DCLExt.ug_set_params(oldindex) if opts['index']
3022
3114
  closer.call if closer
3023
- nil
3115
+ returnval
3024
3116
  end
3025
3117
 
3026
3118
  @@regression_line_options = Misc::KeywordOptAutoHelp.new(
@@ -3625,8 +3717,8 @@ if $0 == __FILE__
3625
3717
  y = v.cut("lat"=>40,"level"=>200)
3626
3718
  xv = x.val
3627
3719
  yv = y.val
3628
- xx = x.val.to_na # NArrayMiss 1.2.1����ɍX�V��ɏ����� xx �� x �ɕς���ׂ�
3629
- yy = y.val.to_na # NArrayMiss 1.2.1����ɍX�V��ɏ����� yy �� y �ɕς���ׂ�
3720
+ xx = x.val.to_na # NArrayMiss 1.2.1より上に更新後に消して xx x に変えるべし
3721
+ yy = y.val.to_na # NArrayMiss 1.2.1より上に更新後に消して yy y に変えるべし
3630
3722
 
3631
3723
  GGraph.next_fig("window"=>[xv.min.floor-5, xv.max.ceil+5,
3632
3724
  yv.min.floor-3, yv.max.ceil+3])
@@ -3647,8 +3739,8 @@ if $0 == __FILE__
3647
3739
  #/ graph 52 /
3648
3740
  x = x.abs**2
3649
3741
  y = y.abs**2 + x*0.1
3650
- xx = x.val.to_na # NArrayMiss 1.2.1����ɍX�V��ɏ����� xx �� x �ɕς���ׂ�
3651
- yy = y.val.to_na # NArrayMiss 1.2.1����ɍX�V��ɏ����� yy �� y �ɕς���ׂ�
3742
+ xx = x.val.to_na # NArrayMiss 1.2.1より上に更新後に消して xx x に変えるべし
3743
+ yy = y.val.to_na # NArrayMiss 1.2.1より上に更新後に消して yy y に変えるべし
3652
3744
 
3653
3745
  GGraph.next_fig("itr"=>4)
3654
3746
  GGraph.scatter(x,y, true, "title"=>"x given y; log scaling")
@@ -3732,6 +3824,58 @@ if $0 == __FILE__
3732
3824
  GGraph.next_axes('xtitle'=>'')
3733
3825
  GGraph.tone_and_contour(gphys, true, 'map_axes'=>true, 'color_bar'=>true)
3734
3826
 
3827
+ #/ stair step line plots /
3828
+ na = NMath.sin(NArray.sfloat(11).indgen! * 2 * Math::PI / 10)
3829
+ va = VArray.new(na, {}, "dummy")
3830
+ p gphys = GPhys.new(Grid.new(Axis.new.set_pos(VArray.new(NArray.sfloat(11).indgen!, {}, "x"))), va)
3831
+ GGraph.set_fig('itr'=>1, 'viewport' => [0.2, 0.8, 0.15, 0.6])
3832
+
3833
+ GGraph.line(gphys, true, 'index' => 21,'step_plot' => true, 'step_position' => -1)
3834
+ GGraph.mark(gphys, false, 'index' => 31, 'type' => 9)
3835
+
3836
+ GGraph.line(gphys, true, 'index' => 21, 'step_plot' => true, 'step_position' => 0)
3837
+ GGraph.mark(gphys, false, 'index' => 31, 'type' => 9)
3838
+
3839
+ GGraph.line(gphys, true, 'index' => 21, 'step_plot' => true, 'step_position' => 1)
3840
+ GGraph.mark(gphys, false, 'index' => 31, 'type' => 9)
3841
+
3842
+ GGraph.line(gphys, true, 'index' => 21, 'step_plot' => true, 'step_position' => 0, 'exchange' => true)
3843
+ GGraph.mark(gphys, false, 'index' => 31, 'type' => 9, 'exchange' => true)
3844
+
3845
+ tmpu = u.cut("lon" => 0..180, "lat" => 20..90, "level" => 200)
3846
+ tmpv = v.cut("lon" => 0..180, "lat" => 20..90, "level" => 200)
3847
+ #/ test for ugvect with 'keep' option /
3848
+ GGraph.set_fig('itr' => 1, 'viewport' => [0.2, 0.7, 0.3, 0.6])
3849
+ GGraph.vector(tmpu, tmpv, true, 'unit_vect' => true, 'index' => 23)
3850
+ DCL::uxsttl("B", "Red: original speed", 0)
3851
+ GGraph.vector(tmpu * 0.5, tmpv * 0.5, true, 'unit_vect' => true, 'index' => 33, 'keep' => true)
3852
+ DCL::uxsttl("B", "Green: half speed with 'keep=T'", 0)
3853
+
3854
+ #/ test for flow_vect with 'keep' option /
3855
+ GGraph.set_fig('itr' => 1, 'viewport' => [0.2, 0.7, 0.3, 0.6])
3856
+ GGraph.vector(tmpu, tmpv, true, 'unit_vect' => true, 'flow_vect' => true, 'index' => 23)
3857
+ DCL::uxsttl("B", "Red: original speed (flow_vect)", 0)
3858
+ GGraph.vector(tmpu * 0.5, tmpv * 0.5, true, 'unit_vect' => true, 'flow_vect' => true, 'index' => 33, 'keep' => true)
3859
+ DCL::uxsttl("B", "Green: half speed with 'keep=T'", 0)
3860
+
3861
+ #/ test for flow_vect_anyproj with 'keep' option /
3862
+ GGraph.set_fig('itr' => 10, 'viewport' => [0.2, 0.7, 0.1, 0.6])
3863
+ GGraph.vector(tmpu, tmpv, true, 'unit_vect' => true, 'index' => 23)
3864
+ DCL::uxsttl("B", "Red: original speed", 0)
3865
+ GGraph.vector(tmpu * 0.5, tmpv * 0.5, true, 'unit_vect' => true, 'index' => 33, 'keep' => true)
3866
+ DCL::uxsttl("B", "Green: half speed with 'keep=T'", 0)
3867
+
3868
+ GGraph.set_fig('itr' => 30, 'viewport' => [0.2, 0.7, 0.1, 0.6])
3869
+ GGraph.vector(u.cut("lat" => 20..90, "level" => 200),
3870
+ v.cut("lat" => 20..90, "level" => 200), true,
3871
+ 'unit_vect' => true, 'index' => 23)
3872
+ DCL::uxsttl("B", "Red: original speed", 0)
3873
+ GGraph.vector(u.cut("lat" => 20..90, "level" => 200) * 0.5,
3874
+ v.cut("lat" => 20..90, "level" => 200) * 0.5, true,
3875
+ 'unit_vect' => true, 'index' => 33, 'keep' => true)
3876
+ DCL::uxsttl("B", "Green: half speed with 'keep=T'", 0)
3877
+
3878
+
3735
3879
  ############
3736
3880
  DCL.grcls
3737
3881