gphys 1.1.1a
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +1777 -0
- data/LICENSE.txt +34 -0
- data/README +33 -0
- data/Rakefile +57 -0
- data/TODO_ep_flux +6 -0
- data/bin/gdir_client +27 -0
- data/bin/gdir_server +129 -0
- data/bin/gpaop +146 -0
- data/bin/gpcat +148 -0
- data/bin/gpcut +102 -0
- data/bin/gpedit +228 -0
- data/bin/gplist +68 -0
- data/bin/gpmath +120 -0
- data/bin/gpmaxmin +128 -0
- data/bin/gpprint +60 -0
- data/bin/gpvect +706 -0
- data/bin/gpview +704 -0
- data/bin/grads2nc_with_gphys +61 -0
- data/doc/attribute.html +19 -0
- data/doc/attributenetcdf.html +15 -0
- data/doc/axis.html +376 -0
- data/doc/coordmapping.html +111 -0
- data/doc/coordtransform.html +36 -0
- data/doc/derivative/gphys-derivative.html +80 -0
- data/doc/derivative/index.html +21 -0
- data/doc/derivative/index.rd +14 -0
- data/doc/derivative/math-doc/document/document.css +30 -0
- data/doc/derivative/math-doc/document/document.html +57 -0
- data/doc/derivative/math-doc/document/images.aux +1 -0
- data/doc/derivative/math-doc/document/images.log +385 -0
- data/doc/derivative/math-doc/document/images.pl +186 -0
- data/doc/derivative/math-doc/document/images.tex +364 -0
- data/doc/derivative/math-doc/document/img1.png +0 -0
- data/doc/derivative/math-doc/document/img10.png +0 -0
- data/doc/derivative/math-doc/document/img11.png +0 -0
- data/doc/derivative/math-doc/document/img12.png +0 -0
- data/doc/derivative/math-doc/document/img13.png +0 -0
- data/doc/derivative/math-doc/document/img14.png +0 -0
- data/doc/derivative/math-doc/document/img15.png +0 -0
- data/doc/derivative/math-doc/document/img16.png +0 -0
- data/doc/derivative/math-doc/document/img17.png +0 -0
- data/doc/derivative/math-doc/document/img18.png +0 -0
- data/doc/derivative/math-doc/document/img19.png +0 -0
- data/doc/derivative/math-doc/document/img2.png +0 -0
- data/doc/derivative/math-doc/document/img20.png +0 -0
- data/doc/derivative/math-doc/document/img21.png +0 -0
- data/doc/derivative/math-doc/document/img22.png +0 -0
- data/doc/derivative/math-doc/document/img23.png +0 -0
- data/doc/derivative/math-doc/document/img24.png +0 -0
- data/doc/derivative/math-doc/document/img25.png +0 -0
- data/doc/derivative/math-doc/document/img26.png +0 -0
- data/doc/derivative/math-doc/document/img27.png +0 -0
- data/doc/derivative/math-doc/document/img28.png +0 -0
- data/doc/derivative/math-doc/document/img29.png +0 -0
- data/doc/derivative/math-doc/document/img3.png +0 -0
- data/doc/derivative/math-doc/document/img30.png +0 -0
- data/doc/derivative/math-doc/document/img4.png +0 -0
- data/doc/derivative/math-doc/document/img5.png +0 -0
- data/doc/derivative/math-doc/document/img6.png +0 -0
- data/doc/derivative/math-doc/document/img7.png +0 -0
- data/doc/derivative/math-doc/document/img8.png +0 -0
- data/doc/derivative/math-doc/document/img9.png +0 -0
- data/doc/derivative/math-doc/document/index.html +57 -0
- data/doc/derivative/math-doc/document/labels.pl +13 -0
- data/doc/derivative/math-doc/document/next.png +0 -0
- data/doc/derivative/math-doc/document/next_g.png +0 -0
- data/doc/derivative/math-doc/document/node1.html +238 -0
- data/doc/derivative/math-doc/document/node2.html +75 -0
- data/doc/derivative/math-doc/document/prev.png +0 -0
- data/doc/derivative/math-doc/document/prev_g.png +0 -0
- data/doc/derivative/math-doc/document/up.png +0 -0
- data/doc/derivative/math-doc/document/up_g.png +0 -0
- data/doc/derivative/math-doc/document.pdf +0 -0
- data/doc/derivative/math-doc/document.tex +158 -0
- data/doc/derivative/numru-derivative.html +129 -0
- data/doc/ep_flux/ep_flux.html +469 -0
- data/doc/ep_flux/ggraph_on_merdional_section.html +71 -0
- data/doc/ep_flux/index.html +31 -0
- data/doc/ep_flux/index.rd +24 -0
- data/doc/ep_flux/math-doc/document/WARNINGS +1 -0
- data/doc/ep_flux/math-doc/document/contents.png +0 -0
- data/doc/ep_flux/math-doc/document/crossref.png +0 -0
- data/doc/ep_flux/math-doc/document/document.css +30 -0
- data/doc/ep_flux/math-doc/document/document.html +101 -0
- data/doc/ep_flux/math-doc/document/images.aux +1 -0
- data/doc/ep_flux/math-doc/document/images.log +1375 -0
- data/doc/ep_flux/math-doc/document/images.pl +1328 -0
- data/doc/ep_flux/math-doc/document/images.tex +1471 -0
- data/doc/ep_flux/math-doc/document/img1.png +0 -0
- data/doc/ep_flux/math-doc/document/img10.png +0 -0
- data/doc/ep_flux/math-doc/document/img100.png +0 -0
- data/doc/ep_flux/math-doc/document/img101.png +0 -0
- data/doc/ep_flux/math-doc/document/img102.png +0 -0
- data/doc/ep_flux/math-doc/document/img103.png +0 -0
- data/doc/ep_flux/math-doc/document/img104.png +0 -0
- data/doc/ep_flux/math-doc/document/img105.png +0 -0
- data/doc/ep_flux/math-doc/document/img106.png +0 -0
- data/doc/ep_flux/math-doc/document/img107.png +0 -0
- data/doc/ep_flux/math-doc/document/img108.png +0 -0
- data/doc/ep_flux/math-doc/document/img109.png +0 -0
- data/doc/ep_flux/math-doc/document/img11.png +0 -0
- data/doc/ep_flux/math-doc/document/img110.png +0 -0
- data/doc/ep_flux/math-doc/document/img111.png +0 -0
- data/doc/ep_flux/math-doc/document/img112.png +0 -0
- data/doc/ep_flux/math-doc/document/img113.png +0 -0
- data/doc/ep_flux/math-doc/document/img114.png +0 -0
- data/doc/ep_flux/math-doc/document/img115.png +0 -0
- data/doc/ep_flux/math-doc/document/img116.png +0 -0
- data/doc/ep_flux/math-doc/document/img117.png +0 -0
- data/doc/ep_flux/math-doc/document/img118.png +0 -0
- data/doc/ep_flux/math-doc/document/img119.png +0 -0
- data/doc/ep_flux/math-doc/document/img12.png +0 -0
- data/doc/ep_flux/math-doc/document/img120.png +0 -0
- data/doc/ep_flux/math-doc/document/img121.png +0 -0
- data/doc/ep_flux/math-doc/document/img122.png +0 -0
- data/doc/ep_flux/math-doc/document/img123.png +0 -0
- data/doc/ep_flux/math-doc/document/img124.png +0 -0
- data/doc/ep_flux/math-doc/document/img125.png +0 -0
- data/doc/ep_flux/math-doc/document/img126.png +0 -0
- data/doc/ep_flux/math-doc/document/img127.png +0 -0
- data/doc/ep_flux/math-doc/document/img128.png +0 -0
- data/doc/ep_flux/math-doc/document/img129.png +0 -0
- data/doc/ep_flux/math-doc/document/img13.png +0 -0
- data/doc/ep_flux/math-doc/document/img130.png +0 -0
- data/doc/ep_flux/math-doc/document/img131.png +0 -0
- data/doc/ep_flux/math-doc/document/img132.png +0 -0
- data/doc/ep_flux/math-doc/document/img133.png +0 -0
- data/doc/ep_flux/math-doc/document/img134.png +0 -0
- data/doc/ep_flux/math-doc/document/img135.png +0 -0
- data/doc/ep_flux/math-doc/document/img136.png +0 -0
- data/doc/ep_flux/math-doc/document/img137.png +0 -0
- data/doc/ep_flux/math-doc/document/img138.png +0 -0
- data/doc/ep_flux/math-doc/document/img139.png +0 -0
- data/doc/ep_flux/math-doc/document/img14.png +0 -0
- data/doc/ep_flux/math-doc/document/img140.png +0 -0
- data/doc/ep_flux/math-doc/document/img141.png +0 -0
- data/doc/ep_flux/math-doc/document/img142.png +0 -0
- data/doc/ep_flux/math-doc/document/img143.png +0 -0
- data/doc/ep_flux/math-doc/document/img144.png +0 -0
- data/doc/ep_flux/math-doc/document/img145.png +0 -0
- data/doc/ep_flux/math-doc/document/img146.png +0 -0
- data/doc/ep_flux/math-doc/document/img147.png +0 -0
- data/doc/ep_flux/math-doc/document/img148.png +0 -0
- data/doc/ep_flux/math-doc/document/img149.png +0 -0
- data/doc/ep_flux/math-doc/document/img15.png +0 -0
- data/doc/ep_flux/math-doc/document/img150.png +0 -0
- data/doc/ep_flux/math-doc/document/img151.png +0 -0
- data/doc/ep_flux/math-doc/document/img152.png +0 -0
- data/doc/ep_flux/math-doc/document/img153.png +0 -0
- data/doc/ep_flux/math-doc/document/img154.png +0 -0
- data/doc/ep_flux/math-doc/document/img155.png +0 -0
- data/doc/ep_flux/math-doc/document/img156.png +0 -0
- data/doc/ep_flux/math-doc/document/img157.png +0 -0
- data/doc/ep_flux/math-doc/document/img158.png +0 -0
- data/doc/ep_flux/math-doc/document/img159.png +0 -0
- data/doc/ep_flux/math-doc/document/img16.png +0 -0
- data/doc/ep_flux/math-doc/document/img160.png +0 -0
- data/doc/ep_flux/math-doc/document/img161.png +0 -0
- data/doc/ep_flux/math-doc/document/img162.png +0 -0
- data/doc/ep_flux/math-doc/document/img163.png +0 -0
- data/doc/ep_flux/math-doc/document/img164.png +0 -0
- data/doc/ep_flux/math-doc/document/img165.png +0 -0
- data/doc/ep_flux/math-doc/document/img166.png +0 -0
- data/doc/ep_flux/math-doc/document/img167.png +0 -0
- data/doc/ep_flux/math-doc/document/img168.png +0 -0
- data/doc/ep_flux/math-doc/document/img169.png +0 -0
- data/doc/ep_flux/math-doc/document/img17.png +0 -0
- data/doc/ep_flux/math-doc/document/img170.png +0 -0
- data/doc/ep_flux/math-doc/document/img171.png +0 -0
- data/doc/ep_flux/math-doc/document/img172.png +0 -0
- data/doc/ep_flux/math-doc/document/img173.png +0 -0
- data/doc/ep_flux/math-doc/document/img174.png +0 -0
- data/doc/ep_flux/math-doc/document/img175.png +0 -0
- data/doc/ep_flux/math-doc/document/img176.png +0 -0
- data/doc/ep_flux/math-doc/document/img177.png +0 -0
- data/doc/ep_flux/math-doc/document/img178.png +0 -0
- data/doc/ep_flux/math-doc/document/img179.png +0 -0
- data/doc/ep_flux/math-doc/document/img18.png +0 -0
- data/doc/ep_flux/math-doc/document/img180.png +0 -0
- data/doc/ep_flux/math-doc/document/img181.png +0 -0
- data/doc/ep_flux/math-doc/document/img182.png +0 -0
- data/doc/ep_flux/math-doc/document/img183.png +0 -0
- data/doc/ep_flux/math-doc/document/img184.png +0 -0
- data/doc/ep_flux/math-doc/document/img185.png +0 -0
- data/doc/ep_flux/math-doc/document/img186.png +0 -0
- data/doc/ep_flux/math-doc/document/img187.png +0 -0
- data/doc/ep_flux/math-doc/document/img188.png +0 -0
- data/doc/ep_flux/math-doc/document/img189.png +0 -0
- data/doc/ep_flux/math-doc/document/img19.png +0 -0
- data/doc/ep_flux/math-doc/document/img190.png +0 -0
- data/doc/ep_flux/math-doc/document/img191.png +0 -0
- data/doc/ep_flux/math-doc/document/img192.png +0 -0
- data/doc/ep_flux/math-doc/document/img193.png +0 -0
- data/doc/ep_flux/math-doc/document/img194.png +0 -0
- data/doc/ep_flux/math-doc/document/img195.png +0 -0
- data/doc/ep_flux/math-doc/document/img196.png +0 -0
- data/doc/ep_flux/math-doc/document/img197.png +0 -0
- data/doc/ep_flux/math-doc/document/img198.png +0 -0
- data/doc/ep_flux/math-doc/document/img199.png +0 -0
- data/doc/ep_flux/math-doc/document/img2.png +0 -0
- data/doc/ep_flux/math-doc/document/img20.png +0 -0
- data/doc/ep_flux/math-doc/document/img200.png +0 -0
- data/doc/ep_flux/math-doc/document/img21.png +0 -0
- data/doc/ep_flux/math-doc/document/img22.png +0 -0
- data/doc/ep_flux/math-doc/document/img23.png +0 -0
- data/doc/ep_flux/math-doc/document/img24.png +0 -0
- data/doc/ep_flux/math-doc/document/img25.png +0 -0
- data/doc/ep_flux/math-doc/document/img26.png +0 -0
- data/doc/ep_flux/math-doc/document/img27.png +0 -0
- data/doc/ep_flux/math-doc/document/img28.png +0 -0
- data/doc/ep_flux/math-doc/document/img29.png +0 -0
- data/doc/ep_flux/math-doc/document/img3.png +0 -0
- data/doc/ep_flux/math-doc/document/img30.png +0 -0
- data/doc/ep_flux/math-doc/document/img31.png +0 -0
- data/doc/ep_flux/math-doc/document/img32.png +0 -0
- data/doc/ep_flux/math-doc/document/img33.png +0 -0
- data/doc/ep_flux/math-doc/document/img34.png +0 -0
- data/doc/ep_flux/math-doc/document/img35.png +0 -0
- data/doc/ep_flux/math-doc/document/img36.png +0 -0
- data/doc/ep_flux/math-doc/document/img37.png +0 -0
- data/doc/ep_flux/math-doc/document/img38.png +0 -0
- data/doc/ep_flux/math-doc/document/img39.png +0 -0
- data/doc/ep_flux/math-doc/document/img4.png +0 -0
- data/doc/ep_flux/math-doc/document/img40.png +0 -0
- data/doc/ep_flux/math-doc/document/img41.png +0 -0
- data/doc/ep_flux/math-doc/document/img42.png +0 -0
- data/doc/ep_flux/math-doc/document/img43.png +0 -0
- data/doc/ep_flux/math-doc/document/img44.png +0 -0
- data/doc/ep_flux/math-doc/document/img45.png +0 -0
- data/doc/ep_flux/math-doc/document/img46.png +0 -0
- data/doc/ep_flux/math-doc/document/img47.png +0 -0
- data/doc/ep_flux/math-doc/document/img48.png +0 -0
- data/doc/ep_flux/math-doc/document/img49.png +0 -0
- data/doc/ep_flux/math-doc/document/img5.png +0 -0
- data/doc/ep_flux/math-doc/document/img50.png +0 -0
- data/doc/ep_flux/math-doc/document/img51.png +0 -0
- data/doc/ep_flux/math-doc/document/img52.png +0 -0
- data/doc/ep_flux/math-doc/document/img53.png +0 -0
- data/doc/ep_flux/math-doc/document/img54.png +0 -0
- data/doc/ep_flux/math-doc/document/img55.png +0 -0
- data/doc/ep_flux/math-doc/document/img56.png +0 -0
- data/doc/ep_flux/math-doc/document/img57.png +0 -0
- data/doc/ep_flux/math-doc/document/img58.png +0 -0
- data/doc/ep_flux/math-doc/document/img59.png +0 -0
- data/doc/ep_flux/math-doc/document/img6.png +0 -0
- data/doc/ep_flux/math-doc/document/img60.png +0 -0
- data/doc/ep_flux/math-doc/document/img61.png +0 -0
- data/doc/ep_flux/math-doc/document/img62.png +0 -0
- data/doc/ep_flux/math-doc/document/img63.png +0 -0
- data/doc/ep_flux/math-doc/document/img64.png +0 -0
- data/doc/ep_flux/math-doc/document/img65.png +0 -0
- data/doc/ep_flux/math-doc/document/img66.png +0 -0
- data/doc/ep_flux/math-doc/document/img67.png +0 -0
- data/doc/ep_flux/math-doc/document/img68.png +0 -0
- data/doc/ep_flux/math-doc/document/img69.png +0 -0
- data/doc/ep_flux/math-doc/document/img7.png +0 -0
- data/doc/ep_flux/math-doc/document/img70.png +0 -0
- data/doc/ep_flux/math-doc/document/img71.png +0 -0
- data/doc/ep_flux/math-doc/document/img72.png +0 -0
- data/doc/ep_flux/math-doc/document/img73.png +0 -0
- data/doc/ep_flux/math-doc/document/img74.png +0 -0
- data/doc/ep_flux/math-doc/document/img75.png +0 -0
- data/doc/ep_flux/math-doc/document/img76.png +0 -0
- data/doc/ep_flux/math-doc/document/img77.png +0 -0
- data/doc/ep_flux/math-doc/document/img78.png +0 -0
- data/doc/ep_flux/math-doc/document/img79.png +0 -0
- data/doc/ep_flux/math-doc/document/img8.png +0 -0
- data/doc/ep_flux/math-doc/document/img80.png +0 -0
- data/doc/ep_flux/math-doc/document/img81.png +0 -0
- data/doc/ep_flux/math-doc/document/img82.png +0 -0
- data/doc/ep_flux/math-doc/document/img83.png +0 -0
- data/doc/ep_flux/math-doc/document/img84.png +0 -0
- data/doc/ep_flux/math-doc/document/img85.png +0 -0
- data/doc/ep_flux/math-doc/document/img86.png +0 -0
- data/doc/ep_flux/math-doc/document/img87.png +0 -0
- data/doc/ep_flux/math-doc/document/img88.png +0 -0
- data/doc/ep_flux/math-doc/document/img89.png +0 -0
- data/doc/ep_flux/math-doc/document/img9.png +0 -0
- data/doc/ep_flux/math-doc/document/img90.png +0 -0
- data/doc/ep_flux/math-doc/document/img91.png +0 -0
- data/doc/ep_flux/math-doc/document/img92.png +0 -0
- data/doc/ep_flux/math-doc/document/img93.png +0 -0
- data/doc/ep_flux/math-doc/document/img94.png +0 -0
- data/doc/ep_flux/math-doc/document/img95.png +0 -0
- data/doc/ep_flux/math-doc/document/img96.png +0 -0
- data/doc/ep_flux/math-doc/document/img97.png +0 -0
- data/doc/ep_flux/math-doc/document/img98.png +0 -0
- data/doc/ep_flux/math-doc/document/img99.png +0 -0
- data/doc/ep_flux/math-doc/document/index.html +101 -0
- data/doc/ep_flux/math-doc/document/internals.pl +258 -0
- data/doc/ep_flux/math-doc/document/labels.pl +265 -0
- data/doc/ep_flux/math-doc/document/next.png +0 -0
- data/doc/ep_flux/math-doc/document/next_g.png +0 -0
- data/doc/ep_flux/math-doc/document/node1.html +104 -0
- data/doc/ep_flux/math-doc/document/node10.html +164 -0
- data/doc/ep_flux/math-doc/document/node11.html +86 -0
- data/doc/ep_flux/math-doc/document/node12.html +166 -0
- data/doc/ep_flux/math-doc/document/node13.html +897 -0
- data/doc/ep_flux/math-doc/document/node14.html +1065 -0
- data/doc/ep_flux/math-doc/document/node15.html +72 -0
- data/doc/ep_flux/math-doc/document/node16.html +81 -0
- data/doc/ep_flux/math-doc/document/node2.html +82 -0
- data/doc/ep_flux/math-doc/document/node3.html +91 -0
- data/doc/ep_flux/math-doc/document/node4.html +149 -0
- data/doc/ep_flux/math-doc/document/node5.html +330 -0
- data/doc/ep_flux/math-doc/document/node6.html +99 -0
- data/doc/ep_flux/math-doc/document/node7.html +98 -0
- data/doc/ep_flux/math-doc/document/node8.html +83 -0
- data/doc/ep_flux/math-doc/document/node9.html +140 -0
- data/doc/ep_flux/math-doc/document/prev.png +0 -0
- data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
- data/doc/ep_flux/math-doc/document/up.png +0 -0
- data/doc/ep_flux/math-doc/document/up_g.png +0 -0
- data/doc/ep_flux/math-doc/document.pdf +0 -0
- data/doc/ep_flux/math-doc/document.tex +2018 -0
- data/doc/gdir.html +412 -0
- data/doc/gdir_client.html +16 -0
- data/doc/gdir_connect_ftp-like.html +61 -0
- data/doc/gdir_server.html +45 -0
- data/doc/ggraph.html +1615 -0
- data/doc/gpcat.html +44 -0
- data/doc/gpcut.html +41 -0
- data/doc/gphys.html +532 -0
- data/doc/gphys_fft.html +324 -0
- data/doc/gphys_grads_io.html +69 -0
- data/doc/gphys_grib_io.html +82 -0
- data/doc/gphys_io.html +120 -0
- data/doc/gphys_io_common.html +18 -0
- data/doc/gphys_netcdf_io.html +283 -0
- data/doc/gplist.html +24 -0
- data/doc/gpmath.html +51 -0
- data/doc/gpmaxmin.html +31 -0
- data/doc/gpprint.html +34 -0
- data/doc/gpview.html +270 -0
- data/doc/grads2nc_with_gphys.html +21 -0
- data/doc/grads_gridded.html +307 -0
- data/doc/grib.html +144 -0
- data/doc/grid.html +212 -0
- data/doc/index.html +133 -0
- data/doc/index.rd +127 -0
- data/doc/netcdf_convention.html +136 -0
- data/doc/unumeric.html +176 -0
- data/doc/update +64 -0
- data/doc/varray.html +299 -0
- data/doc/varraycomposite.html +67 -0
- data/ext_coord.c +209 -0
- data/ext_init.c +7 -0
- data/extconf.rb +42 -0
- data/install.rb +130 -0
- data/interpo.c +497 -0
- data/lib/numru/dcl_mouse.rb +71 -0
- data/lib/numru/dclext_datetime_ax.rb +220 -0
- data/lib/numru/derivative.rb +348 -0
- data/lib/numru/ganalysis/covariance.rb +154 -0
- data/lib/numru/ganalysis/eof.rb +298 -0
- data/lib/numru/ganalysis/histogram.rb +252 -0
- data/lib/numru/ganalysis/met.rb +317 -0
- data/lib/numru/ganalysis/planet.rb +182 -0
- data/lib/numru/ganalysis.rb +7 -0
- data/lib/numru/gdir.rb +1038 -0
- data/lib/numru/gdir_connect_ftp-like.rb +149 -0
- data/lib/numru/ggraph.rb +5838 -0
- data/lib/numru/ggraph_on_merdional_section.rb +178 -0
- data/lib/numru/gphys/assoccoords.rb +359 -0
- data/lib/numru/gphys/attribute.rb +129 -0
- data/lib/numru/gphys/attributenetcdf.rb +80 -0
- data/lib/numru/gphys/axis.rb +963 -0
- data/lib/numru/gphys/coordmapping.rb +286 -0
- data/lib/numru/gphys/coordtransform.rb +209 -0
- data/lib/numru/gphys/derivative.rb +314 -0
- data/lib/numru/gphys/ep_flux.rb +868 -0
- data/lib/numru/gphys/gpcommon.rb +52 -0
- data/lib/numru/gphys/gphys.rb +1207 -0
- data/lib/numru/gphys/gphys_fft.rb +886 -0
- data/lib/numru/gphys/gphys_grads_io.rb +212 -0
- data/lib/numru/gphys/gphys_grib_io.rb +214 -0
- data/lib/numru/gphys/gphys_gtool3_io.rb +162 -0
- data/lib/numru/gphys/gphys_hdfeos5_io.rb +672 -0
- data/lib/numru/gphys/gphys_io.rb +452 -0
- data/lib/numru/gphys/gphys_io_common.rb +126 -0
- data/lib/numru/gphys/gphys_netcdf_io.rb +800 -0
- data/lib/numru/gphys/gphys_nusdas_io.rb +132 -0
- data/lib/numru/gphys/grads_gridded.rb +1638 -0
- data/lib/numru/gphys/grib.rb +2049 -0
- data/lib/numru/gphys/grib_params.rb +1465 -0
- data/lib/numru/gphys/grid.rb +723 -0
- data/lib/numru/gphys/gtool3.rb +771 -0
- data/lib/numru/gphys/interpolate.rb +854 -0
- data/lib/numru/gphys/narray_ext.rb +34 -0
- data/lib/numru/gphys/netcdf_convention.rb +406 -0
- data/lib/numru/gphys/subsetmapping.rb +332 -0
- data/lib/numru/gphys/unumeric.rb +522 -0
- data/lib/numru/gphys/varray.rb +1109 -0
- data/lib/numru/gphys/varraycomposite.rb +415 -0
- data/lib/numru/gphys/varraygrads.rb +225 -0
- data/lib/numru/gphys/varraygrib.rb +177 -0
- data/lib/numru/gphys/varraygtool3.rb +226 -0
- data/lib/numru/gphys/varrayhdfeos5.rb +451 -0
- data/lib/numru/gphys/varraynetcdf.rb +350 -0
- data/lib/numru/gphys/varraynusdas.rb +59 -0
- data/lib/numru/gphys.rb +9 -0
- data/lib/numru/htdir.rb +170 -0
- data/multibitIO.c +567 -0
- data/sample/cira86_to_nc.rb +122 -0
- data/sample/druby_cli1.rb +21 -0
- data/sample/druby_cli2.rb +34 -0
- data/sample/druby_serv1.rb +30 -0
- data/sample/druby_serv2.rb +64 -0
- data/sample/ep_flux/demo_NCEP_1.rb +48 -0
- data/sample/ep_flux/demo_NCEP_2.rb +57 -0
- data/sample/ep_flux/demo_NCEP_3.rb +81 -0
- data/sample/ggraph_latlon_labelling_dr002690.rb +159 -0
- data/sample/ggraph_mapfit-axes_dr002687.rb +131 -0
- data/sample/map_projection.rb +121 -0
- data/sample/ncep_theta_coord.rb +79 -0
- data/test/eof_slp.rb +28 -0
- data/test/mltbit.dat +0 -0
- data/test/test_ep_flux.rb +533 -0
- data/test/test_multibitIO.rb +19 -0
- data/testdata/T.jan.ctl +12 -0
- data/testdata/T.jan.dat +0 -0
- data/testdata/T.jan.grib +0 -0
- data/testdata/T.jan.nc +0 -0
- data/testdata/T.jan.packed.withmiss.nc +0 -0
- data/testdata/UV.jan.nc +0 -0
- data/testdata/assoc_crds.nc +0 -0
- data/testdata/cira86.dat +1332 -0
- metadata +621 -0
data/bin/gpedit
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
= NAME
|
4
|
+
|
5
|
+
:gpedit:
|
6
|
+
Create or overwrite the attributes of a variable specified by
|
7
|
+
a gtool4-type URL (Only netCDF files are supported).
|
8
|
+
|
9
|
+
= USAGE
|
10
|
+
|
11
|
+
% gpedit [options] path@[varname:var_attr=...][varname|+global_attr]
|
12
|
+
|
13
|
+
= EXAMPLES
|
14
|
+
|
15
|
+
* Add
|
16
|
+
% gpedit data.nc@temp:units=W/m
|
17
|
+
% gpedit -a data.nc@temp:missing_value=-2.0e20
|
18
|
+
% gpedit --add data.nc@temp+title=\"surface temperature\"
|
19
|
+
|
20
|
+
* Delete
|
21
|
+
% gpedit -d data.nc@lon:topology
|
22
|
+
% gpedit --delete data.nc@lon+Conventions
|
23
|
+
"
|
24
|
+
= HISTORY
|
25
|
+
|
26
|
+
2010/03/10 Y SASAKI (change help block into RD format)
|
27
|
+
2007/07/18 Y. Morikawa 'gpattr' is renamed to 'gpedit'
|
28
|
+
2006/09/29 Y. Morikawa A value looks like numeric is treated as a numerical value
|
29
|
+
2005/01/09 Y. Morikawa
|
30
|
+
2005/01/07 D. Tsukahara
|
31
|
+
|
32
|
+
|
33
|
+
=end
|
34
|
+
##################################################
|
35
|
+
#= gpedit
|
36
|
+
#== SYNOPSIS
|
37
|
+
SYNOPSIS = <<-"SYNOP"
|
38
|
+
Create or overwrite the attributes of a variable specified by
|
39
|
+
a gtool4-type URL (Only netCDF files are supported).
|
40
|
+
SYNOP
|
41
|
+
|
42
|
+
#== HISTORY
|
43
|
+
#
|
44
|
+
# 2010/03/10 Y SASAKI (change help block into RD format)
|
45
|
+
# 2007/07/18 Y. Morikawa 'gpattr' is renamed to 'gpedit'
|
46
|
+
# 2006/09/29 Y. Morikawa A value looks like numeric is treated as a numerical value
|
47
|
+
# 2005/01/09 Y. Morikawa
|
48
|
+
# 2005/01/07 D. Tsukahara
|
49
|
+
#
|
50
|
+
#==USAGE
|
51
|
+
URLFMT = "path@[varname:var_attr=...][varname|+global_attr]"
|
52
|
+
USAGE = "
|
53
|
+
% #{File.basename(__FILE__)} [options] url
|
54
|
+
|
55
|
+
where the format of the url is
|
56
|
+
|
57
|
+
#{URLFMT}
|
58
|
+
"
|
59
|
+
#==EXAMPLES
|
60
|
+
EXAMPLES = "
|
61
|
+
* Add
|
62
|
+
% #{File.basename(__FILE__)} data.nc@temp:units=W/m
|
63
|
+
% #{File.basename(__FILE__)} -a data.nc@temp:missing_value=-2.0e20
|
64
|
+
% #{File.basename(__FILE__)} --add data.nc@temp+title=\"surface temperature\"
|
65
|
+
|
66
|
+
* Delete
|
67
|
+
% #{File.basename(__FILE__)} -d data.nc@lon:topology
|
68
|
+
% #{File.basename(__FILE__)} --delete data.nc@lon+Conventions
|
69
|
+
"
|
70
|
+
#
|
71
|
+
##################################################
|
72
|
+
require "optparse"
|
73
|
+
require "numru/netcdf"
|
74
|
+
include NumRu
|
75
|
+
|
76
|
+
opt = OptionParser.new
|
77
|
+
OPTS = {}
|
78
|
+
ARGV.options{|opt|
|
79
|
+
|
80
|
+
opt.summary_width = 23
|
81
|
+
opt.summary_indent = ' '*6
|
82
|
+
|
83
|
+
opt.on( '-a', '--add',
|
84
|
+
"Add attribute (default)."
|
85
|
+
){|v| OPTS[:add] = v}
|
86
|
+
|
87
|
+
opt.on( '-d', '--delete',
|
88
|
+
"Delete attribute."
|
89
|
+
){|v| OPTS[:delete] = v}
|
90
|
+
|
91
|
+
opt.on_tail('-h', '-H', '--help',
|
92
|
+
"Show this help message.\n"
|
93
|
+
){|v| OPTS[:help] = v}
|
94
|
+
|
95
|
+
opt.parse!
|
96
|
+
}
|
97
|
+
|
98
|
+
## help
|
99
|
+
def help(opt)
|
100
|
+
print <<-"EOF"
|
101
|
+
|
102
|
+
#{File.basename(__FILE__)}:
|
103
|
+
#{SYNOPSIS}
|
104
|
+
USAGE: #{USAGE}
|
105
|
+
OPTION: \n#{opt.to_a[1..-1].join("")}
|
106
|
+
EXAMPLES:
|
107
|
+
#{EXAMPLES}
|
108
|
+
EOF
|
109
|
+
end
|
110
|
+
private :help
|
111
|
+
|
112
|
+
|
113
|
+
#####################################################
|
114
|
+
|
115
|
+
def to_appropriate_type(str)
|
116
|
+
if str =~ /\.|e/i
|
117
|
+
val = str.to_f
|
118
|
+
else
|
119
|
+
val = str.to_i
|
120
|
+
end
|
121
|
+
if val.to_i == 0
|
122
|
+
unless str =~ /^0+((\.0+)?(e\d+)?)?$/i
|
123
|
+
val = str
|
124
|
+
end
|
125
|
+
end
|
126
|
+
return val
|
127
|
+
end
|
128
|
+
|
129
|
+
def url_error(msg)
|
130
|
+
$stderr.print <<-"EOF"
|
131
|
+
|
132
|
+
Error: invalid URL: #{msg}.
|
133
|
+
Current URL format is
|
134
|
+
|
135
|
+
#{URLFMT}
|
136
|
+
|
137
|
+
EOF
|
138
|
+
exit 1
|
139
|
+
end
|
140
|
+
|
141
|
+
def parse_gturl_for_attr(gturl)
|
142
|
+
if /(.*)@(.*)/ =~ gturl
|
143
|
+
file = $1
|
144
|
+
var = $2
|
145
|
+
else
|
146
|
+
url_error "'@' between path & variable is not found"
|
147
|
+
end
|
148
|
+
if /(.*):(.*)/ =~ var
|
149
|
+
var_name = var.split(":")[0]
|
150
|
+
att = var.split(":")[1]
|
151
|
+
if /(.*)\=(.*)/ =~ att
|
152
|
+
var_att = att.split("=")[0]
|
153
|
+
global_att = nil
|
154
|
+
att_val = to_appropriate_type(var.split("=")[1])
|
155
|
+
elsif OPTS[:delete]
|
156
|
+
var_att = att
|
157
|
+
global_att = nil
|
158
|
+
att_val = nil
|
159
|
+
else
|
160
|
+
url_error "'=' between atribute name & value is not found"
|
161
|
+
end
|
162
|
+
elsif /(.*)\+(.*)/ =~ var
|
163
|
+
var_name = var.split("+")[0]
|
164
|
+
att = var.split("+")[1]
|
165
|
+
if /(.*)\=(.*)/ =~ att
|
166
|
+
var_att = nil
|
167
|
+
global_att = att.split("=")[0]
|
168
|
+
att_val = to_appropriate_type(att.split("=")[1])
|
169
|
+
elsif OPTS[:delete]
|
170
|
+
var_att = nil
|
171
|
+
global_att = att
|
172
|
+
att_val = nil
|
173
|
+
else
|
174
|
+
url_error "'=' between atribute name & value is not found"
|
175
|
+
end
|
176
|
+
else
|
177
|
+
url_error "':' or '+' between atribute name & value is not found"
|
178
|
+
end
|
179
|
+
if !(att_val) && !OPTS[:delete]
|
180
|
+
url_error "attribute value is not found. you must point out unless delete attribute"
|
181
|
+
end
|
182
|
+
[file, var_name, var_att, global_att, att_val]
|
183
|
+
end
|
184
|
+
#####################################################
|
185
|
+
|
186
|
+
if OPTS[:help] || ARGV.length != 1 then
|
187
|
+
help(opt)
|
188
|
+
exit
|
189
|
+
end
|
190
|
+
|
191
|
+
gturl = ARGV[0]
|
192
|
+
file, var, var_att, global_att, att_val = parse_gturl_for_attr(gturl)
|
193
|
+
|
194
|
+
begin
|
195
|
+
nc = NetCDF.new(file, "r")
|
196
|
+
nc.close
|
197
|
+
rescue NetcdfSyserr
|
198
|
+
$stderr.print " Error: " + file + ": " + $!.to_s + "\n"
|
199
|
+
exit 1
|
200
|
+
rescue NetcdfNotnc
|
201
|
+
$stderr.print " Error: " + file + ": " + $!.to_s + "\n"
|
202
|
+
$stderr.print " \"#{File.basename(__FILE__)}\" supports only netCDF files.\n"
|
203
|
+
exit 1
|
204
|
+
end
|
205
|
+
|
206
|
+
nc = NetCDF.new(file, "a+")
|
207
|
+
if nc.var(var)
|
208
|
+
var = nc.var(var)
|
209
|
+
elsif nc.dim(var)
|
210
|
+
var = nc.dim(var)
|
211
|
+
end
|
212
|
+
nc.redef
|
213
|
+
if var.class.to_s == "String"
|
214
|
+
$stderr.print " Error: #{file}@#{var}: variable is not found.\n"
|
215
|
+
exit 1
|
216
|
+
end
|
217
|
+
if OPTS[:delete]
|
218
|
+
begin
|
219
|
+
nc.att(global_att).delete if global_att
|
220
|
+
var.att(var_att).delete if var_att
|
221
|
+
rescue NoMethodError
|
222
|
+
print " Warning: " + gturl + " is not exist.\n"
|
223
|
+
end
|
224
|
+
else
|
225
|
+
nc.put_att(global_att, att_val) if global_att
|
226
|
+
var.put_att(var_att, att_val) if var_att
|
227
|
+
end
|
228
|
+
nc.close
|
data/bin/gplist
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
= NAME
|
4
|
+
|
5
|
+
gplist - print out info on GPhys-compatible variables in specified files.
|
6
|
+
|
7
|
+
= Usage
|
8
|
+
|
9
|
+
% gplist [-h] [ FILES... ]
|
10
|
+
|
11
|
+
where FILES are plane files (NetCDF, grib, GrADS control..) or directories.
|
12
|
+
If omitted, equivalent to specifing the current directory.
|
13
|
+
|
14
|
+
= HISTORY
|
15
|
+
|
16
|
+
2005/05/15 S Takehiro (created)
|
17
|
+
2005/06/21 T Horinouchi (modified to use GDir (non-recursive version))
|
18
|
+
2005/08/10 S Takehiro (utilize internal function for printing help message)
|
19
|
+
2005/08/23 S Takehiro (common methods to gp* command moved to gpcommon.rb)
|
20
|
+
2010/03/10 Y SASAKI (change help block into RD format)
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require "numru/gphys"
|
25
|
+
require "numru/gphys/gpcommon"
|
26
|
+
include NumRu
|
27
|
+
|
28
|
+
require "getoptlong"
|
29
|
+
|
30
|
+
#---------------------- Option Configuration ----------------------
|
31
|
+
parser = GetoptLong.new(
|
32
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT ])
|
33
|
+
|
34
|
+
begin
|
35
|
+
parser.each do |opt, arg|
|
36
|
+
case opt
|
37
|
+
when "--help"
|
38
|
+
help
|
39
|
+
exit(0)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
rescue
|
43
|
+
raise "\n\n"+usage
|
44
|
+
end
|
45
|
+
|
46
|
+
#------------------------ Do the job ------------------------
|
47
|
+
GDir.top='/'
|
48
|
+
|
49
|
+
if ARGV.length==0
|
50
|
+
paths = ['.']
|
51
|
+
else
|
52
|
+
paths = ARGV
|
53
|
+
end
|
54
|
+
|
55
|
+
paths.each do |path|
|
56
|
+
print path,":\n"
|
57
|
+
gdir = GDir.new(File.expand_path(path))
|
58
|
+
# for a plane file:
|
59
|
+
gdir.list_data_v.each{|s| print " #{s}\n"}
|
60
|
+
# for a directory:
|
61
|
+
gdir.list_dirs.each do |sub|
|
62
|
+
lsv = gdir.dir(sub).list_data_v
|
63
|
+
if lsv.length>0
|
64
|
+
print( (ARGV.length!=0 ? "#{path.sub(/\/+$/,'')}/" : ""), sub, ":\n")
|
65
|
+
lsv.each{|s| print " #{s}\n"}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/bin/gpmath
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
= NAME
|
4
|
+
|
5
|
+
gpmath - operating a mathematical function to a GPhys variable.
|
6
|
+
|
7
|
+
= USAGE
|
8
|
+
|
9
|
+
% gpmath [options] path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
|
10
|
+
|
11
|
+
= OPTIONS
|
12
|
+
|
13
|
+
:-h,--help
|
14
|
+
print this message.
|
15
|
+
:-f func, --function func
|
16
|
+
function name to operate (optional).
|
17
|
+
Default function name is $0[2..-1].
|
18
|
+
:-n name, --name name
|
19
|
+
name of the output gphys variable (optional).
|
20
|
+
:-l name, --longname name
|
21
|
+
long_name attr. of the output gphys variable (optional).
|
22
|
+
:-o file, --output file
|
23
|
+
output filename (optional). Default output filename is 'gphys.nc'.
|
24
|
+
|
25
|
+
* Commands which operates mathematical functions to a gphys variable are
|
26
|
+
successively installed by linking this sciript as a "gp+[math. func. name]".
|
27
|
+
|
28
|
+
= HISTORY
|
29
|
+
|
30
|
+
2005/06/21 S Takehiro (created)
|
31
|
+
2005/07/15 S Takehiro (open_gturl method is used for opening gphys variable)
|
32
|
+
2005/08/10 S Takehiro (utilize internal function for printing help message)
|
33
|
+
2005/08/21 S Takehiro (global attributes copied to the output file)
|
34
|
+
2005/08/23 S Takehiro (common methods to gp* command moved to gpcommon.rb)
|
35
|
+
2010/03/10 Y SASAKI (change help block into RD format)
|
36
|
+
|
37
|
+
=end
|
38
|
+
|
39
|
+
require "numru/gphys"
|
40
|
+
require "numru/gphys/gpcommon"
|
41
|
+
include NumRu
|
42
|
+
|
43
|
+
require "getoptlong"
|
44
|
+
|
45
|
+
#------------------------ Default Settings ------------------------
|
46
|
+
Output_default = 'gphys.nc'
|
47
|
+
URLfmt = "path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]"
|
48
|
+
|
49
|
+
#---------------------- Option Configuration ----------------------
|
50
|
+
parser = GetoptLong.new(
|
51
|
+
["--output", "-o", GetoptLong::REQUIRED_ARGUMENT],
|
52
|
+
["--function", "-f", GetoptLong::REQUIRED_ARGUMENT],
|
53
|
+
["--name", "-n", GetoptLong::REQUIRED_ARGUMENT],
|
54
|
+
["--longname", "-l", GetoptLong::REQUIRED_ARGUMENT],
|
55
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT ])
|
56
|
+
begin
|
57
|
+
parser.each{|opt, arg|
|
58
|
+
case opt
|
59
|
+
when "--output" then eval "$OPT_output='#{arg}'"
|
60
|
+
when "--function" then eval "$OPT_function='#{arg}'"
|
61
|
+
when "--name" then eval "$OPT_name='#{arg}'"
|
62
|
+
when "--longname" then eval "$OPT_longname='#{arg}'"
|
63
|
+
when "--help" then eval "$OPT_help=true"
|
64
|
+
else
|
65
|
+
raise "must not happen"
|
66
|
+
end
|
67
|
+
}
|
68
|
+
rescue GetoptLong::AmbigousOption, GetoptLong::InvalidOption,
|
69
|
+
GetoptLong::MissingArgument,
|
70
|
+
GetoptLong::NeedlessArgument => err
|
71
|
+
help
|
72
|
+
$srderr.puts err.message
|
73
|
+
exit 1
|
74
|
+
end
|
75
|
+
|
76
|
+
#------------------------ Help message ------------------------
|
77
|
+
if $OPT_help then
|
78
|
+
help
|
79
|
+
exit(0)
|
80
|
+
end
|
81
|
+
|
82
|
+
#------------------------ Option check ------------------------
|
83
|
+
$OPT_output = Output_default unless $OPT_output
|
84
|
+
|
85
|
+
#------------------------ Output file check --------------------------
|
86
|
+
raise "#{$OPT_output} already exists." if FileTest.exist?($OPT_output)
|
87
|
+
outncfile=NetCDF.create($OPT_output)
|
88
|
+
|
89
|
+
#------------------------ Open gphys variable ------------------------
|
90
|
+
gturl = ARGV[0]
|
91
|
+
gphys = GPhys::IO.open_gturl(gturl)
|
92
|
+
outncfile.copy_global_att(gphys) # Copy global attributes (only for NetCDF)
|
93
|
+
|
94
|
+
#--------------------- evaluate math function -----------------------
|
95
|
+
$OPT_function = File.basename($0)[2..-1] unless $OPT_function
|
96
|
+
|
97
|
+
eval <<-EOS
|
98
|
+
gphys = gphys.#{$OPT_function}
|
99
|
+
EOS
|
100
|
+
|
101
|
+
#--------------------- rename, set attribute -----------------------
|
102
|
+
if $OPT_name
|
103
|
+
gphys.rename($OPT_name)
|
104
|
+
else
|
105
|
+
gphys.rename($OPT_function+"_"+gphys.name)
|
106
|
+
end
|
107
|
+
|
108
|
+
if $OPT_longname
|
109
|
+
gphys.set_att('long_name',$OPT_longname)
|
110
|
+
else
|
111
|
+
longname=gphys.get_att('long_name')
|
112
|
+
gphys.set_att('long_name',$OPT_function + " of " + longname) if longname
|
113
|
+
end
|
114
|
+
|
115
|
+
#---------------------- Output GPhys variable ------------------------
|
116
|
+
GPhys::IO.write( outncfile, gphys )
|
117
|
+
NetCDF_Conventions.add_history(outncfile, File.basename($0)+" "+ARGV[0])
|
118
|
+
outncfile.close
|
119
|
+
|
120
|
+
print File.basename($0) +": "+ARGV[0]+ " is written to #{$OPT_output}.\n"
|
data/bin/gpmaxmin
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
= NAME
|
4
|
+
|
5
|
+
gpmaxmin - printing maximum and minimum values of a GPhys variable.
|
6
|
+
|
7
|
+
= USAGE
|
8
|
+
|
9
|
+
% gpmaxmin [options] path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
|
10
|
+
|
11
|
+
= OPTIONS
|
12
|
+
|
13
|
+
-h, --help : Print this message.
|
14
|
+
-n, --number : Number of displayed points having max and min values.
|
15
|
+
-a, --all : All points are displayed.
|
16
|
+
-i, --index : Indicies of max and min points are displayed.
|
17
|
+
|
18
|
+
= HISTORY
|
19
|
+
|
20
|
+
2005/05/17 S Takehiro (created)
|
21
|
+
2005/07/15 S Takehiro (open_gturl method is used for opening gphys variable)
|
22
|
+
2005/08/07 S Takehiro (parse_gturl removed)
|
23
|
+
2005/08/10 S Takehiro (locations having max and min values are displayed.
|
24
|
+
utilize internal function for printing help message.
|
25
|
+
--all, --index, --number options added.)
|
26
|
+
2005/08/23 S Takehiro (common methods to gp* command moved to gpcommon.rb)
|
27
|
+
2006/03/07 M Nakano (USAGE Typo fixed)
|
28
|
+
2010/03/10 Y SASAKI (change help block into RD format)
|
29
|
+
|
30
|
+
=end
|
31
|
+
|
32
|
+
require "numru/gphys"
|
33
|
+
require "numru/gphys/gpcommon"
|
34
|
+
include NumRu
|
35
|
+
|
36
|
+
require "getoptlong"
|
37
|
+
|
38
|
+
#------------------------ Default Settings ------------------------
|
39
|
+
URLfmt = "path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]"
|
40
|
+
print_maxdefault=5
|
41
|
+
|
42
|
+
#---------------------- Option Configuration ----------------------
|
43
|
+
parser = GetoptLong.new(
|
44
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT ],
|
45
|
+
["--all", "-a", GetoptLong::NO_ARGUMENT ],
|
46
|
+
["--index", "-i", GetoptLong::NO_ARGUMENT ],
|
47
|
+
["--number", "-n", GetoptLong::REQUIRED_ARGUMENT])
|
48
|
+
begin
|
49
|
+
parser.each{|opt, arg|
|
50
|
+
case opt
|
51
|
+
when "--help" then eval "$OPT_help=true"
|
52
|
+
when "--number" then eval "$OPT_number='#{arg}'"
|
53
|
+
when "--all" then eval "$OPT_all=true"
|
54
|
+
when "--index" then eval "$OPT_index=true"
|
55
|
+
else
|
56
|
+
raise "must not happen"
|
57
|
+
end
|
58
|
+
}
|
59
|
+
rescue GetoptLong::AmbigousOption, GetoptLong::InvalidOption,
|
60
|
+
GetoptLong::MissingArgument,
|
61
|
+
GetoptLong::NeedlessArgument => err
|
62
|
+
help
|
63
|
+
$srderr.puts err.message
|
64
|
+
exit 1
|
65
|
+
end
|
66
|
+
|
67
|
+
#------------------------ Help message ------------------------
|
68
|
+
if ( $OPT_help )
|
69
|
+
help
|
70
|
+
exit(0)
|
71
|
+
end
|
72
|
+
|
73
|
+
#------------------------ Option check ------------------------
|
74
|
+
gturl = ARGV[0]
|
75
|
+
gphys = GPhys::IO.open_gturl(gturl)
|
76
|
+
print_maxnumber = ($OPT_number.to_i||print_maxdefault)
|
77
|
+
|
78
|
+
#-------------------- find max. and min values -----------------------
|
79
|
+
maxval = gphys.val.max # naray-miss class method is implicitly expected
|
80
|
+
minval = gphys.val.min # naray-miss class method is implicitly expected
|
81
|
+
|
82
|
+
idx1ds = gphys.val.eq(maxval).where
|
83
|
+
idxsmax = Array.new
|
84
|
+
idx1ds.each do |idx1d|
|
85
|
+
idxsmax.push(idx=Array.new)
|
86
|
+
gphys.shape.each_with_index{|len,d| idx1d,idx[d] = idx1d.divmod(len)}
|
87
|
+
end
|
88
|
+
|
89
|
+
idx1ds = gphys.val.eq(minval).where
|
90
|
+
idxsmin = Array.new
|
91
|
+
idx1ds.each do |idx1d|
|
92
|
+
idxsmin.push(idx=Array.new)
|
93
|
+
gphys.shape.each_with_index{|len,d| idx1d,idx[d] = idx1d.divmod(len)}
|
94
|
+
end
|
95
|
+
|
96
|
+
#---------------------- Output max and min values ------------------------
|
97
|
+
print_maxnumber = idxsmax.length if ( $OPT_all )
|
98
|
+
|
99
|
+
print gturl+" : max="+maxval.to_s+", at, \n"
|
100
|
+
for i in 0..[print_maxnumber,idxsmax.length].min-1
|
101
|
+
location = Array.new
|
102
|
+
idxsmax[i].each_with_index{|idx,cid|
|
103
|
+
if ($OPT_index)
|
104
|
+
location.push(gphys.coord(cid).name+"=" + idx.to_s)
|
105
|
+
else
|
106
|
+
location.push(gphys.coord(cid).name+"=" + gphys.coord(cid).val[idx].to_s)
|
107
|
+
end
|
108
|
+
}
|
109
|
+
print " "+ (i+1).to_s + " : "+ location.join(", ")+"\n"
|
110
|
+
end
|
111
|
+
print " ...(total "+idxsmax.length.to_s+" points)...\n" if ( print_maxnumber < idxsmax.length )
|
112
|
+
print "\n"
|
113
|
+
|
114
|
+
print_maxnumber = idxsmin.length if ( $OPT_all )
|
115
|
+
|
116
|
+
print gturl+" : min="+minval.to_s+", at, \n"
|
117
|
+
for i in 0..[print_maxnumber,idxsmin.length].min-1
|
118
|
+
location = Array.new
|
119
|
+
idxsmin[i].each_with_index{|idx,cid|
|
120
|
+
if ($OPT_index)
|
121
|
+
location.push(gphys.coord(cid).name+"=" + idx.to_s)
|
122
|
+
else
|
123
|
+
location.push(gphys.coord(cid).name+"=" + gphys.coord(cid).val[idx].to_s)
|
124
|
+
end
|
125
|
+
}
|
126
|
+
print " "+ (i+1).to_s + " : "+ location.join(", ")+"\n"
|
127
|
+
end
|
128
|
+
print " ...(total "+idxsmin.length.to_s+" points)...\n" if ( print_maxnumber < idxsmin.length )
|
data/bin/gpprint
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
##################################################
|
4
|
+
=begin
|
5
|
+
= NAME
|
6
|
+
|
7
|
+
gpprint - a command to print the values of a variable specified by a gtool4-type URL.
|
8
|
+
|
9
|
+
= DESCRIPTION
|
10
|
+
|
11
|
+
((*gpprint*)) is a command-line tool to print the values of a variable
|
12
|
+
specified by a gtool4-type URL. Outputs are comma-separated ascii
|
13
|
+
texts with line feeding to avoid long lines and are made to stdout.
|
14
|
+
|
15
|
+
= USAGE
|
16
|
+
|
17
|
+
% gpprint url
|
18
|
+
|
19
|
+
where the format of the url is
|
20
|
+
|
21
|
+
path@varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
|
22
|
+
|
23
|
+
= EXAMPLES
|
24
|
+
|
25
|
+
% gpprint data.nc@temp
|
26
|
+
% gpprint data.nc@temp,lon=135.0
|
27
|
+
% gpprint data.nc@temp,lon=130:150,lat=0
|
28
|
+
% gpprint data.nc@temp,lon=130:150,lat=0:90:2
|
29
|
+
|
30
|
+
= HISTORY
|
31
|
+
|
32
|
+
2004/12/14 T Horinouchi (created)
|
33
|
+
2005/01/12 T Horinouchi (document -> in rd)
|
34
|
+
2005/06/15 S Takehiro (set first_dim_length 1 when gp.shape[0] returns nil)
|
35
|
+
2005/08/10 S Takehiro (utilize internal function for printing help message)
|
36
|
+
2005/08/23 S Takehiro (common methods to gp* command moved to gpcommon.rb)
|
37
|
+
2010/03/10 Y SASAKI (change help block into RD format)
|
38
|
+
|
39
|
+
=end
|
40
|
+
##################################################
|
41
|
+
|
42
|
+
require "numru/gphys"
|
43
|
+
require "numru/gphys/gpcommon"
|
44
|
+
include NumRu
|
45
|
+
|
46
|
+
#------------------------ print help message ------------------------
|
47
|
+
|
48
|
+
help if ARGV.length != 1 or /^-+h/ =~ ARGV[0]
|
49
|
+
gturl = ARGV[0]
|
50
|
+
gp = GPhys::IO.open_gturl(gturl)
|
51
|
+
|
52
|
+
new_line_int = 6
|
53
|
+
first_dim_len = (gp.shape[0]||1)
|
54
|
+
fmt = " %g,"
|
55
|
+
i = 1
|
56
|
+
gp.val.each do |v|
|
57
|
+
printf(fmt,v)
|
58
|
+
print "\n" if (i % new_line_int) == 0 or (i % first_dim_len) == 0
|
59
|
+
i += 1
|
60
|
+
end
|