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/bin/gpview ADDED
@@ -0,0 +1,704 @@
1
+ #!/usr/bin/env ruby
2
+ ##################################################
3
+ =begin
4
+ = NAME
5
+
6
+ gpview - quick viewer for the values of a variable specified by a gtool4-type URL.
7
+
8
+
9
+ (1) for 1-dimensional variable, make line plot.
10
+ (2) for 2-dimensional variable, make contour/tone plot.
11
+ (3) for 3/more-dimensional variable, make contour/tone plot,
12
+ select first 2D. possible to make animation.
13
+
14
+ = USAGE
15
+
16
+ The first command form is
17
+
18
+ % gpview [options] gturl1 gturl2 gturl3 ...
19
+
20
+ where the format of the gturl is
21
+
22
+ path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
23
+
24
+ The second commnad form is
25
+
26
+ % gpview --var url [options] gtfile1 gtfile2 ...
27
+
28
+ where the format of the url is
29
+
30
+ varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
31
+
32
+ = OPTIONS
33
+
34
+ if you want to know more description, please read
35
+
36
+ http://ruby.gfd-dennou.org/products/gphys/doc/gpview.html
37
+
38
+ == GLOBAL OPTIONS
39
+
40
+ :--help:
41
+ print this message.
42
+
43
+ :--var url:
44
+ set the variable name and slicing parameters.
45
+
46
+ :--wsn [1-4]:
47
+ set work staion number. each number represent output device:
48
+ 1 : X window.
49
+ 2 : PS file. (named dcl.ps)
50
+ 3 : Tcl/Tk file.
51
+ 4 : GTK Windows (depend on dcl-5.3)
52
+
53
+ :--clrmap [1-]:
54
+ set colormap to draw tone/contour.
55
+
56
+ :--itr [1-4,5-7,10-15,20-23,30-33]:
57
+ set axis scale. default is 1.
58
+ 1 : linear scale for x/y axis
59
+ 2 : linear scale for x , log scale for y axis
60
+ 3 : log scale for x , linear scale for y axis
61
+ 4 : log scale for x/y axis
62
+
63
+ :--similar [simfac,vxoff,vyoff]:
64
+ (for 5<=itr<=7) set similarity parameters which are fed in DCL.grssim.
65
+
66
+ :--map_axis [uxc,uyc,rot]:
67
+ (for 10<=itr<=33) set mapping parameters which are fed in DCL.umpcnt.
68
+
69
+ :--title:
70
+ set title of figure
71
+
72
+ :--aspect <aspect>:
73
+ set aspect ratio of Viewport. default is 2.0.
74
+
75
+ :--noannotate:
76
+ not draw annotations.
77
+
78
+ :--animate/anim <dim>:
79
+ plot animation along <dim>. <dim> must be name of dimension.
80
+
81
+
82
+ :--alternate, --Ga:
83
+ enable to backing store.
84
+
85
+ :--nowait, --Gw:
86
+ not wait for any actions if animate
87
+
88
+ :--reverse, --Gr:
89
+ plot animation reversible if animate
90
+
91
+ :--smooth, --Gaw:
92
+ equal to --anlternate && --nowait
93
+
94
+ :--exch:
95
+ exchange(transpose) x/y axis.
96
+
97
+ :--mean <dim>:
98
+ mean along axis <dim>.
99
+
100
+ :--m, --map <map_type>:
101
+ plot map. itr number must be set. this option is neglect if itr
102
+ number is 1-4. abailable map type is coast_world, border_world,
103
+ plate_world, state_usa, coast_japan, pref_japan
104
+
105
+ :--operation <math_func>:
106
+ operation of the specified math function on the data.
107
+ <math_func> should be a math function with one argument
108
+ such as log10, sqrt, sin, etc.
109
+
110
+
111
+ == LINE/MARK OPTIONS
112
+
113
+ :--line:
114
+ make line plot forced. (about first 1D)
115
+
116
+ :--mark:
117
+ make mark plot forced. (about first 1D)
118
+
119
+ :--index:
120
+ set DCL line index, which set the color/thickness of the line
121
+ primitive. please see DCL documents.
122
+
123
+ :--type:
124
+ set line type.
125
+
126
+ :--range [min:max]
127
+ set min/max value for line plot. min or max must be set.
128
+
129
+ :--overplot
130
+ set number of lines on each figure
131
+
132
+ == CONTOUR/TONE OPTIONS
133
+
134
+ :--shade:
135
+ make contour and tone plot.
136
+
137
+ :--noshade:
138
+ make contour plot, without tone.
139
+
140
+ :--nocont:
141
+ make tone plot, without contour.
142
+
143
+ :--range [min:max]:
144
+ set min/max value for contour/tone plot. min or max must be set.
145
+
146
+ :--crange:
147
+ set min/max value for contour plot. this is more dominant than --range
148
+
149
+ :--srange:
150
+ set min/max value for tone plot. this is more dominant than --interval/int
151
+
152
+ :--interval,--int [num]:
153
+ set interval value for contour/tone plot. set the number of lines if
154
+ you set negative value.
155
+
156
+ :--cint:
157
+ set interval value for contour plot. this is more dominant
158
+ than --interval/int
159
+
160
+ :--sint:
161
+ set interval value for tone plot. this is more dominant than --interval/int.
162
+
163
+ :--levels:
164
+ set values of contour/tone levels.
165
+
166
+ :--clevels:
167
+ set values of contour levels.
168
+
169
+ :--slevels:
170
+ set tone of contour levels.
171
+
172
+ :--patterns:
173
+ set each patterns for tone plot.
174
+
175
+ :--nocolorbar:
176
+ do not draw color bar
177
+
178
+ :--nozero:
179
+ do not draw zero contour
180
+
181
+ == EXAMPLES
182
+
183
+ For a single GPhys variable,
184
+
185
+ % gpview data.nc@temp
186
+ % gpview data.nc@temp,lon=130:150,lat=0:90:2
187
+ % gpview --nocont data.nc@temp,lon=130:150,lat=0
188
+ % gpview --noshade data.nc@temp,lon=130:150,lat=0
189
+ % gpview --mean lon data.nc@temp,lon=130:150,lat=0
190
+ % gpview --exch data.nc@temp,lon=130:150,lat=0
191
+ % gpview --animate lon data.nc@temp,lon=130:150
192
+ % gpview --animate lon --alternate data.nc@temp
193
+ % gpview --smooth lon data.nc@temp,lon=130:150
194
+ % gpview --levels 0,10,20,30 --pattern 30999,40999,50999,60999,70999 data.nc@temp
195
+ % gpview --overplot=3 --anim t data.nc@temp,lon=0
196
+ % gpview --mark data.nc@temp,lon=0,lat=0
197
+ % gpview --operation log10 data.nc@temp,lon=0
198
+
199
+ For multiple GPhys variables,
200
+ % gpview data1.nc@temp data2.nc@temp
201
+ % gpview data1.nc@temp,lon=130:150 data2.nc@temp,lon=150:170
202
+ % gpview --overplot=3 --anim t data.nc@temp,lon=0 data.nc@temp,lon=10
203
+ % gpview --var temp,lon=130:150 data?.nc
204
+ % gpview --anim t --var temp,lon=130:150 data*.nc
205
+
206
+
207
+ == HISTORY
208
+
209
+ 2004/12/14 D Tsukahara && T Horinouti(parse_gturl)
210
+ 2005/01/08 D Tsukahara (add option --exch and able to invalid value)
211
+ 2005/01/09 D Tsukahara (add option --animate, smooth, alternate, index )
212
+ 2005/01/10 D Tsukahara (transpose axis with attr "positive:down" ,
213
+ abailable loopsense_flag. )
214
+ 2005/01/10 D Tsukahara (implement GGraph::color_bar, and margin_info,
215
+ which file name, date, and toolname. )
216
+ 2005/01/11 D Tsukahara ( 1. write document about OPTIONS.
217
+ 2. add many options. more info please see document. )
218
+ 2005/01/23 S Takehiro (add option --similar, map_axis)
219
+ 2005/02/09 D Tsukahara && M Nakano (add option --reverse, --Gr, --map)
220
+ 2005/02/10 D Tsukahara (change option parser (getopts => getoptlong))
221
+ 2005/02/24 D Tsukahara (apply --range for line plot)
222
+ 2005/06/15 S Takehiro (add option --levels, --clevels, --slevels, --patterns)
223
+ 2005/06/17 S Takehiro (missing_value attribute setting removed)
224
+ 2005/06/22 S Takehiro (debug, clipping control added to GGraph::annotate)
225
+ 2005/06/23 S Takehiro (debug, option --title implemented)
226
+ 2005/07/15 S Takehiro (option --noannotate implemented)
227
+ 2005/08/07 S Takehiro (option --overplot implemented)
228
+ 2005/08/09 S Takehiro && T Horinouchi (add option --help and help function.
229
+ URL information corrected. )
230
+ 2005/08/23 S Takehiro (multiple Gphys variables plotting
231
+ and option --var implemented)
232
+ 2005/08/23 S Takehiro (common methods to gp* command moved to gpcommon.rb)
233
+ 2005/10/30 S Takehiro (option --animate recoverd)
234
+ 2005/10/31 S Takehiro (option --smooth bug fixed)
235
+ 2006/03/07 M Nakano (option --int bug fixed)
236
+ 2007/10/03 S Takehiro (option --nocolorbar implemented)
237
+ 2008/04/03 S Takehiro (option --nozero implemented)
238
+ 2008/12/14 S Takehiro (option --mark implemented)
239
+ 2010/03/10 Y SASAKI (change help block into RD format)
240
+ 2011/01/14 T Tanigawa && S Takehiro (option --operation implemented)
241
+
242
+ =end
243
+ #################################################
244
+ require "getoptlong" # for option_parse
245
+ require "numru/ggraph" # ggraph library
246
+ require "numru/gphys/gpcommon"
247
+
248
+ include NumRu
249
+
250
+ #####################################################
251
+ ## Default param.
252
+
253
+ VIEWPORT = [0.15,0.85,0.2,0.55]
254
+ URLfmt = "path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]"
255
+
256
+ #####################################################
257
+ def GGraph::annotate(str_ary)
258
+ lclip = DCL.sgpget('lclip')
259
+ DCL.sgpset('lclip',nil)
260
+ lnum = 0
261
+ str_ary.each{ |str|lnum += 1 }
262
+ charsize = 0.7 * DCL.uzpget('rsizec1')
263
+ dvx = 0.01
264
+ dvy = charsize*1.5
265
+ raise TypeError,"Array expected" if ! str_ary.is_a?(Array)
266
+ vxmin,vxmax,vymin,vymax = DCL.sgqvpt
267
+ vx = 0.70
268
+ vy = 0.045 + (lnum-1)*dvy
269
+ str_ary.each{|str|
270
+ DCL::sgtxzv(vx,vy,str,charsize,0,-1,1)
271
+ vy -= dvy
272
+ }
273
+ DCL.sgpset('lclip',lclip)
274
+ nil
275
+ end
276
+
277
+ def each_along_dims(gphys, loopdim)
278
+
279
+ raise ArgumentError,"1st argument must be an GPhys." if !gphys.is_a?(GPhys)
280
+ if loopdim.is_a?(String)
281
+ dimname = loopdim
282
+ elsif
283
+ if loopdim < 0
284
+ dimname = gphys.coord(gphys.rank + loopdim).name
285
+ else
286
+ dimname = gphys.coord(loopdim).name
287
+ end
288
+ else
289
+ raise ArgumentError,"loopdims must consist of Integer and/or String"
290
+ end
291
+
292
+ loopdim_na = gphys.coord(dimname).val # get coord ary
293
+ loopdim_na = loopdim_na[-1..0] if $OPT_reverse || $OPT_Gr # reverse
294
+ loopdim_na.each { |x|
295
+ yield( gphys.cut(dimname=>x) )
296
+ }
297
+ end
298
+
299
+
300
+ def draw_setup(gp)
301
+
302
+ # set missing value
303
+ DCLExt.gl_set_params('lmiss'=>true)
304
+
305
+ # fontsize
306
+ DCL.sgpset('lcntl', false)
307
+ # DCL.uzfact(0.7)
308
+ DCL.sgpset('lfull', true) # use full area in the window
309
+ DCL.sgpset('lfprop',true) # use proportional font
310
+ DCL.uscset('cyspos', 'B' ) # move unit y axis
311
+
312
+ # viewport size
313
+ GGraph.set_fig('viewport'=>$VIEWPORT)
314
+ GGraph.set_fig( 'itr'=>($OPT_itr == nil) ? 1 : $OPT_itr.to_i )
315
+ GGraph.set_fig("xrev"=>"units:mb,units:hPa,units:millibar,positive:down",
316
+ "yrev"=>"units:mb,units:hPa,units:millibar,positive:down")
317
+
318
+ # set options
319
+ min_range, max_range = __split_range($OPT_range)
320
+ min_crange, max_crange = __split_range($OPT_crange)
321
+ min_srange, max_srange = __split_range($OPT_srange)
322
+ GGraph.set_linear_contour_options(
323
+ 'int' => ( $OPT_cint || $OPT_interval || $OPT_int ),
324
+ 'min' => ( min_crange || min_range ),
325
+ 'max' => ( max_crange || max_range )
326
+ )
327
+ GGraph.set_linear_tone_options(
328
+ 'int' => ( $OPT_sint || $OPT_interval || $OPT_int ),
329
+ 'min' => ( min_srange || min_range ),
330
+ 'max' => ( max_srange || max_range )
331
+ )
332
+ if ( $OPT_clevels || $OPT_levels )
333
+ $OPT_clevels=($OPT_clevels || $OPT_levels).split(',').map!{|v| v.to_f }
334
+ end
335
+
336
+ if ( $OPT_slevels || $OPT_levels )
337
+ $OPT_slevels=($OPT_slevels||$OPT_levels).split(',').map!{|v| v.to_f }
338
+ p $OPT_slevels
339
+ end
340
+
341
+ if ( $OPT_patterns )
342
+ $OPT_patterns=$OPT_patterns.split(',').map!{|v| v.to_f }
343
+ end
344
+
345
+ # judge draw kind
346
+ gp_rank = gp.rank
347
+ gp_rank = gp_rank - 1 if ( $OPT_animate || $OPT_anim )
348
+ if ($OPT_mark)
349
+ draw_flag = "mark"
350
+ elsif ($OPT_line || gp_rank == 1)
351
+ draw_flag = "line"
352
+ elsif (!$OPT_line && gp_rank >= 2) && !$OPT_noshade && $OPT_nocont
353
+ draw_flag = "nocont"
354
+ elsif (!$OPT_line && gp_rank >= 2) && $OPT_noshade && !$OPT_nocont
355
+ draw_flag = "noshade"
356
+ elsif (!$OPT_line && gp_rank >= 2) && !$OPT_noshade && !$OPT_nocont
357
+ draw_flag = "full"
358
+ end
359
+
360
+ # similar projection
361
+ if ($OPT_similar)
362
+ if /([\d\-.]*),([\d\-.]*),([\d\-.]*)/ =~ $OPT_similar
363
+ similar=[$1.to_f,$2.to_f,$3.to_f]
364
+ elsif /([\d\-.]*),([\d\-.]*)/ =~ $OPT_similar
365
+ similar=[$1.to_f,$2.to_f,0]
366
+ elsif /([\d\-.]*)/ =~ $OPT_similar
367
+ similar=[$1.to_f,0,0]
368
+ end
369
+ GGraph.set_fig('similar'=>similar)
370
+ end
371
+
372
+ # similar projection
373
+ if ($OPT_map_axis)
374
+ if /([\d\-.]*),([\d\-.]*),([\d\-.]*)/ =~ $OPT_map_axis
375
+ map_axis=[$1.to_f,$2.to_f,$3.to_f]
376
+ elsif /([\d\-.]*),([\d\-.]*)/ =~ $OPT_map_axis
377
+ map_axis=[$1.to_f,$2.to_f,0]
378
+ elsif /([\d\-.]*)/ =~ $OPT_similar
379
+ map_axis=[$1.to_f,0,0]
380
+ end
381
+ GGraph.set_fig('map_axis'=>map_axis)
382
+ end
383
+
384
+
385
+ # map
386
+ if ( $OPT_m || $OPT_map)
387
+ map_type = "coast_world" if $OPT_m
388
+ map_type = $OPT_map if $OPT_map
389
+ GGraph::set_map(map_type=>true)
390
+ end
391
+
392
+ return draw_flag
393
+
394
+ end
395
+
396
+ def draw(gp, draw_flag)
397
+
398
+ # draw hontai
399
+ case draw_flag
400
+ when "line"
401
+ if ( $Overplot == 1 )
402
+ GGraph.line(gp,
403
+ true,
404
+ "title"=>$OPT_title,
405
+ "index"=>($OPT_index||1),
406
+ "type" =>($OPT_type ||1),
407
+ "exchange"=>$OPT_exch,
408
+ "annotate"=>$annotate,
409
+ "min" => __split_range($OPT_range)[0],
410
+ "max" => __split_range($OPT_range)[1]
411
+ )
412
+ else
413
+ GGraph.line(gp,
414
+ false,
415
+ "title"=>$OPT_title,
416
+ "index"=>($OPT_index||1),
417
+ "type" =>($OPT_type ||$Overplot),
418
+ "exchange"=>$OPT_exch,
419
+ "annotate"=>$annotate,
420
+ "min" => __split_range($OPT_range)[0],
421
+ "max" => __split_range($OPT_range)[1]
422
+ )
423
+ end
424
+ if ( $Overplot < $Overplot_max )
425
+ $Overplot += 1
426
+ else
427
+ $Overplot = 1
428
+ end
429
+
430
+ when "mark"
431
+ if ( $Overplot == 1 )
432
+ GGraph.mark(gp,
433
+ true,
434
+ "title"=>$OPT_title,
435
+ "index"=>($OPT_index||1),
436
+ "type" =>($OPT_type ||1),
437
+ "exchange"=>$OPT_exch,
438
+ "annotate"=>$annotate,
439
+ "min" => __split_range($OPT_range)[0],
440
+ "max" => __split_range($OPT_range)[1]
441
+ )
442
+ else
443
+ GGraph.mark(gp,
444
+ false,
445
+ "title"=>$OPT_title,
446
+ "index"=>($OPT_index||1),
447
+ "type" =>($OPT_type ||$Overplot),
448
+ "exchange"=>$OPT_exch,
449
+ "annotate"=>$annotate,
450
+ "min" => __split_range($OPT_range)[0],
451
+ "max" => __split_range($OPT_range)[1]
452
+ )
453
+ end
454
+ if ( $Overplot < $Overplot_max )
455
+ $Overplot += 1
456
+ else
457
+ $Overplot = 1
458
+ end
459
+
460
+ when "full"
461
+ GGraph.tone(gp,
462
+ true,
463
+ "title"=>$OPT_title,
464
+ "annotate"=>$annotate,
465
+ "transpose"=>$OPT_exch,
466
+ "levels"=>$OPT_slevels,
467
+ "patterns"=>$OPT_patterns
468
+ )
469
+ GGraph.contour(gp,
470
+ false,
471
+ "transpose"=>$OPT_exch,
472
+ "levels"=>$OPT_clevels,
473
+ "nozero"=>$OPT_nozero
474
+ )
475
+ when "nocont"
476
+ GGraph.tone(gp,
477
+ true,
478
+ "title"=>$OPT_title,
479
+ "annotate"=>$annotate,
480
+ "transpose"=>$OPT_exch,
481
+ "levels"=>$OPT_slevels,
482
+ "patterns"=>$OPT_patterns
483
+ )
484
+ when "noshade"
485
+ mj = DCL.udpget('indxmj')
486
+ mn = DCL.udpget('indxmn')
487
+ GGraph.contour(gp,
488
+ true,
489
+ "title" =>$OPT_title,
490
+ "label" =>true,
491
+ "annotate"=>$annotate,
492
+ "transpose"=>$OPT_exch,
493
+ "levels"=>$OPT_clevels,
494
+ "nozero"=>$OPT_nozero
495
+ )
496
+ end
497
+
498
+ # color bar
499
+ if ( ( draw_flag == "full") || ( draw_flag == "nocont") ) && $colorbar
500
+ GGraph::color_bar(
501
+ "left" => true,
502
+ "landscape" => true
503
+ )
504
+ end
505
+
506
+
507
+
508
+ end
509
+
510
+
511
+ def set_vpsize( default_vp, aspect=2.0 )
512
+
513
+ raise "#{aspect} must be a positive Numeric" if (aspect.to_f <= 0.0)
514
+ aspect = aspect.to_f
515
+
516
+ # default viewport
517
+ x0 = default_vp[0]; x1 = default_vp[1]
518
+ y0 = default_vp[2]; y1 = default_vp[3]
519
+ # viewport size
520
+ hlength = x1 - x0
521
+ vlength = y1 - y0
522
+ # center grid of viewport
523
+ cen_of_vp = [ x0 + hlength/2.0, y0 + vlength/2.0 ]
524
+
525
+ if aspect <= 2.0
526
+ hlength = vlength * aspect
527
+ x0 = cen_of_vp[0] - hlength/2.0
528
+ x1 = cen_of_vp[0] + hlength/2.0
529
+ else
530
+ vlength = hlength / aspect
531
+ y0 = cen_of_vp[1] - vlength/2.0
532
+ y1 = cen_of_vp[1] + vlength/2.0
533
+ end
534
+
535
+ return [ x0, x1, y0, y1 ]
536
+
537
+ end
538
+
539
+ def __split_range(range)
540
+
541
+ if /(.*):(.*)/ =~ range
542
+ if $1 == ""
543
+ min = nil
544
+ else
545
+ min = $1.to_f
546
+ end
547
+ if $2 == ""
548
+ max = nil
549
+ else
550
+ max = $2.to_f
551
+ end
552
+ elsif range == nil
553
+ min = max = nil
554
+ else
555
+ raise "invalid range: variable subset specification error. split range with ':'\n\n"
556
+ end
557
+
558
+ return min, max
559
+ end
560
+
561
+
562
+ #####################################################
563
+ ###++++++ Main Routine ++++++###
564
+
565
+ ## parse options
566
+ parser = GetoptLong.new
567
+ parser.set_options(
568
+ ### global option ###
569
+ ['--var', GetoptLong::REQUIRED_ARGUMENT],
570
+ ['--wsn', GetoptLong::REQUIRED_ARGUMENT],
571
+ ['--clrmap', GetoptLong::REQUIRED_ARGUMENT],
572
+ ['--itr', GetoptLong::REQUIRED_ARGUMENT],
573
+ ['--similar', GetoptLong::REQUIRED_ARGUMENT],
574
+ ['--map_axis', GetoptLong::REQUIRED_ARGUMENT],
575
+ ['--title', GetoptLong::REQUIRED_ARGUMENT],
576
+ ['--aspect', GetoptLong::REQUIRED_ARGUMENT],
577
+ ['--anim', GetoptLong::REQUIRED_ARGUMENT],
578
+ ['--animate', GetoptLong::REQUIRED_ARGUMENT],
579
+ ['--noannotate', GetoptLong::NO_ARGUMENT],
580
+ ['--alternate', GetoptLong::NO_ARGUMENT],
581
+ ['--Ga', GetoptLong::NO_ARGUMENT],
582
+ ['--nowait', GetoptLong::NO_ARGUMENT],
583
+ ['--Gw', GetoptLong::NO_ARGUMENT],
584
+ ['--smooth', GetoptLong::NO_ARGUMENT],
585
+ ['--Gaw', GetoptLong::NO_ARGUMENT],
586
+ ['--exch', GetoptLong::NO_ARGUMENT],
587
+ ['--reverse', GetoptLong::NO_ARGUMENT],
588
+ ['--Gr', GetoptLong::NO_ARGUMENT],
589
+ ['--mean', GetoptLong::REQUIRED_ARGUMENT],
590
+ ['--map', GetoptLong::REQUIRED_ARGUMENT],
591
+ ['--m', GetoptLong::NO_ARGUMENT],
592
+ ['--operation', GetoptLong::REQUIRED_ARGUMENT],
593
+ ### line/mark option ###
594
+ ['--line', GetoptLong::NO_ARGUMENT],
595
+ ['--mark', GetoptLong::NO_ARGUMENT],
596
+ ['--index', GetoptLong::REQUIRED_ARGUMENT],
597
+ ['--type', GetoptLong::REQUIRED_ARGUMENT],
598
+ ['--overplot', GetoptLong::REQUIRED_ARGUMENT],
599
+ ### tone or cont option ###
600
+ ['--nocont', GetoptLong::NO_ARGUMENT],
601
+ ['--noshade', GetoptLong::NO_ARGUMENT],
602
+ ['--range', GetoptLong::REQUIRED_ARGUMENT],
603
+ ['--crange', GetoptLong::REQUIRED_ARGUMENT],
604
+ ['--srange', GetoptLong::REQUIRED_ARGUMENT],
605
+ ['--interval', GetoptLong::REQUIRED_ARGUMENT],
606
+ ['--int', GetoptLong::REQUIRED_ARGUMENT],
607
+ ['--cint', GetoptLong::REQUIRED_ARGUMENT],
608
+ ['--sint', GetoptLong::REQUIRED_ARGUMENT],
609
+ ['--levels', GetoptLong::REQUIRED_ARGUMENT],
610
+ ['--clevels', GetoptLong::REQUIRED_ARGUMENT],
611
+ ['--slevels', GetoptLong::REQUIRED_ARGUMENT],
612
+ ['--patterns', GetoptLong::REQUIRED_ARGUMENT],
613
+ ['--nocolorbar', GetoptLong::NO_ARGUMENT],
614
+ ['--nozero', GetoptLong::NO_ARGUMENT],
615
+ ['--help', GetoptLong::NO_ARGUMENT]
616
+ # ['--version', GetoptLong::NO_ARGUMENT] # to be defined
617
+ )
618
+ begin
619
+ parser.each_option do |name, arg|
620
+ eval "$OPT_#{name.sub(/^--/, '').gsub(/-/, '_')} = '#{arg}'" # strage option value to $OPT_val
621
+ end
622
+ rescue
623
+ help
624
+ raise
625
+ end
626
+
627
+ ## Print out help message
628
+ if ($OPT_help)
629
+ help
630
+ exit(1)
631
+ end
632
+
633
+ ## set some figure option
634
+ DCL::swlset('lwait', false) if ($OPT_nowait || $OPT_Gw || $OPT_smooth || $OPT_Gaw)
635
+ # set wait or nowait
636
+ DCL::swlset('lalt', true) if ($OPT_alternate || $OPT_Ga || $OPT_smooth || $OPT_Gaw)
637
+ # set backing store option
638
+ if ($OPT_noannotate)
639
+ $annotate = false
640
+ else
641
+ $annotate = true
642
+ end
643
+ $Overplot_max = ( $OPT_overplot.to_i || 1 )
644
+ $Overplot = 1
645
+
646
+ if ($OPT_nocolorbar)
647
+ $colorbar = false
648
+ else
649
+ $colorbar = true
650
+ end
651
+
652
+ ## decide VIEWPORT
653
+ $VIEWPORT = set_vpsize( VIEWPORT, ($OPT_aspect||2.0) )
654
+
655
+ ## tune the size of axis parameters.
656
+ DCL.uzfact(0.7)
657
+
658
+ ## draw figure
659
+ loopdim = ( $OPT_animate || $OPT_anim )
660
+ loopdim = loopdim.to_i if loopdim.to_i.to_s == loopdim
661
+
662
+ ### set colormap
663
+ DCL.sgscmn($OPT_clrmap||1)
664
+ ## open work station
665
+ DCL.gropn($OPT_wsn||1)
666
+
667
+ ## open netcdf variables
668
+
669
+ while ARGV[0] do
670
+ gturl = ARGV[0]
671
+ gturl = gturl+'@'+$OPT_var if $OPT_var
672
+
673
+ gp = GPhys::IO.open_gturl(gturl)
674
+ print " Reading #{gturl}\n"
675
+ ARGV.shift
676
+
677
+ ## mean along any axis
678
+ if ($OPT_mean)
679
+ dims = ($OPT_mean).split(/\s*,\s*/)
680
+ dims.each{|dim|
681
+ dim = dim.to_i if dim.to_i.to_s == dim
682
+ gp = gp.mean(dim)
683
+ }
684
+ end
685
+
686
+ ## operation of a mathematical function
687
+ if ($OPT_operation)
688
+ eval "gp = gp.#{$OPT_operation}"
689
+ end
690
+
691
+ GGraph.margin_info($0, gturl) if $annotate # draw margin infomation
692
+ kind_of_fig = draw_setup(gp) # determine figure kind
693
+
694
+ if loopdim # animation
695
+ each_along_dims(gp, loopdim){|gp_subset|
696
+ draw(gp_subset, kind_of_fig)
697
+ }
698
+ else
699
+ draw( gp, kind_of_fig ) # single figure
700
+ end
701
+
702
+ end
703
+
704
+ DCL.grcls