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
@@ -0,0 +1,350 @@
|
|
1
|
+
=begin
|
2
|
+
=ToDo list
|
3
|
+
* Support a temporay attribute (@tmp_attr = Attribute.new)
|
4
|
+
=end
|
5
|
+
|
6
|
+
require "numru/netcdf"
|
7
|
+
require "numru/gphys/varray"
|
8
|
+
require "numru/gphys/attributenetcdf"
|
9
|
+
require "numru/gphys/netcdf_convention"
|
10
|
+
|
11
|
+
module NumRu
|
12
|
+
|
13
|
+
###############################
|
14
|
+
|
15
|
+
### /// for write buffering -->
|
16
|
+
|
17
|
+
class NetCDFVar
|
18
|
+
alias current_put put
|
19
|
+
end # class NetCDFVar
|
20
|
+
|
21
|
+
module NetCDFDeferred
|
22
|
+
# To be "extend"ed in a NetCDF object to add simgular methods
|
23
|
+
# to support deferred operations.
|
24
|
+
# Used together with NetCDFVarDeferred.
|
25
|
+
|
26
|
+
def add_deferred(proc,args,length)
|
27
|
+
defined?(@len_stored) ? @len_stored+=length : @len_stored=length
|
28
|
+
@deferred = Array.new if ! defined?(@deferred) || ! @deferred
|
29
|
+
@deferred.push( [proc, args] )
|
30
|
+
end
|
31
|
+
def flush
|
32
|
+
if @deferred
|
33
|
+
@deferred.each{|opr|
|
34
|
+
if ($DEBUG)
|
35
|
+
print "## flushing ## "; p opr
|
36
|
+
end
|
37
|
+
opr[0].call(opr[1])
|
38
|
+
}
|
39
|
+
@deferred = nil
|
40
|
+
NetCDFVarDeferred.flushed_length(@len_stored)
|
41
|
+
@len_stored = 0
|
42
|
+
end
|
43
|
+
end
|
44
|
+
def enddef
|
45
|
+
super
|
46
|
+
flush
|
47
|
+
end
|
48
|
+
def sync
|
49
|
+
if define_mode?
|
50
|
+
enddef
|
51
|
+
super
|
52
|
+
redef
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
57
|
+
def close
|
58
|
+
enddef
|
59
|
+
super
|
60
|
+
end
|
61
|
+
end # module NetCDFDeferred
|
62
|
+
|
63
|
+
#######
|
64
|
+
|
65
|
+
module NetCDFVarDeferred
|
66
|
+
# To be "extend"ed in a NetCDFVar object to add simgular methods
|
67
|
+
# to support deferred operations.
|
68
|
+
# Used together with NetCDFDeferred.
|
69
|
+
|
70
|
+
@@max_len_store = 1000000 # regardress sizeof(type)
|
71
|
+
@@len_stored = 0
|
72
|
+
|
73
|
+
class << self
|
74
|
+
def flushed_length(len)
|
75
|
+
@@len_stored -= len
|
76
|
+
end
|
77
|
+
def max_len_store; max_len_store; end
|
78
|
+
def max_len_store= (l)
|
79
|
+
@@max_len_store = l
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def name=(*args)
|
84
|
+
begin
|
85
|
+
super(*args)
|
86
|
+
rescue
|
87
|
+
file.redef
|
88
|
+
#retry <- this will introduce endless loop
|
89
|
+
super(*args)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def put_att(*args)
|
94
|
+
begin
|
95
|
+
super(*args)
|
96
|
+
rescue
|
97
|
+
file.redef
|
98
|
+
#retry <- this will introduce endless loop
|
99
|
+
super(*args)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def put(*args)
|
104
|
+
if(self.file.define_mode?)
|
105
|
+
if (@@len_stored < @@max_len_store)
|
106
|
+
## put operation is stored in self.file and deferred
|
107
|
+
print "## storing (put) ##\n" if ($DEBUG)
|
108
|
+
len = args[0].is_a?(Numeric) ? 1 : args[0].total
|
109
|
+
self.file.add_deferred( Proc.new{|args| current_put(*args)}, args, len)
|
110
|
+
@@len_stored += len
|
111
|
+
else
|
112
|
+
self.file.enddef
|
113
|
+
current_put(*args)
|
114
|
+
self.file.redef
|
115
|
+
end
|
116
|
+
else
|
117
|
+
self.file.flush
|
118
|
+
current_put(*args)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
### <-- for write buffering ///
|
124
|
+
|
125
|
+
####################################################################
|
126
|
+
|
127
|
+
class VArrayNetCDF < VArray
|
128
|
+
|
129
|
+
## < initialization redefined > ##
|
130
|
+
|
131
|
+
def initialize(aNetCDFVar)
|
132
|
+
@name = aNetCDFVar.name
|
133
|
+
@mapping = nil
|
134
|
+
@varray = nil
|
135
|
+
raise ArgumentError,"Not a NetCDVAr" if ! aNetCDFVar.is_a?(NetCDFVar)
|
136
|
+
@ary = aNetCDFVar
|
137
|
+
@ary.extend(NetCDFVarDeferred)
|
138
|
+
@ary.file.extend(NetCDFDeferred)
|
139
|
+
@attr = AttributeNetCDF.new(aNetCDFVar)
|
140
|
+
@convention = NetCDF_Conventions.find(aNetCDFVar.file)
|
141
|
+
extend( @convention::VArray_Mixin )
|
142
|
+
end
|
143
|
+
|
144
|
+
def inspect
|
145
|
+
"<'#{@name}' in '#{@ary.file.path}' #{@ary.ntype}#{shape_current.inspect}>"
|
146
|
+
end
|
147
|
+
|
148
|
+
class << self
|
149
|
+
## < redefined class methods > ##
|
150
|
+
|
151
|
+
def new2(file, name, ntype, dimensions, vary=nil)
|
152
|
+
dimensions = dimensions.collect{|dim|
|
153
|
+
if dim.is_a?(String)
|
154
|
+
# specification by name is available for existing dimensions
|
155
|
+
file.dim(dim) || raise("dimension "+dim+" is not in "+file.path)
|
156
|
+
else
|
157
|
+
dim
|
158
|
+
end
|
159
|
+
}
|
160
|
+
va = new( file.def_var(name, ntype, dimensions) )
|
161
|
+
if vary
|
162
|
+
vary.att_names.each{|name| va.set_att(name, vary.get_att(name))}
|
163
|
+
end
|
164
|
+
va
|
165
|
+
end
|
166
|
+
|
167
|
+
alias def_var new2
|
168
|
+
|
169
|
+
## < additional class methods > ##
|
170
|
+
|
171
|
+
def write(file, vary, rename=nil, dimnames=nil)
|
172
|
+
raise ArgumentError, "1st arg: not a NetCDF" if !file.is_a?(NetCDF)
|
173
|
+
raise ArgumentError, "2nd arg: not a VArray" if !vary.is_a?(VArray)
|
174
|
+
rank=vary.rank
|
175
|
+
if dimnames == nil
|
176
|
+
if vary.is_a?(VArrayNetCDF)
|
177
|
+
dimnames = vary.dim_names
|
178
|
+
else
|
179
|
+
dimnames=Array.new
|
180
|
+
for i in 0...rank
|
181
|
+
dimnames[i]='x'+i.to_s
|
182
|
+
end
|
183
|
+
end
|
184
|
+
elsif( rank != dimnames.length)
|
185
|
+
raise ArgumentError,
|
186
|
+
"# of dim names does not agree with the rank of the VArray"
|
187
|
+
end
|
188
|
+
fdimnms = file.dim_names
|
189
|
+
begin
|
190
|
+
shape = vary.shape
|
191
|
+
rescue StandardError, NameError
|
192
|
+
shape = vary.shape_ul0
|
193
|
+
end
|
194
|
+
dims = Array.new
|
195
|
+
mode_switched = file.redef
|
196
|
+
for i in 0...rank
|
197
|
+
nm = dimnames[i]
|
198
|
+
if fdimnms.include?(nm)
|
199
|
+
dims[i] = dm = file.dim(nm)
|
200
|
+
if dm.length != shape[i] && shape[i] != 0 && dm.length != 0
|
201
|
+
raise "Length of the dimension #{nm} is #{dims[i].length}, while the #{i}-th dimension of the VArray #{vary.name} is #{shape[i]}"
|
202
|
+
end
|
203
|
+
else
|
204
|
+
dims[i] = file.def_dim(nm,shape[i])
|
205
|
+
end
|
206
|
+
end
|
207
|
+
nm = ( rename || vary.name )
|
208
|
+
val = vary.val
|
209
|
+
newvary = new2(file, nm, vary.typecode, dims, vary)
|
210
|
+
newvary.val = val
|
211
|
+
if mode_switched; file.enddef; end
|
212
|
+
newvary
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
## < redefined instance methods > ##
|
217
|
+
|
218
|
+
def val
|
219
|
+
mode_switched = @ary.file.enddef
|
220
|
+
v = @ary.get
|
221
|
+
if mode_switched; @ary.file.redef; end
|
222
|
+
v
|
223
|
+
end
|
224
|
+
|
225
|
+
def val=(narray)
|
226
|
+
if narray.is_a?(Numeric)
|
227
|
+
@ary.put( narray )
|
228
|
+
else
|
229
|
+
if shape_ul0.include?(0)
|
230
|
+
# has unlimited dimension
|
231
|
+
narray = __check_ary_class(narray)
|
232
|
+
slicer = (0...rank).collect{|i|
|
233
|
+
(shape_ul0[i] != 0) ? true : 0...narray.shape[i]
|
234
|
+
}
|
235
|
+
@ary[*slicer] = narray
|
236
|
+
else
|
237
|
+
@ary.put( __check_ary_class(narray) )
|
238
|
+
end
|
239
|
+
narray
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# It is safer not to have the method "shape" to avoid misconfusion of
|
244
|
+
# shape_ul0 and shape_current:
|
245
|
+
def shape
|
246
|
+
raise "The shape method is not available. Use shape_ul0 or shape_current instead."
|
247
|
+
end
|
248
|
+
|
249
|
+
def name=(nm)
|
250
|
+
@ary.name = nm
|
251
|
+
@name = nm
|
252
|
+
end
|
253
|
+
def rename!(nm)
|
254
|
+
@ary.name = nm
|
255
|
+
@name = nm
|
256
|
+
self
|
257
|
+
end
|
258
|
+
def rename_no_file_change(nm)
|
259
|
+
@name = nm
|
260
|
+
self
|
261
|
+
end
|
262
|
+
def rename(nm)
|
263
|
+
self.dup.rename_no_file_change(nm)
|
264
|
+
end
|
265
|
+
|
266
|
+
def ntype
|
267
|
+
@ary.ntype
|
268
|
+
end
|
269
|
+
|
270
|
+
def total
|
271
|
+
len = 1
|
272
|
+
@ary.shape_current.each{|i| len *= i}
|
273
|
+
len
|
274
|
+
end
|
275
|
+
alias length total
|
276
|
+
|
277
|
+
def rank
|
278
|
+
shape_current.length
|
279
|
+
end
|
280
|
+
|
281
|
+
# def reshape!( *args )
|
282
|
+
# raise "cannot reshape a #{class}. Use copy first to make it a VArray with NArray"
|
283
|
+
# end
|
284
|
+
undef reshape!
|
285
|
+
|
286
|
+
def file
|
287
|
+
@ary.file
|
288
|
+
end
|
289
|
+
|
290
|
+
## < additional instance methods > ##
|
291
|
+
|
292
|
+
def dim_names
|
293
|
+
@ary.dim_names
|
294
|
+
end
|
295
|
+
def shape_ul0
|
296
|
+
@ary.shape_ul0
|
297
|
+
end
|
298
|
+
def shape_current
|
299
|
+
@ary.shape_current
|
300
|
+
end
|
301
|
+
def file
|
302
|
+
@ary.file
|
303
|
+
end
|
304
|
+
|
305
|
+
## Not needed, so far:
|
306
|
+
#def convention
|
307
|
+
# @convention
|
308
|
+
#end
|
309
|
+
|
310
|
+
end # class VArrayNetCDF
|
311
|
+
end # module NumRu
|
312
|
+
|
313
|
+
###########################################################
|
314
|
+
### < test >
|
315
|
+
|
316
|
+
if $0 == __FILE__
|
317
|
+
# $DEBUG = true
|
318
|
+
include NumRu
|
319
|
+
file = NetCDF.create("tmp.nc")
|
320
|
+
dims = [ file.def_dim("x",10), file.def_dim("t",0) ]
|
321
|
+
x = VArrayNetCDF.new2(file,"x","sfloat",dims[0..0])
|
322
|
+
x.set_att("units", "km")
|
323
|
+
x.val = 10
|
324
|
+
v = VArrayNetCDF.new2(file,"v","sfloat",dims)
|
325
|
+
v.set_att("units","m/s")
|
326
|
+
v_ = VArrayNetCDF.new2(file,"v_","sfloat",["x","t"])
|
327
|
+
# file.enddef # (no need to call this)
|
328
|
+
v[0..-1,0] = 99.0
|
329
|
+
v[0..-1,1] = 66.0
|
330
|
+
w = VArrayNetCDF.write(file,v,"w")
|
331
|
+
wsub = w[0..-1,1]
|
332
|
+
wsub.val = 22.0
|
333
|
+
z = VArrayNetCDF.new2(file,"z","sfloat",dims)
|
334
|
+
z.val = NArray.int(10,2).indgen!
|
335
|
+
p w
|
336
|
+
#exit
|
337
|
+
|
338
|
+
file2 = NetCDF.create("tmp2.nc")
|
339
|
+
vv = VArrayNetCDF.write(file2,v,"vv")
|
340
|
+
vv2 = VArrayNetCDF.write(file2,v/3,"vv2")
|
341
|
+
vv3 = VArrayNetCDF.write(file2,v/3,"vv3")
|
342
|
+
v.copy(vv2)
|
343
|
+
(2*v/3).copy(vv3)
|
344
|
+
p "%%%%",(v + w).val,"#####"
|
345
|
+
p v.length
|
346
|
+
p v.file.path
|
347
|
+
p v[0..2,0].file.path
|
348
|
+
file.close
|
349
|
+
file2.close
|
350
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
begin
|
2
|
+
require "numru/nusdas"
|
3
|
+
rescue LoadError
|
4
|
+
end
|
5
|
+
require "numru/gphys/varray"
|
6
|
+
|
7
|
+
module NumRu
|
8
|
+
|
9
|
+
class VArrayNuSDaS < VArray
|
10
|
+
|
11
|
+
def initialize(var)
|
12
|
+
unless NuSDaSVar === var
|
13
|
+
raise ArgumentError, "Not a NuSDaSVar"
|
14
|
+
end
|
15
|
+
@name = var.name
|
16
|
+
@mapping = nil
|
17
|
+
@varray = nil
|
18
|
+
@ary = var
|
19
|
+
@attr = Attribute.new
|
20
|
+
var.att_names.each{|name|
|
21
|
+
@attr[name] = var.att(name)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def inspect
|
26
|
+
"<'#{name}' in '#{@ary.nusdas.root}' [#{@ary.shape.join(", ")}]>"
|
27
|
+
end
|
28
|
+
|
29
|
+
def val
|
30
|
+
@ary.get
|
31
|
+
end
|
32
|
+
|
33
|
+
def shape
|
34
|
+
@ary.shape
|
35
|
+
end
|
36
|
+
alias shape_ul0 shape
|
37
|
+
alias shape_current shape
|
38
|
+
|
39
|
+
def total
|
40
|
+
@ary.total
|
41
|
+
end
|
42
|
+
alias length total
|
43
|
+
|
44
|
+
def rank
|
45
|
+
@ary.rank
|
46
|
+
end
|
47
|
+
|
48
|
+
undef reshape!
|
49
|
+
|
50
|
+
def dim_names
|
51
|
+
@ary.dim_names
|
52
|
+
end
|
53
|
+
|
54
|
+
def file
|
55
|
+
@ary.nusdas
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
data/lib/numru/gphys.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# The root file to load the entire gphys package except GGraph.
|
2
|
+
|
3
|
+
require 'numru/gphys/gphys'
|
4
|
+
require "numru/gphys/gphys_io"
|
5
|
+
require 'numru/gphys/gphys_fft'
|
6
|
+
require 'numru/gphys_ext' # extension library
|
7
|
+
require 'numru/gphys/interpolate'
|
8
|
+
require 'numru/gdir'
|
9
|
+
# require 'numru/gphys/ep_flux' # Made optional. Require it explicitly if needed
|
data/lib/numru/htdir.rb
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
=begin
|
2
|
+
=class NumRu::GDir::HtDir
|
3
|
+
A class to treat the URL of a "directory" as a directory, with a special
|
4
|
+
interpretation for DODS if requested (not by default. You must turn it on
|
5
|
+
explicitly by GDir::HtDir.dods_interpret=true).
|
6
|
+
|
7
|
+
==Class Methods
|
8
|
+
---GDir::HtDir.new(url, proxy=nil)
|
9
|
+
ARGUMENTS
|
10
|
+
url (String) url of a "directory"
|
11
|
+
proxy (String) proxy address and port such as 'proxy.org:8080'
|
12
|
+
---GDir::HtDir.proxy=(proxy)
|
13
|
+
---GDir::HtDir.dods_interpret=(t_or_f)
|
14
|
+
|
15
|
+
==Instance Methods
|
16
|
+
---each
|
17
|
+
Iterator for each "file" in the directory. Arguments
|
18
|
+
of the block will be String (as in Dir#each)
|
19
|
+
---collect
|
20
|
+
---each_dir
|
21
|
+
Like ((<each>)) but limited to iterate over subdirectories.
|
22
|
+
---each_file
|
23
|
+
Like ((<each>)) but limited to iterate over files.
|
24
|
+
---close
|
25
|
+
close the http connection.
|
26
|
+
---rewind
|
27
|
+
Dummy for compatibilty with Dir.
|
28
|
+
---body
|
29
|
+
Body of the http response.
|
30
|
+
=end
|
31
|
+
|
32
|
+
require 'net/http'
|
33
|
+
Net::HTTP.version_1_2
|
34
|
+
|
35
|
+
module NumRu
|
36
|
+
class GDir
|
37
|
+
class HtDir
|
38
|
+
|
39
|
+
Regexp_URL = /^(http:\/\/)?([\w\-\.]+)(:(\d+))?(\/[\w\-\.\/_~]*)?/
|
40
|
+
Regexp_File = /<img.*alt=\"\[(.*)\]\".*href=\"([^\"]+)\"[^>]*>([^<]*)/i
|
41
|
+
File_Type = {'DIR'=>'directory','TXT'=>'text'}
|
42
|
+
|
43
|
+
@@proxy_host = @@proxy_port = nil
|
44
|
+
@@dods_interpret = false
|
45
|
+
|
46
|
+
class << self
|
47
|
+
|
48
|
+
def dods_interpret; @@dods_interpret; end
|
49
|
+
def dods_interpret=(t_or_f)
|
50
|
+
@@dods_interpret=t_or_f
|
51
|
+
end
|
52
|
+
|
53
|
+
def proxy_port; @@proxy_port; end
|
54
|
+
def proxy_host; @@proxy_host; end
|
55
|
+
def proxy=(proxy)
|
56
|
+
if Regexp_URL =~ proxy
|
57
|
+
@@proxy_host = $2
|
58
|
+
@@proxy_port = ( $4 ? $4.to_i : 8080 )
|
59
|
+
else
|
60
|
+
raise "Invalid Proxy URL: "+proxy
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def initialize(url, proxy=nil)
|
66
|
+
url += '/' if /\/$/ !~ url # treat URLs that always end with '/'
|
67
|
+
@url = url
|
68
|
+
if Regexp_URL =~ @url
|
69
|
+
@host = $2
|
70
|
+
@port = ( $4 ? $4.to_i : 80 )
|
71
|
+
@path = $5
|
72
|
+
else
|
73
|
+
raise "Invalid URL: "+url
|
74
|
+
end
|
75
|
+
if proxy
|
76
|
+
if Regexp_URL =~ proxy
|
77
|
+
@proxy_host = $2
|
78
|
+
@proxy_port = ( $4 ? $4.to_i : 8080 )
|
79
|
+
else
|
80
|
+
raise "Invalid Proxy URL: "+proxy
|
81
|
+
end
|
82
|
+
else
|
83
|
+
@proxy_host = @@proxy_host
|
84
|
+
@proxy_port = @@proxy_port
|
85
|
+
end
|
86
|
+
@http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port)
|
87
|
+
res = @http.get(@path)
|
88
|
+
@body = res.body
|
89
|
+
@files = Array.new
|
90
|
+
@body.each do |line|
|
91
|
+
if Regexp_File =~ line
|
92
|
+
fltyp = File_Type[$1]
|
93
|
+
url = $2
|
94
|
+
label = $3
|
95
|
+
if @@dods_interpret
|
96
|
+
if /Parent Directory/ =~ label
|
97
|
+
url = '..'
|
98
|
+
else
|
99
|
+
url = File.basename( url.sub(/http:\//,'') )
|
100
|
+
end
|
101
|
+
if ( fltyp != 'text' and /\.(\w+)\.html$/ =~ url and
|
102
|
+
/#{$1}$/ =~ label )
|
103
|
+
# It must be a dods file url with a '.html' suffix
|
104
|
+
url.sub!(/\.html$/,'')
|
105
|
+
end
|
106
|
+
end
|
107
|
+
@files.push( {:file_type=>fltyp, :url=>url} )
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def body
|
113
|
+
@body
|
114
|
+
end
|
115
|
+
|
116
|
+
def each
|
117
|
+
@files.each do |fl|
|
118
|
+
yield(fl[:url])
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def collect
|
123
|
+
ary = Array.new
|
124
|
+
@files.each do |fl|
|
125
|
+
ary.push( yield(fl[:url]) )
|
126
|
+
end
|
127
|
+
ary
|
128
|
+
end
|
129
|
+
|
130
|
+
def each_dir
|
131
|
+
@files.each do |fl|
|
132
|
+
yield(fl[:url]) if fl[:file_type] == 'directory'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def each_file
|
137
|
+
@files.each do |fl|
|
138
|
+
yield(fl[:url]) if fl[:file_type] != 'directory'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def close
|
143
|
+
@http.finish if @http.active?
|
144
|
+
end
|
145
|
+
|
146
|
+
def rewind
|
147
|
+
# do nothing
|
148
|
+
end
|
149
|
+
|
150
|
+
end # HtDir
|
151
|
+
end # GDir
|
152
|
+
end # NumRu
|
153
|
+
|
154
|
+
if $0 == __FILE__
|
155
|
+
include NumRu
|
156
|
+
## GDir::HtDir.proxy='proxy.kuins.net:8080'
|
157
|
+
GDir::HtDir.dods_interpret = true
|
158
|
+
|
159
|
+
htdir = GDir::HtDir.new('http://davis-dods.rish.kyoto-u.ac.jp/cgi-bin/nph-dods/jmadata/gpv/latest/gpv/latest/')
|
160
|
+
print htdir.body
|
161
|
+
htdir.each{|sub| p sub}
|
162
|
+
htdir = GDir::HtDir.new('http://davis-dods.rish.kyoto-u.ac.jp/cgi-bin/nph-dods/jmadata/gpv/latest/gpv/')
|
163
|
+
print htdir.body
|
164
|
+
p htdir.collect{|x| x}
|
165
|
+
htdir.each{|sub| p sub}
|
166
|
+
htdir = GDir::HtDir.new('http://www.gfd-dennou.org/arch/')
|
167
|
+
print htdir.body
|
168
|
+
htdir.each_dir{|sub| p sub}
|
169
|
+
htdir.each_file{|sub| p sub}
|
170
|
+
end
|