gphys 1.1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. data/.gitignore +17 -0
  2. data/ChangeLog +221 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +18 -30
  5. data/README +23 -26
  6. data/README.md +29 -0
  7. data/Rakefile +1 -56
  8. data/bin/gpaop +2 -1
  9. data/bin/gpcut +3 -2
  10. data/bin/gpedit +6 -2
  11. data/bin/gpmath +3 -2
  12. data/bin/gpmaxmin +3 -2
  13. data/bin/gpprint +2 -1
  14. data/bin/gpvect +28 -5
  15. data/bin/gpview +43 -5
  16. data/extconf.rb +5 -6
  17. data/gphys.gemspec +34 -0
  18. data/interpo.c +63 -24
  19. data/lib/gphys.rb +2 -0
  20. data/lib/numru/dclext.rb +2636 -0
  21. data/lib/numru/derivative.rb +53 -12
  22. data/lib/numru/ganalysis/eof.rb +4 -0
  23. data/lib/numru/ganalysis/histogram.rb +73 -5
  24. data/lib/numru/ganalysis/met.rb +163 -2
  25. data/lib/numru/ganalysis/planet.rb +230 -20
  26. data/lib/numru/ggraph.rb +147 -2247
  27. data/lib/numru/gphys/assoccoords.rb +19 -3
  28. data/lib/numru/gphys/axis.rb +1 -1
  29. data/lib/numru/gphys/coordmapping.rb +2 -2
  30. data/lib/numru/gphys/derivative.rb +56 -13
  31. data/lib/numru/gphys/gphys.rb +17 -1
  32. data/lib/numru/gphys/gphys_grads_io.rb +6 -5
  33. data/lib/numru/gphys/gphys_grib_io.rb +6 -6
  34. data/lib/numru/gphys/gphys_io.rb +25 -6
  35. data/lib/numru/gphys/grads_gridded.rb +31 -29
  36. data/lib/numru/gphys/grib.rb +13 -9
  37. data/lib/numru/gphys/interpolate.rb +153 -29
  38. data/lib/numru/gphys/unumeric.rb +29 -6
  39. data/lib/numru/gphys/varray.rb +9 -0
  40. data/lib/numru/gphys/varraygrib.rb +70 -8
  41. data/lib/version.rb +3 -0
  42. metadata +247 -531
  43. data/doc/attribute.html +0 -19
  44. data/doc/attributenetcdf.html +0 -15
  45. data/doc/axis.html +0 -376
  46. data/doc/coordmapping.html +0 -111
  47. data/doc/coordtransform.html +0 -36
  48. data/doc/derivative/gphys-derivative.html +0 -80
  49. data/doc/derivative/index.html +0 -21
  50. data/doc/derivative/index.rd +0 -14
  51. data/doc/derivative/math-doc/document/document.css +0 -30
  52. data/doc/derivative/math-doc/document/document.html +0 -57
  53. data/doc/derivative/math-doc/document/images.aux +0 -1
  54. data/doc/derivative/math-doc/document/images.log +0 -385
  55. data/doc/derivative/math-doc/document/images.pl +0 -186
  56. data/doc/derivative/math-doc/document/images.tex +0 -364
  57. data/doc/derivative/math-doc/document/img1.png +0 -0
  58. data/doc/derivative/math-doc/document/img10.png +0 -0
  59. data/doc/derivative/math-doc/document/img11.png +0 -0
  60. data/doc/derivative/math-doc/document/img12.png +0 -0
  61. data/doc/derivative/math-doc/document/img13.png +0 -0
  62. data/doc/derivative/math-doc/document/img14.png +0 -0
  63. data/doc/derivative/math-doc/document/img15.png +0 -0
  64. data/doc/derivative/math-doc/document/img16.png +0 -0
  65. data/doc/derivative/math-doc/document/img17.png +0 -0
  66. data/doc/derivative/math-doc/document/img18.png +0 -0
  67. data/doc/derivative/math-doc/document/img19.png +0 -0
  68. data/doc/derivative/math-doc/document/img2.png +0 -0
  69. data/doc/derivative/math-doc/document/img20.png +0 -0
  70. data/doc/derivative/math-doc/document/img21.png +0 -0
  71. data/doc/derivative/math-doc/document/img22.png +0 -0
  72. data/doc/derivative/math-doc/document/img23.png +0 -0
  73. data/doc/derivative/math-doc/document/img24.png +0 -0
  74. data/doc/derivative/math-doc/document/img25.png +0 -0
  75. data/doc/derivative/math-doc/document/img26.png +0 -0
  76. data/doc/derivative/math-doc/document/img27.png +0 -0
  77. data/doc/derivative/math-doc/document/img28.png +0 -0
  78. data/doc/derivative/math-doc/document/img29.png +0 -0
  79. data/doc/derivative/math-doc/document/img3.png +0 -0
  80. data/doc/derivative/math-doc/document/img30.png +0 -0
  81. data/doc/derivative/math-doc/document/img4.png +0 -0
  82. data/doc/derivative/math-doc/document/img5.png +0 -0
  83. data/doc/derivative/math-doc/document/img6.png +0 -0
  84. data/doc/derivative/math-doc/document/img7.png +0 -0
  85. data/doc/derivative/math-doc/document/img8.png +0 -0
  86. data/doc/derivative/math-doc/document/img9.png +0 -0
  87. data/doc/derivative/math-doc/document/index.html +0 -57
  88. data/doc/derivative/math-doc/document/labels.pl +0 -13
  89. data/doc/derivative/math-doc/document/next.png +0 -0
  90. data/doc/derivative/math-doc/document/next_g.png +0 -0
  91. data/doc/derivative/math-doc/document/node1.html +0 -238
  92. data/doc/derivative/math-doc/document/node2.html +0 -75
  93. data/doc/derivative/math-doc/document/prev.png +0 -0
  94. data/doc/derivative/math-doc/document/prev_g.png +0 -0
  95. data/doc/derivative/math-doc/document/up.png +0 -0
  96. data/doc/derivative/math-doc/document/up_g.png +0 -0
  97. data/doc/derivative/math-doc/document.pdf +0 -0
  98. data/doc/derivative/math-doc/document.tex +0 -158
  99. data/doc/derivative/numru-derivative.html +0 -129
  100. data/doc/ep_flux/ep_flux.html +0 -469
  101. data/doc/ep_flux/ggraph_on_merdional_section.html +0 -71
  102. data/doc/ep_flux/index.html +0 -31
  103. data/doc/ep_flux/index.rd +0 -24
  104. data/doc/ep_flux/math-doc/document/WARNINGS +0 -1
  105. data/doc/ep_flux/math-doc/document/contents.png +0 -0
  106. data/doc/ep_flux/math-doc/document/crossref.png +0 -0
  107. data/doc/ep_flux/math-doc/document/document.css +0 -30
  108. data/doc/ep_flux/math-doc/document/document.html +0 -101
  109. data/doc/ep_flux/math-doc/document/images.aux +0 -1
  110. data/doc/ep_flux/math-doc/document/images.log +0 -1375
  111. data/doc/ep_flux/math-doc/document/images.pl +0 -1328
  112. data/doc/ep_flux/math-doc/document/images.tex +0 -1471
  113. data/doc/ep_flux/math-doc/document/img1.png +0 -0
  114. data/doc/ep_flux/math-doc/document/img10.png +0 -0
  115. data/doc/ep_flux/math-doc/document/img100.png +0 -0
  116. data/doc/ep_flux/math-doc/document/img101.png +0 -0
  117. data/doc/ep_flux/math-doc/document/img102.png +0 -0
  118. data/doc/ep_flux/math-doc/document/img103.png +0 -0
  119. data/doc/ep_flux/math-doc/document/img104.png +0 -0
  120. data/doc/ep_flux/math-doc/document/img105.png +0 -0
  121. data/doc/ep_flux/math-doc/document/img106.png +0 -0
  122. data/doc/ep_flux/math-doc/document/img107.png +0 -0
  123. data/doc/ep_flux/math-doc/document/img108.png +0 -0
  124. data/doc/ep_flux/math-doc/document/img109.png +0 -0
  125. data/doc/ep_flux/math-doc/document/img11.png +0 -0
  126. data/doc/ep_flux/math-doc/document/img110.png +0 -0
  127. data/doc/ep_flux/math-doc/document/img111.png +0 -0
  128. data/doc/ep_flux/math-doc/document/img112.png +0 -0
  129. data/doc/ep_flux/math-doc/document/img113.png +0 -0
  130. data/doc/ep_flux/math-doc/document/img114.png +0 -0
  131. data/doc/ep_flux/math-doc/document/img115.png +0 -0
  132. data/doc/ep_flux/math-doc/document/img116.png +0 -0
  133. data/doc/ep_flux/math-doc/document/img117.png +0 -0
  134. data/doc/ep_flux/math-doc/document/img118.png +0 -0
  135. data/doc/ep_flux/math-doc/document/img119.png +0 -0
  136. data/doc/ep_flux/math-doc/document/img12.png +0 -0
  137. data/doc/ep_flux/math-doc/document/img120.png +0 -0
  138. data/doc/ep_flux/math-doc/document/img121.png +0 -0
  139. data/doc/ep_flux/math-doc/document/img122.png +0 -0
  140. data/doc/ep_flux/math-doc/document/img123.png +0 -0
  141. data/doc/ep_flux/math-doc/document/img124.png +0 -0
  142. data/doc/ep_flux/math-doc/document/img125.png +0 -0
  143. data/doc/ep_flux/math-doc/document/img126.png +0 -0
  144. data/doc/ep_flux/math-doc/document/img127.png +0 -0
  145. data/doc/ep_flux/math-doc/document/img128.png +0 -0
  146. data/doc/ep_flux/math-doc/document/img129.png +0 -0
  147. data/doc/ep_flux/math-doc/document/img13.png +0 -0
  148. data/doc/ep_flux/math-doc/document/img130.png +0 -0
  149. data/doc/ep_flux/math-doc/document/img131.png +0 -0
  150. data/doc/ep_flux/math-doc/document/img132.png +0 -0
  151. data/doc/ep_flux/math-doc/document/img133.png +0 -0
  152. data/doc/ep_flux/math-doc/document/img134.png +0 -0
  153. data/doc/ep_flux/math-doc/document/img135.png +0 -0
  154. data/doc/ep_flux/math-doc/document/img136.png +0 -0
  155. data/doc/ep_flux/math-doc/document/img137.png +0 -0
  156. data/doc/ep_flux/math-doc/document/img138.png +0 -0
  157. data/doc/ep_flux/math-doc/document/img139.png +0 -0
  158. data/doc/ep_flux/math-doc/document/img14.png +0 -0
  159. data/doc/ep_flux/math-doc/document/img140.png +0 -0
  160. data/doc/ep_flux/math-doc/document/img141.png +0 -0
  161. data/doc/ep_flux/math-doc/document/img142.png +0 -0
  162. data/doc/ep_flux/math-doc/document/img143.png +0 -0
  163. data/doc/ep_flux/math-doc/document/img144.png +0 -0
  164. data/doc/ep_flux/math-doc/document/img145.png +0 -0
  165. data/doc/ep_flux/math-doc/document/img146.png +0 -0
  166. data/doc/ep_flux/math-doc/document/img147.png +0 -0
  167. data/doc/ep_flux/math-doc/document/img148.png +0 -0
  168. data/doc/ep_flux/math-doc/document/img149.png +0 -0
  169. data/doc/ep_flux/math-doc/document/img15.png +0 -0
  170. data/doc/ep_flux/math-doc/document/img150.png +0 -0
  171. data/doc/ep_flux/math-doc/document/img151.png +0 -0
  172. data/doc/ep_flux/math-doc/document/img152.png +0 -0
  173. data/doc/ep_flux/math-doc/document/img153.png +0 -0
  174. data/doc/ep_flux/math-doc/document/img154.png +0 -0
  175. data/doc/ep_flux/math-doc/document/img155.png +0 -0
  176. data/doc/ep_flux/math-doc/document/img156.png +0 -0
  177. data/doc/ep_flux/math-doc/document/img157.png +0 -0
  178. data/doc/ep_flux/math-doc/document/img158.png +0 -0
  179. data/doc/ep_flux/math-doc/document/img159.png +0 -0
  180. data/doc/ep_flux/math-doc/document/img16.png +0 -0
  181. data/doc/ep_flux/math-doc/document/img160.png +0 -0
  182. data/doc/ep_flux/math-doc/document/img161.png +0 -0
  183. data/doc/ep_flux/math-doc/document/img162.png +0 -0
  184. data/doc/ep_flux/math-doc/document/img163.png +0 -0
  185. data/doc/ep_flux/math-doc/document/img164.png +0 -0
  186. data/doc/ep_flux/math-doc/document/img165.png +0 -0
  187. data/doc/ep_flux/math-doc/document/img166.png +0 -0
  188. data/doc/ep_flux/math-doc/document/img167.png +0 -0
  189. data/doc/ep_flux/math-doc/document/img168.png +0 -0
  190. data/doc/ep_flux/math-doc/document/img169.png +0 -0
  191. data/doc/ep_flux/math-doc/document/img17.png +0 -0
  192. data/doc/ep_flux/math-doc/document/img170.png +0 -0
  193. data/doc/ep_flux/math-doc/document/img171.png +0 -0
  194. data/doc/ep_flux/math-doc/document/img172.png +0 -0
  195. data/doc/ep_flux/math-doc/document/img173.png +0 -0
  196. data/doc/ep_flux/math-doc/document/img174.png +0 -0
  197. data/doc/ep_flux/math-doc/document/img175.png +0 -0
  198. data/doc/ep_flux/math-doc/document/img176.png +0 -0
  199. data/doc/ep_flux/math-doc/document/img177.png +0 -0
  200. data/doc/ep_flux/math-doc/document/img178.png +0 -0
  201. data/doc/ep_flux/math-doc/document/img179.png +0 -0
  202. data/doc/ep_flux/math-doc/document/img18.png +0 -0
  203. data/doc/ep_flux/math-doc/document/img180.png +0 -0
  204. data/doc/ep_flux/math-doc/document/img181.png +0 -0
  205. data/doc/ep_flux/math-doc/document/img182.png +0 -0
  206. data/doc/ep_flux/math-doc/document/img183.png +0 -0
  207. data/doc/ep_flux/math-doc/document/img184.png +0 -0
  208. data/doc/ep_flux/math-doc/document/img185.png +0 -0
  209. data/doc/ep_flux/math-doc/document/img186.png +0 -0
  210. data/doc/ep_flux/math-doc/document/img187.png +0 -0
  211. data/doc/ep_flux/math-doc/document/img188.png +0 -0
  212. data/doc/ep_flux/math-doc/document/img189.png +0 -0
  213. data/doc/ep_flux/math-doc/document/img19.png +0 -0
  214. data/doc/ep_flux/math-doc/document/img190.png +0 -0
  215. data/doc/ep_flux/math-doc/document/img191.png +0 -0
  216. data/doc/ep_flux/math-doc/document/img192.png +0 -0
  217. data/doc/ep_flux/math-doc/document/img193.png +0 -0
  218. data/doc/ep_flux/math-doc/document/img194.png +0 -0
  219. data/doc/ep_flux/math-doc/document/img195.png +0 -0
  220. data/doc/ep_flux/math-doc/document/img196.png +0 -0
  221. data/doc/ep_flux/math-doc/document/img197.png +0 -0
  222. data/doc/ep_flux/math-doc/document/img198.png +0 -0
  223. data/doc/ep_flux/math-doc/document/img199.png +0 -0
  224. data/doc/ep_flux/math-doc/document/img2.png +0 -0
  225. data/doc/ep_flux/math-doc/document/img20.png +0 -0
  226. data/doc/ep_flux/math-doc/document/img200.png +0 -0
  227. data/doc/ep_flux/math-doc/document/img21.png +0 -0
  228. data/doc/ep_flux/math-doc/document/img22.png +0 -0
  229. data/doc/ep_flux/math-doc/document/img23.png +0 -0
  230. data/doc/ep_flux/math-doc/document/img24.png +0 -0
  231. data/doc/ep_flux/math-doc/document/img25.png +0 -0
  232. data/doc/ep_flux/math-doc/document/img26.png +0 -0
  233. data/doc/ep_flux/math-doc/document/img27.png +0 -0
  234. data/doc/ep_flux/math-doc/document/img28.png +0 -0
  235. data/doc/ep_flux/math-doc/document/img29.png +0 -0
  236. data/doc/ep_flux/math-doc/document/img3.png +0 -0
  237. data/doc/ep_flux/math-doc/document/img30.png +0 -0
  238. data/doc/ep_flux/math-doc/document/img31.png +0 -0
  239. data/doc/ep_flux/math-doc/document/img32.png +0 -0
  240. data/doc/ep_flux/math-doc/document/img33.png +0 -0
  241. data/doc/ep_flux/math-doc/document/img34.png +0 -0
  242. data/doc/ep_flux/math-doc/document/img35.png +0 -0
  243. data/doc/ep_flux/math-doc/document/img36.png +0 -0
  244. data/doc/ep_flux/math-doc/document/img37.png +0 -0
  245. data/doc/ep_flux/math-doc/document/img38.png +0 -0
  246. data/doc/ep_flux/math-doc/document/img39.png +0 -0
  247. data/doc/ep_flux/math-doc/document/img4.png +0 -0
  248. data/doc/ep_flux/math-doc/document/img40.png +0 -0
  249. data/doc/ep_flux/math-doc/document/img41.png +0 -0
  250. data/doc/ep_flux/math-doc/document/img42.png +0 -0
  251. data/doc/ep_flux/math-doc/document/img43.png +0 -0
  252. data/doc/ep_flux/math-doc/document/img44.png +0 -0
  253. data/doc/ep_flux/math-doc/document/img45.png +0 -0
  254. data/doc/ep_flux/math-doc/document/img46.png +0 -0
  255. data/doc/ep_flux/math-doc/document/img47.png +0 -0
  256. data/doc/ep_flux/math-doc/document/img48.png +0 -0
  257. data/doc/ep_flux/math-doc/document/img49.png +0 -0
  258. data/doc/ep_flux/math-doc/document/img5.png +0 -0
  259. data/doc/ep_flux/math-doc/document/img50.png +0 -0
  260. data/doc/ep_flux/math-doc/document/img51.png +0 -0
  261. data/doc/ep_flux/math-doc/document/img52.png +0 -0
  262. data/doc/ep_flux/math-doc/document/img53.png +0 -0
  263. data/doc/ep_flux/math-doc/document/img54.png +0 -0
  264. data/doc/ep_flux/math-doc/document/img55.png +0 -0
  265. data/doc/ep_flux/math-doc/document/img56.png +0 -0
  266. data/doc/ep_flux/math-doc/document/img57.png +0 -0
  267. data/doc/ep_flux/math-doc/document/img58.png +0 -0
  268. data/doc/ep_flux/math-doc/document/img59.png +0 -0
  269. data/doc/ep_flux/math-doc/document/img6.png +0 -0
  270. data/doc/ep_flux/math-doc/document/img60.png +0 -0
  271. data/doc/ep_flux/math-doc/document/img61.png +0 -0
  272. data/doc/ep_flux/math-doc/document/img62.png +0 -0
  273. data/doc/ep_flux/math-doc/document/img63.png +0 -0
  274. data/doc/ep_flux/math-doc/document/img64.png +0 -0
  275. data/doc/ep_flux/math-doc/document/img65.png +0 -0
  276. data/doc/ep_flux/math-doc/document/img66.png +0 -0
  277. data/doc/ep_flux/math-doc/document/img67.png +0 -0
  278. data/doc/ep_flux/math-doc/document/img68.png +0 -0
  279. data/doc/ep_flux/math-doc/document/img69.png +0 -0
  280. data/doc/ep_flux/math-doc/document/img7.png +0 -0
  281. data/doc/ep_flux/math-doc/document/img70.png +0 -0
  282. data/doc/ep_flux/math-doc/document/img71.png +0 -0
  283. data/doc/ep_flux/math-doc/document/img72.png +0 -0
  284. data/doc/ep_flux/math-doc/document/img73.png +0 -0
  285. data/doc/ep_flux/math-doc/document/img74.png +0 -0
  286. data/doc/ep_flux/math-doc/document/img75.png +0 -0
  287. data/doc/ep_flux/math-doc/document/img76.png +0 -0
  288. data/doc/ep_flux/math-doc/document/img77.png +0 -0
  289. data/doc/ep_flux/math-doc/document/img78.png +0 -0
  290. data/doc/ep_flux/math-doc/document/img79.png +0 -0
  291. data/doc/ep_flux/math-doc/document/img8.png +0 -0
  292. data/doc/ep_flux/math-doc/document/img80.png +0 -0
  293. data/doc/ep_flux/math-doc/document/img81.png +0 -0
  294. data/doc/ep_flux/math-doc/document/img82.png +0 -0
  295. data/doc/ep_flux/math-doc/document/img83.png +0 -0
  296. data/doc/ep_flux/math-doc/document/img84.png +0 -0
  297. data/doc/ep_flux/math-doc/document/img85.png +0 -0
  298. data/doc/ep_flux/math-doc/document/img86.png +0 -0
  299. data/doc/ep_flux/math-doc/document/img87.png +0 -0
  300. data/doc/ep_flux/math-doc/document/img88.png +0 -0
  301. data/doc/ep_flux/math-doc/document/img89.png +0 -0
  302. data/doc/ep_flux/math-doc/document/img9.png +0 -0
  303. data/doc/ep_flux/math-doc/document/img90.png +0 -0
  304. data/doc/ep_flux/math-doc/document/img91.png +0 -0
  305. data/doc/ep_flux/math-doc/document/img92.png +0 -0
  306. data/doc/ep_flux/math-doc/document/img93.png +0 -0
  307. data/doc/ep_flux/math-doc/document/img94.png +0 -0
  308. data/doc/ep_flux/math-doc/document/img95.png +0 -0
  309. data/doc/ep_flux/math-doc/document/img96.png +0 -0
  310. data/doc/ep_flux/math-doc/document/img97.png +0 -0
  311. data/doc/ep_flux/math-doc/document/img98.png +0 -0
  312. data/doc/ep_flux/math-doc/document/img99.png +0 -0
  313. data/doc/ep_flux/math-doc/document/index.html +0 -101
  314. data/doc/ep_flux/math-doc/document/internals.pl +0 -258
  315. data/doc/ep_flux/math-doc/document/labels.pl +0 -265
  316. data/doc/ep_flux/math-doc/document/next.png +0 -0
  317. data/doc/ep_flux/math-doc/document/next_g.png +0 -0
  318. data/doc/ep_flux/math-doc/document/node1.html +0 -104
  319. data/doc/ep_flux/math-doc/document/node10.html +0 -164
  320. data/doc/ep_flux/math-doc/document/node11.html +0 -86
  321. data/doc/ep_flux/math-doc/document/node12.html +0 -166
  322. data/doc/ep_flux/math-doc/document/node13.html +0 -897
  323. data/doc/ep_flux/math-doc/document/node14.html +0 -1065
  324. data/doc/ep_flux/math-doc/document/node15.html +0 -72
  325. data/doc/ep_flux/math-doc/document/node16.html +0 -81
  326. data/doc/ep_flux/math-doc/document/node2.html +0 -82
  327. data/doc/ep_flux/math-doc/document/node3.html +0 -91
  328. data/doc/ep_flux/math-doc/document/node4.html +0 -149
  329. data/doc/ep_flux/math-doc/document/node5.html +0 -330
  330. data/doc/ep_flux/math-doc/document/node6.html +0 -99
  331. data/doc/ep_flux/math-doc/document/node7.html +0 -98
  332. data/doc/ep_flux/math-doc/document/node8.html +0 -83
  333. data/doc/ep_flux/math-doc/document/node9.html +0 -140
  334. data/doc/ep_flux/math-doc/document/prev.png +0 -0
  335. data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
  336. data/doc/ep_flux/math-doc/document/up.png +0 -0
  337. data/doc/ep_flux/math-doc/document/up_g.png +0 -0
  338. data/doc/ep_flux/math-doc/document.pdf +0 -0
  339. data/doc/ep_flux/math-doc/document.tex +0 -2018
  340. data/doc/gdir.html +0 -412
  341. data/doc/gdir_client.html +0 -16
  342. data/doc/gdir_connect_ftp-like.html +0 -61
  343. data/doc/gdir_server.html +0 -45
  344. data/doc/ggraph.html +0 -1615
  345. data/doc/gpcat.html +0 -44
  346. data/doc/gpcut.html +0 -41
  347. data/doc/gphys.html +0 -532
  348. data/doc/gphys_fft.html +0 -324
  349. data/doc/gphys_grads_io.html +0 -69
  350. data/doc/gphys_grib_io.html +0 -82
  351. data/doc/gphys_io.html +0 -120
  352. data/doc/gphys_io_common.html +0 -18
  353. data/doc/gphys_netcdf_io.html +0 -283
  354. data/doc/gplist.html +0 -24
  355. data/doc/gpmath.html +0 -51
  356. data/doc/gpmaxmin.html +0 -31
  357. data/doc/gpprint.html +0 -34
  358. data/doc/gpview.html +0 -270
  359. data/doc/grads2nc_with_gphys.html +0 -21
  360. data/doc/grads_gridded.html +0 -307
  361. data/doc/grib.html +0 -144
  362. data/doc/grid.html +0 -212
  363. data/doc/index.html +0 -133
  364. data/doc/index.rd +0 -127
  365. data/doc/netcdf_convention.html +0 -136
  366. data/doc/unumeric.html +0 -176
  367. data/doc/update +0 -64
  368. data/doc/varray.html +0 -299
  369. data/doc/varraycomposite.html +0 -67
