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,522 @@
|
|
1
|
+
require "numru/units"
|
2
|
+
require "rational" # for UNumeric#sqrt
|
3
|
+
require "date" # for DateTime
|
4
|
+
|
5
|
+
## require "numru/gphys/gphys" # --> in the test program
|
6
|
+
|
7
|
+
=begin
|
8
|
+
=class NumRu::UNumeric
|
9
|
+
|
10
|
+
Class of Numeric with Units.
|
11
|
+
|
12
|
+
Dependent on
|
13
|
+
((<NumRu::Units|URL:http://ruby.gfd-dennou.org/products/numru=units>))
|
14
|
+
and Rational, a standard library.
|
15
|
+
|
16
|
+
==Class Methods
|
17
|
+
|
18
|
+
---new(val, uni)
|
19
|
+
|
20
|
+
Constractor.
|
21
|
+
|
22
|
+
ARGUMENTS
|
23
|
+
* ((|val|)) (Numeric)
|
24
|
+
* ((|units|)) (NumRu::Units or String): if string, internally converted to
|
25
|
+
a NumRu::Units
|
26
|
+
|
27
|
+
---[val, uni]
|
28
|
+
|
29
|
+
Same as new
|
30
|
+
|
31
|
+
---from_date(date, units)
|
32
|
+
|
33
|
+
Convert a DateTime (or Date) to a UNUmeric
|
34
|
+
|
35
|
+
ARGUMENTS
|
36
|
+
* date (Date or DateTime)
|
37
|
+
* units (Units or String) : units of the UNumeric to be created
|
38
|
+
|
39
|
+
==Methods
|
40
|
+
|
41
|
+
---val
|
42
|
+
|
43
|
+
RETURN VALUE
|
44
|
+
* the value (Numeric)
|
45
|
+
|
46
|
+
---units
|
47
|
+
|
48
|
+
RETURN VALUE
|
49
|
+
* the units (NumRu::Units)
|
50
|
+
|
51
|
+
---inspect
|
52
|
+
|
53
|
+
RETURN VALUE
|
54
|
+
* a String (e.g., '1 m')
|
55
|
+
|
56
|
+
---to_s
|
57
|
+
|
58
|
+
aliasesed to ((<inspect>)).
|
59
|
+
|
60
|
+
---to_f
|
61
|
+
RETURN VALUE
|
62
|
+
* val.to_f
|
63
|
+
|
64
|
+
---to_i
|
65
|
+
RETURN VALUE
|
66
|
+
* val.to_i
|
67
|
+
|
68
|
+
---convert(to_units)
|
69
|
+
|
70
|
+
Convert to ((|to_units|)).
|
71
|
+
|
72
|
+
RETURN VALUE
|
73
|
+
* a UNumeric
|
74
|
+
|
75
|
+
EXCEPTION
|
76
|
+
* when the current units is incompatible with to_units.
|
77
|
+
|
78
|
+
---convert2
|
79
|
+
|
80
|
+
Same as ((<convert>)), but returns ((|self|)) if the units are
|
81
|
+
incompatible (Warned).
|
82
|
+
|
83
|
+
EXCEPTION
|
84
|
+
* none
|
85
|
+
|
86
|
+
WARING MADE
|
87
|
+
|
88
|
+
Warning is made to $stderr if the following
|
89
|
+
condition is satisfied.
|
90
|
+
|
91
|
+
* the units of ((|self|)) and ((|to_units|)) are incompatible.
|
92
|
+
|
93
|
+
---coerce(other)
|
94
|
+
|
95
|
+
As you know. Can handle Numeric, Array, NArray.
|
96
|
+
NOTE: VArray and GPhys know UNumeric.
|
97
|
+
|
98
|
+
--- *(other)
|
99
|
+
|
100
|
+
Multiplication. Knows Numeric, UNumeric, VArray, and GPhys.
|
101
|
+
The units are multipled too. (if other is Numeric, it is assumed
|
102
|
+
to be non-dimension)
|
103
|
+
|
104
|
+
RETURN VALUE
|
105
|
+
* a UNumeric, VArray, or GPhys
|
106
|
+
|
107
|
+
--- /(other)
|
108
|
+
|
109
|
+
Division. See ((<*>)).
|
110
|
+
|
111
|
+
--- +(other)
|
112
|
+
|
113
|
+
Addition. Knows Numeric, UNumeric, VArray, and GPhys.
|
114
|
+
The return value will have the units of ((|self|)).
|
115
|
+
|
116
|
+
SPECIAL REMARK!
|
117
|
+
|
118
|
+
If ((|other|)) has units within a factor and/or offset
|
119
|
+
of difference, It is CONVERTED before addition (by using ((<convert2>)))!
|
120
|
+
|
121
|
+
RETURN VALUE
|
122
|
+
* a UNumeric, VArray, or GPhys
|
123
|
+
|
124
|
+
WARING MADE
|
125
|
+
|
126
|
+
Warning is made to $stderr if the following
|
127
|
+
condition is satisfied.
|
128
|
+
|
129
|
+
* the units of ((|self|)) and ((|to_units|)) are incompatible.
|
130
|
+
* ((|other|)) is Numeric.
|
131
|
+
|
132
|
+
--- -(other)
|
133
|
+
|
134
|
+
Subtraction. See ((<+>)).
|
135
|
+
|
136
|
+
--- **(num)
|
137
|
+
|
138
|
+
Power.
|
139
|
+
|
140
|
+
--- abs
|
141
|
+
|
142
|
+
Absolute value. Other math functions are also avialable as instance
|
143
|
+
methods.
|
144
|
+
|
145
|
+
---to_datetime(eps_sec=0.0)
|
146
|
+
|
147
|
+
Convert a time UNumeric into a DateTime
|
148
|
+
|
149
|
+
ARGUMENTS
|
150
|
+
* eps_sec (Float) : Magic epsilon to prevent the round-off of
|
151
|
+
DateTime [seconds]. Recommended value is 0.1.
|
152
|
+
|
153
|
+
RETURN VALUE
|
154
|
+
* a DateTime
|
155
|
+
|
156
|
+
EXCEPTION
|
157
|
+
* raised if self does not have a time unit with a since field
|
158
|
+
|
159
|
+
---strftime(fmt)
|
160
|
+
|
161
|
+
Text expression of the date and time of a time UNumeric.
|
162
|
+
Implemented as
|
163
|
+
self.to_datetime(0.1).strftime(fmt)
|
164
|
+
|
165
|
+
ARGUMENTS
|
166
|
+
* fmt (Sting) : the format. Try
|
167
|
+
% man 3 strftime
|
168
|
+
to find how to write it.
|
169
|
+
|
170
|
+
RETURN VALUE
|
171
|
+
* a String
|
172
|
+
|
173
|
+
=end
|
174
|
+
|
175
|
+
module NumRu
|
176
|
+
|
177
|
+
class UNumeric
|
178
|
+
|
179
|
+
def initialize(val, uni)
|
180
|
+
raise TypeError unless Numeric === val
|
181
|
+
uni = Units.new(uni) if String === uni
|
182
|
+
raise TypeError unless Units === uni
|
183
|
+
@val, @uni = val, uni
|
184
|
+
end
|
185
|
+
|
186
|
+
def self::[](val, uni)
|
187
|
+
new(val, uni)
|
188
|
+
end
|
189
|
+
|
190
|
+
@@supported_calendars = [nil,"gregorian", "standard","noleap","365_day",
|
191
|
+
"360_day"]
|
192
|
+
|
193
|
+
def self::supported_calendar?(cal)
|
194
|
+
@@supported_calendars.include?(cal)
|
195
|
+
end
|
196
|
+
|
197
|
+
def self::supported_calendars
|
198
|
+
@@supported_calendars.dup
|
199
|
+
end
|
200
|
+
|
201
|
+
# * date (Date or DateTime)
|
202
|
+
# * units (Units or String) : units of the UNumeric to be created
|
203
|
+
def self::from_date(date, units, calendar=nil)
|
204
|
+
sunits = units.to_s
|
205
|
+
/(.*) *since *(.*)/ =~ sunits
|
206
|
+
if (!$1 or !$2)
|
207
|
+
raise("Units mismatch. Requires time units that includes 'since'")
|
208
|
+
end
|
209
|
+
tun = Units[$1]
|
210
|
+
since = DateTime.parse(UNumeric::before_date_parse($2))
|
211
|
+
if( tun =~ Units['months since 0001-01-01'] )
|
212
|
+
year0,mon0 = since.year,since.mon
|
213
|
+
year,mon = date.year,date.mon
|
214
|
+
time = Units['months'].convert((year*12+mon)-(year0*12+mon0), tun)
|
215
|
+
elsif( tun =~ Units['days since 0001-01-01'] )
|
216
|
+
case calendar
|
217
|
+
when nil, "gregorian", "standard"
|
218
|
+
time = Units['days'].convert( date-since, tun )
|
219
|
+
when "noleap", "365_day"
|
220
|
+
since_yday = since - DateTime.new(since.year,1,1) # day number of year (0..364)
|
221
|
+
since_yday = since_yday - 1 if( since.leap? && since.mon > 2 )
|
222
|
+
date_yday = date - DateTime.new(date.year,1,1)
|
223
|
+
if( date.leap? )
|
224
|
+
if date_yday >= 60.0 # after Mar1
|
225
|
+
date_yday = date_yday - 1
|
226
|
+
elsif date_yday >= 59.0 # Feb29
|
227
|
+
raise "Feb.29 is specified, but calendar is #{calendar}."
|
228
|
+
end
|
229
|
+
end
|
230
|
+
days = (date.year - since.year)*365 + (date_yday - since_yday)
|
231
|
+
time = Units['days'].convert( days, tun )
|
232
|
+
when "360_day" # does not work perfectly
|
233
|
+
days = (date.year - since.year)*360 + (date.mon - since.mon)*30 + (date.day - since.day)
|
234
|
+
time = Units['days'].convert( days, tun )
|
235
|
+
else
|
236
|
+
#raise("Unrecognized calendar: #{calendar}")
|
237
|
+
return nil
|
238
|
+
end
|
239
|
+
else
|
240
|
+
#raise("Unrecognized time units #{tun.to_s}")
|
241
|
+
return nil
|
242
|
+
end
|
243
|
+
time = time.to_f
|
244
|
+
UNumeric[time, units]
|
245
|
+
end
|
246
|
+
|
247
|
+
|
248
|
+
# Always interpret y \d\d as 00\d\d and y \d as 000\d
|
249
|
+
# (Date in Ruby 1.9 interprets them as 20\d\d etc.)
|
250
|
+
def self::before_date_parse(str)
|
251
|
+
if /^\d\d-\d/ =~ str
|
252
|
+
str = "00"+str
|
253
|
+
elsif /^\d-\d/ =~ str
|
254
|
+
str = "00"+str
|
255
|
+
end
|
256
|
+
str
|
257
|
+
end
|
258
|
+
|
259
|
+
def val; @val; end
|
260
|
+
|
261
|
+
def units; @uni; end
|
262
|
+
|
263
|
+
def inspect
|
264
|
+
val.to_s + ' ' +units.to_s
|
265
|
+
end
|
266
|
+
|
267
|
+
alias to_s inspect
|
268
|
+
|
269
|
+
def to_f; @val.to_f; end
|
270
|
+
def to_i; @val.to_i; end
|
271
|
+
|
272
|
+
def convert(to_units)
|
273
|
+
if ( units == to_units )
|
274
|
+
self
|
275
|
+
else
|
276
|
+
UNumeric[ units.convert(val, to_units), to_units ]
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
def convert2(to_units)
|
281
|
+
# returns self if the units are incompatible
|
282
|
+
begin
|
283
|
+
convert(to_units)
|
284
|
+
rescue
|
285
|
+
#if $VERBOSE
|
286
|
+
$stderr.print(
|
287
|
+
"WARNING: incompatible units: #{units.to_s} - #{to_units.to_s}\n")
|
288
|
+
#end # warn in Ruby 1.8
|
289
|
+
self
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
def strftime(fmt)
|
294
|
+
self.to_datetime(0.1).strftime(fmt)
|
295
|
+
end
|
296
|
+
|
297
|
+
# * eps_sec : Magic epsilon to prevent the round-off of DateTime [seconds].
|
298
|
+
# Recommended value is 0.1.
|
299
|
+
def to_datetime(eps_sec=0.0,calendar=nil)
|
300
|
+
time = self.val
|
301
|
+
sunits = self.units.to_s
|
302
|
+
/(.*) *since *(.*)/ =~ sunits
|
303
|
+
if (!$1 or !$2)
|
304
|
+
raise("Units mismatch. Requires time units that includes 'since'")
|
305
|
+
end
|
306
|
+
tun = Units[$1]
|
307
|
+
sincestr = $2.sub(/(^\d{1,2}-\d+-\d)/,'00\1')
|
308
|
+
#^ correction for Ruby 1.9 to prevent 1- or 2-digit years
|
309
|
+
# (e.g. 1, 02) to be interpreted as in 2000's (e.g., 2001, 2002)
|
310
|
+
since = DateTime.parse(UNumeric::before_date_parse(sincestr))
|
311
|
+
if( tun =~ Units['months since 0001-01-01'] )
|
312
|
+
datetime = since >> tun.convert( time, Units['months'] )
|
313
|
+
elsif( tun =~ Units['days since 0001-01-01'] )
|
314
|
+
case calendar
|
315
|
+
when nil, "gregorian", "standard"
|
316
|
+
datetime = since + tun.convert( time, Units['days'] )
|
317
|
+
when "noleap", "365_day"
|
318
|
+
since_yday = since - DateTime.new(since.year,1,1) # day number of year (0..364)
|
319
|
+
since_yday = since_yday - 1 if( since.leap? && since.mon > 2 )
|
320
|
+
days = since_yday + tun.convert( time, Units['days'] )
|
321
|
+
year = since.year + (days/365).to_i
|
322
|
+
date_yday = days%365 # day number of year (0..364)
|
323
|
+
datetime = DateTime.new(year,1,1) + date_yday
|
324
|
+
datetime = datetime + 1 if( datetime.leap? && date_yday >= 59 )
|
325
|
+
when "360_day" # does not work perfectly
|
326
|
+
since_day = since - DateTime.new(since.year,since.mon,1)
|
327
|
+
days = (since.mon-1)*30 + since_day + tun.convert( time, Units['days'] )
|
328
|
+
year = since.year + (days/360).to_i
|
329
|
+
mon = ((days%360)/30).to_i + 1
|
330
|
+
datetime = DateTime.new(year,mon,1) + days%30
|
331
|
+
else
|
332
|
+
#raise("Unrecognized calendar: #{calendar}")
|
333
|
+
return nil
|
334
|
+
end
|
335
|
+
else
|
336
|
+
#raise("Unrecognized time units #{tun.to_s}")
|
337
|
+
return nil
|
338
|
+
end
|
339
|
+
if eps_sec != 0.0
|
340
|
+
datetime = datetime + eps_sec/8.64e4
|
341
|
+
end
|
342
|
+
datetime
|
343
|
+
end
|
344
|
+
|
345
|
+
def coerce(other)
|
346
|
+
case
|
347
|
+
when Numeric
|
348
|
+
c_other = UNumeric.new( other, Units.new("1") )
|
349
|
+
when Array
|
350
|
+
c_other = VArray.new( NArray.to_na(other) )
|
351
|
+
when NArray
|
352
|
+
c_other = VArray.new( other )
|
353
|
+
else
|
354
|
+
raise "#{self.class}: cannot coerce #{other.class}"
|
355
|
+
end
|
356
|
+
[ c_other, self ]
|
357
|
+
end
|
358
|
+
|
359
|
+
def *(other)
|
360
|
+
case other
|
361
|
+
when UNumeric
|
362
|
+
UNumeric.new( val * other.val , units * other.units )
|
363
|
+
when Numeric
|
364
|
+
# assumed to be non-dimensional
|
365
|
+
UNumeric.new( val * other, units )
|
366
|
+
when VArray, GPhys
|
367
|
+
result = other * val
|
368
|
+
result.units = units * other.units
|
369
|
+
result
|
370
|
+
else
|
371
|
+
s, o = other.coerce( self )
|
372
|
+
s * o
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
def +(other)
|
377
|
+
case other
|
378
|
+
when UNumeric
|
379
|
+
v = val + other.convert2( units ).val
|
380
|
+
UNumeric.new( v , units )
|
381
|
+
when Numeric
|
382
|
+
v = val + other
|
383
|
+
$stderr.print("WARNING: raw Numeric added to #{inspect}\n") #if $VERBOSE
|
384
|
+
UNumeric.new( v, units )
|
385
|
+
when VArray, GPhys
|
386
|
+
ans = other.units.convert2(other, units) + val
|
387
|
+
ans.units = units # units are taken from the lhs
|
388
|
+
ans
|
389
|
+
else
|
390
|
+
s, o = other.coerce( self )
|
391
|
+
s + o
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
def **(other)
|
396
|
+
UNumeric.new( val**other, units**other )
|
397
|
+
end
|
398
|
+
|
399
|
+
def abs
|
400
|
+
UNumeric.new( val.abs, units )
|
401
|
+
end
|
402
|
+
|
403
|
+
def -@
|
404
|
+
UNumeric.new( -val, units )
|
405
|
+
end
|
406
|
+
|
407
|
+
def +@
|
408
|
+
self
|
409
|
+
end
|
410
|
+
|
411
|
+
def -(other)
|
412
|
+
self + (-other) # not efficient --> Rewrite later!
|
413
|
+
end
|
414
|
+
|
415
|
+
def /(other)
|
416
|
+
self * (other**(-1)) # not efficient --> Rewrite later!
|
417
|
+
end
|
418
|
+
|
419
|
+
LogicalOps = [">",">=","<","<=","==","==="]
|
420
|
+
LogicalOps.each { |op|
|
421
|
+
eval <<-EOS, nil, __FILE__, __LINE__+1
|
422
|
+
def #{op}(other)
|
423
|
+
case other
|
424
|
+
when UNumeric
|
425
|
+
val #{op} other.convert2( units ).val
|
426
|
+
when Numeric
|
427
|
+
$stderr.print("WARNING: raw Numeric added to #{inspect}\n") #\
|
428
|
+
# if $VERBOSE # warn in Ruby 1.8
|
429
|
+
val #{op} other
|
430
|
+
when VArray, GPhys
|
431
|
+
val #{op} other.units.convert2(other, units)
|
432
|
+
else
|
433
|
+
s, o = other.coerce( self )
|
434
|
+
s #{op} o
|
435
|
+
end
|
436
|
+
end
|
437
|
+
EOS
|
438
|
+
}
|
439
|
+
|
440
|
+
Math_funcs_nondim = ["exp","log","log10","log2","sin","cos","tan",
|
441
|
+
"sinh","cosh","tanh","asinh","acosh",
|
442
|
+
"atanh","csc","sec","cot","csch","sech","coth",
|
443
|
+
"acsch","asech","acoth"]
|
444
|
+
Math_funcs_nondim.each{ |f|
|
445
|
+
eval <<-EOS, nil, __FILE__, __LINE__+1
|
446
|
+
def #{f}
|
447
|
+
UNumeric.new( Math.#{f}(val), Units.new('1') )
|
448
|
+
end
|
449
|
+
EOS
|
450
|
+
}
|
451
|
+
Math_funcs_radian = ["asin","acos","atan","acsc","asec","acot"]
|
452
|
+
Math_funcs_radian.each{ |f|
|
453
|
+
eval <<-EOS, nil, __FILE__, __LINE__+1
|
454
|
+
def #{f}
|
455
|
+
UNumeric.new( Math.#{f}(val), Units.new('rad') )
|
456
|
+
end
|
457
|
+
EOS
|
458
|
+
}
|
459
|
+
|
460
|
+
def atan2(other)
|
461
|
+
case other
|
462
|
+
when Numeric
|
463
|
+
UNumeric.new( Math.atan2(val, other), Units.new('rad') )
|
464
|
+
when UNumeric
|
465
|
+
UNumeric.new( Math.atan2(val, other.val), Units.new('rad') )
|
466
|
+
else
|
467
|
+
c_me, c_other = other.coerce(self)
|
468
|
+
c_me.atan2(c_other)
|
469
|
+
end
|
470
|
+
end
|
471
|
+
|
472
|
+
def sqrt
|
473
|
+
UNumeric.new( Math.sqrt(val), units**Rational(1,2) )
|
474
|
+
end
|
475
|
+
|
476
|
+
end # class UNumeric
|
477
|
+
end # module NumRu
|
478
|
+
|
479
|
+
######################################
|
480
|
+
if $0 == __FILE__
|
481
|
+
|
482
|
+
require "narray"
|
483
|
+
|
484
|
+
include NumRu
|
485
|
+
a = UNumeric[ 10.0, Units['m/s'] ]
|
486
|
+
b = UNumeric[ 2.0, Units['m/s'] ]
|
487
|
+
c = UNumeric[ 5.0, Units['m'] ]
|
488
|
+
|
489
|
+
print "\n** Section 1 **\n"
|
490
|
+
p a
|
491
|
+
p a*b
|
492
|
+
p a+b
|
493
|
+
p a+c
|
494
|
+
p a+7
|
495
|
+
p a*7
|
496
|
+
p -a
|
497
|
+
p a-b, a-1000, a/100
|
498
|
+
p a.log, a.sin
|
499
|
+
p UNumeric[1.0,Units['1']].atan2( UNumeric[1.0,Units['1']] )
|
500
|
+
|
501
|
+
print "\n** Section 2 **\n"
|
502
|
+
p a > 1
|
503
|
+
p 1 > a
|
504
|
+
|
505
|
+
print "\n** Section 3 **\n"
|
506
|
+
|
507
|
+
require "numru/gphys/varray"
|
508
|
+
|
509
|
+
na = NArray.float(4).indgen
|
510
|
+
va = VArray.new( na )
|
511
|
+
vb = a + va
|
512
|
+
p vb, vb.units, vb.att_names
|
513
|
+
|
514
|
+
a = UNumeric[ 3721.0, Units['seconds since 2008-01-01'] ]
|
515
|
+
p a.to_datetime.to_s, a.strftime('%Y-%m-%d %H:%M:%S')
|
516
|
+
b = UNumeric[ 3.0, Units['months since 2008-01-01'] ]
|
517
|
+
p b.strftime('%Y-%m-%d %H:%M:%S')
|
518
|
+
p (UNumeric::from_date(DateTime.parse('2008-01-01 00:00-0200'),
|
519
|
+
'seconds since 2008-01-01')).to_s
|
520
|
+
p (UNumeric::from_date(DateTime.parse('2008-6-01'),
|
521
|
+
'months since 2008-01-01')).to_s
|
522
|
+
end
|