@@ -39,18 +39,35 @@ module NumRu
39
39
  #< Class variables regarding lon & lat >
40
40
 
41
41
  @@lonbc = GPhys::Derivative::CYCLIC_OR_LINEAR # this should be always fine
42
- @@latbc = GPhys::Derivative::LINEAR_EXT # this should be always fine
42
+ # @@latbc = GPhys::Derivative::LINEAR_EXT # this should be always fine
43
43
 
44
- @@lam = nil # lambda (lon in radian) obtaiend lately (see get_lonlat)
45
- @@phi = nil # phi (lat in radian) obtaiend lately (see get_lonlat)
44
+ @@lam = nil # lambda (lon in radian) obtaiend lately (see get_lambda_phi)
45
+ @@phi = nil # phi (lat in radian) obtaiend lately (see get_lambda_phi)
46
46
 
47
47
  #< Differentian at the planets's near surface. With suffix "_s" >
48
48
 
49
+ def latbc(phi)
50
+ =begin
51
+ # not so good
52
+ pi2 = Math::PI/2
53
+ eps = 0.1
54
+ xs = phi[0..1].val
55
+ xe = phi[-2..-1].val
56
+ if (pi2-xs[0].abs) / (xs[0]-xs[1]).abs < eps and
57
+ (pi2-xe[-1].abs) / (xe[-1]-xe[-2]).abs < eps
58
+ GPhys::Derivative::MIRROR_B
59
+ else
60
+ GPhys::Derivative::LINEAR_EXT
61
+ end
62
+ =end
63
+ GPhys::Derivative::LINEAR_EXT
64
+ end
65
+
49
66
  def rot_s(u,v)
50
- lond, latd, lam, phi = get_lonlat(u)
67
+ lam, phi, lond, latd = get_lambda_phi(u)
51
68
  cos_phi = phi.cos
52
69
  dv_dlam = v.cderiv(lond,@@lonbc,lam)
53
- duc_dphi = (u*cos_phi).cderiv(latd,@@latbc,phi)
70
+ duc_dphi = (u*cos_phi).cderiv(latd,latbc(phi),phi)
54
71
  rot = (dv_dlam - duc_dphi) / (@@R*cos_phi)
55
72
  rot.long_name = "rot(#{u.name},#{v.name})"
56
73
  rot.name = "rot"
@@ -58,10 +75,10 @@ module NumRu
58
75
  end
59
76
 
60
77
  def div_s(u,v)
61
- lond, latd, lam, phi = get_lonlat(u)
78
+ lam, phi, lond, latd = get_lambda_phi(u)
62
79
  cos_phi = phi.cos
63
80
  du_dlam = u.cderiv(lond,@@lonbc,lam)
64
- dvc_dphi = (v*cos_phi).cderiv(latd,@@latbc,phi)
81
+ dvc_dphi = (v*cos_phi).cderiv(latd,latbc(phi),phi)
65
82
  rot = (du_dlam + dvc_dphi) / (@@R*cos_phi)
66
83
  rot.long_name = "div(#{u.name},#{v.name})"
67
84
  rot.name = "div"
@@ -83,10 +100,10 @@ module NumRu
83
100
  end
84
101
 
85
102
  def grad_s(s)
86
- lond, latd, lam, phi = get_lonlat(s)
103
+ lam, phi, lond, latd = get_lambda_phi(s)
87
104
  cos_phi = phi.cos
88
105
  xs = s.cderiv(lond,@@lonbc,lam) / (@@R*cos_phi)
89
- ys = s.cderiv(latd,@@latbc,phi) / @@R
106
+ ys = s.cderiv(latd,latbc(phi),phi) / @@R
90
107
  xs.long_name = "xgrad(#{s.name})"
91
108
  xs.name = "xgrad"
92
109
  ys.long_name = "ygrad(#{s.name})"
@@ -94,36 +111,129 @@ module NumRu
94
111
  [xs,ys]
95
112
  end
96
113
 
114
+ def grad_sx(s)
115
+ lam, phi, lond, latd = get_lambda_phi(s)
116
+ cos_phi = phi.cos
117
+ xs = s.cderiv(lond,@@lonbc,lam) / (@@R*cos_phi)
118
+ xs.long_name = "xgrad(#{s.name})"
119
+ xs.name = "xgrad"
120
+ xs
121
+ end
122
+
123
+ def grad_sy(s)
124
+ lam, phi, lond, latd = get_lambda_phi(s)
125
+ cos_phi = phi.cos
126
+ ys = s.cderiv(latd,latbc(phi),phi) / @@R
127
+ ys.long_name = "ygrad(#{s.name})"
128
+ ys.name = "ygrad"
129
+ ys
130
+ end
131
+
132
+ def grad_sy_cosphifact(s,cosphi_exponent)
133
+ lam, phi, lond, latd = get_lambda_phi(s)
134
+ cos_phi = phi.cos
135
+ cos_phi_factor = cos_phi**cosphi_exponent
136
+ ys = (s*cos_phi_factor).cderiv(latd,latbc(phi),phi)/cos_phi_factor / @@R
137
+ ys.long_name = "ygrad(#{s.name})"
138
+ ys.name = "ygrad"
139
+ ys
140
+ end
141
+
142
+ def weight_tanphi(s, tan_exp, r_exp)
143
+ lam, phi, lond, latd = get_lambda_phi(s)
144
+ tan_phi = phi.tan
145
+ ys = s * (tan_phi**tan_exp * @@R**r_exp)
146
+ ys
147
+ end
148
+
149
+ def weight_cosphi(s, cos_exp, r_exp)
150
+ lam, phi, lond, latd = get_lambda_phi(s)
151
+ cos_phi = phi.cos
152
+ ys = s * (cos_phi**cos_exp * @@R**r_exp)
153
+ ys
154
+ end
155
+
156
+ def weight_sinphi(s, sin_exp, r_exp)
157
+ lam, phi, lond, latd = get_lambda_phi(s)
158
+ sin_phi = phi.sin
159
+ ys = s * (sin_phi**sin_exp * @@R**r_exp)
160
+ ys
161
+ end
162
+
97
163
  #< helper methods >
98
164
 
99
- def get_lonlat(gp)
100
- lond, latd = find_lon_lat_dims(gp, true)
101
- lam = gp.axis(lond).to_gphys.convert_units("rad") # lambda (lon in rad)
102
- lam.units = "" # treat as non-dim
103
- phi = gp.axis(latd).to_gphys.convert_units("rad") # phi (lat in rad)
104
- phi.units = "" # treat as non-dim
165
+ # Find longitude and latitude coordinates and convert into
166
+ # radian.
167
+ #
168
+ # RETURN VALUE
169
+ # * [lam, phi, lond, latd]
170
+ # * lam (GPhys): longitude in radian (lambda).
171
+ # (nil if not found && !err_raise)
172
+ # * phi (GPhys): latitude in radian (lambda).
173
+ # (nil if not found && !err_raise)
174
+ # * lond : Interger to show that longitude is the lon-th dim if found;
175
+ # (nil if not found && !err_raise)
176
+ # * latd : Interger to show that latitude is the lat-th dim iffound;
177
+ # (nil if not found && !err_raise)
178
+ def get_lambda_phi(gp, err_raise=true)
179
+ lond, latd = find_lon_lat_dims(gp, err_raise)
180
+ lam = lond && gp.axis(lond).to_gphys.convert_units("rad") # lon in rad
181
+ lam.units = "" if lond # treat as non-dim
182
+ phi = latd && gp.axis(latd).to_gphys.convert_units("rad") # lat in rad
183
+ phi.units = "" if latd # treat as non-dim
105
184
  @@lam = lam
106
185
  @@phi = phi
107
- [lond, latd, lam, phi]
186
+ [lam, phi, lond, latd]
108
187
  end
109
188
 
189
+ # Find longitude and latitude coordinates.
190
+ #
191
+ # ARGUMENTS
192
+ # * gp : GPhys to inspect
193
+ # * err_raise (OPTIONAL; default:false) : if true, exception is raised
194
+ # if longitude or latitude coordinate is not found.
195
+ #
196
+ # SEARCH CRITERIA
197
+ # (1) Find coord having units "degrees_east" (lon) or
198
+ # "degrees_north" (lat)
199
+ # (2) Investigate coordinate name matches (to find a lonitude coord,
200
+ # /longitude/i for long_name or standard_name, or /^lon/ for name)
201
+ # and match units compatible with "degrees".
202
+ #
203
+ #
204
+ # RETURN VALUE
205
+ # * [lond,latd]
206
+ # * lond: dimension number of longitude (0,1,..) if found /
207
+ # nil if not found
208
+ # * latd: dimension number of latitude (0,1,..) if found /
209
+ # nil if not found
210
+ #
110
211
  def find_lon_lat_dims(gp, err_raise=false)
111
212
  lond = nil
112
213
  latd = nil
113
214
  (0...gp.rank).each do |dim|
114
- if /^degrees?_east$/i =~ gp.coord(dim).get_att("units")
215
+ crd = gp.coord(dim)
216
+ if /^degrees?_east$/i =~ crd.get_att("units")
115
217
  lond = dim
116
218
  break
117
- elsif /^longitude$/i =~ gp.coord(dim).long_name
219
+ elsif ( ( /longitude/i =~ crd.long_name ||
220
+ /^lon/i =~ crd.name ||
221
+ (nm=crd.get_att("standard_name") && /longitude/i =~ nm ) &&
222
+ (crd.units =~ Units["degrees_east"]) ) )
118
223
  lond = dim
119
224
  break
120
225
  end
121
226
  end
122
227
  (0...gp.rank).each do |dim|
123
- if /^degrees?_north$/i =~ gp.coord(dim).get_att("units")
228
+ next if dim == lond
229
+ crd = gp.coord(dim)
230
+ if /^degrees?_north$/i =~ crd.get_att("units")
124
231
  latd = dim
125
232
  break
126
- elsif /^latitude$/i =~ gp.coord(dim).long_name
233
+ elsif ( ( /latitude/i =~ crd.long_name ||
234
+ /^lat/i =~ crd.name ||
235
+ (nm=crd.get_att("standard_name") && /latitude/i =~ nm ) &&
236
+ (crd.units =~ Units["degrees_north"]) ) )
127
237
  latd = dim
128
238
  break
129
239
  end
@@ -136,9 +246,104 @@ module NumRu
136
246
  end
137
247
  end
138
248
 
249
+ end
139
250
 
251
+ =begin
252
+ class GPhys
140
253
 
254
+ # Find longitude and latitude coordinates.
255
+ #
256
+ # SEARCH CRITERIA
257
+ # (1) Find coord having units "degrees_east" (lon) or
258
+ # "degrees_north" (lat)
259
+ # (2) Investigate coordinate name matches (to find a lonitude coord,
260
+ # /longitude/i for long_name or standard_name, or /^lon/ for name)
261
+ # and match units compatible with "degrees".
262
+ #
263
+ # ARGUMENT
264
+ # * out_in_radian (OPTIONAL default:false) : if true, output is made
265
+ # in radian
266
+ #
267
+ # RETURN VALUE
268
+ # * [lon, lat, dimlon, dimlat]
269
+ # * lon : VArray representing longitude if found; nil if not found.
270
+ # By default (out_in_radian==false), its units are converted into
271
+ # "degrees_east" if not; If out_in_radian==true, converion is made
272
+ # into "radian".
273
+ # * lat : VArray representing latitude if found; nil if not found.
274
+ # By default (out_in_radian==false), its units are converted into
275
+ # "degrees_north" if not; If out_in_radian==true, converion is made
276
+ # into "radian".
277
+ # * lon : Interger to show that longitude is the lon-th dim if found;
278
+ # nil if not found.
279
+ # * lat : Interger to show that latitude is the lat-th dim iffound;
280
+ # nil if not found.
281
+ def get_lon_lat_coord(out_in_radian=false)
282
+ unrad = Units["radian"]
283
+
284
+ #< find longitude >
285
+ unlon = Units["degrees_east"]
286
+ reg_additional = /east/
287
+ lon = dimlon = nil
288
+ for dim in 0...rank
289
+ crd = coord(dim)
290
+ uncrd = crd.units
291
+ if uncrd == unlon && reg_additional =~ uncrd.to_s
292
+ dimlon = dim
293
+ lon = crd
294
+ break
295
+ elsif ( ( /longitude/i =~ crd.long_name ||
296
+ /^lon/i =~ crd.name ||
297
+ (nm=crd.get_att("standard_name") && /longitude/i =~ nm ) &&
298
+ (uncrd =~ unlon) ) )
299
+ dimlon = dim
300
+ lon = crd
301
+ break
302
+ end
303
+ end
304
+ if lon
305
+ if out_in_radian
306
+ lon = lon.convert_units(unrad)
307
+ else
308
+ lon = lon.convert_units(unlon)
309
+ end
310
+ end
311
+
312
+ #< find latitude >
313
+ unlat = Units["degrees_north"]
314
+ reg_additional = /north/
315
+ lat = dimlat = nil
316
+ for dim in 0...rank
317
+ next if dim == dimlon
318
+ crd = coord(dim)
319
+ uncrd = crd.units
320
+ if uncrd == unlat && reg_additional =~ uncrd.to_s
321
+ dimlat = dim
322
+ lat = crd
323
+ break
324
+ elsif ( ( /latitude/i =~ crd.long_name ||
325
+ /^lat/i =~ crd.name ||
326
+ (nm=crd.get_att("standard_name") && /latitude/i =~ nm ) &&
327
+ (uncrd =~ unlat) ) )
328
+ dimlat = dim
329
+ lat = crd
330
+ break
331
+ end
332
+ end
333
+ if lat
334
+ if out_in_radian
335
+ lat = lat.convert_units(unrad)
336
+ else
337
+ lat = lat.convert_units(unlon)
338
+ end
339
+ end
340
+
341
+ [lon, lat, dimlon, dimlat]
342
+ end
343
+
141
344
  end
345
+ =end
346
+
142
347
  end
143
348
 
144
349
  ################################################
@@ -179,4 +384,9 @@ if $0 == __FILE__
179
384
  GGraph::tone div[false,iz],true,"max"=>0.5e-5,"min"=>-0.5e-5,"int"=>0.5e-6
180
385
  GGraph::color_bar
181
386
  DCL.grcls
387
+
388
+ print "\n\n*** test lon/lat coords ***\n"
389
+ p GAnalysis::Planet.find_lon_lat_dims(u)
390
+ #u.get_lon_lat_coord.each{|x| p x}
391
+ #u.get_lon_lat_coord(true).each{|x| p x}
182
392
  end