gphys 1.2.2.1 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -17
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/ChangeLog +5762 -753
- data/LICENSE.txt +30 -18
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/gpcat +43 -2
- data/bin/gpcut +16 -0
- data/bin/gpvect +167 -15
- data/bin/gpview +254 -51
- data/bin/setup +7 -0
- data/dim_op.c +1220 -0
- data/doc/attribute.html +19 -0
- data/doc/attributenetcdf.html +15 -0
- data/doc/axis.html +387 -0
- data/doc/coordmapping.html +111 -0
- data/doc/coordtransform.html +36 -0
- data/doc/dclext.html +821 -0
- data/doc/derivative/gphys-derivative.html +100 -0
- data/doc/derivative/index.html +21 -0
- data/doc/derivative/index.rd +14 -0
- data/doc/derivative/math-doc/document.pdf +0 -0
- data/doc/derivative/math-doc/document.tex +158 -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/numru-derivative.html +158 -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.pdf +0 -0
- data/doc/ep_flux/math-doc/document.tex +2018 -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/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 +1119 -0
- data/doc/gpcat.html +45 -0
- data/doc/gpcut.html +47 -0
- data/doc/gphys.html +624 -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 +183 -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 +52 -0
- data/doc/gpmaxmin.html +32 -0
- data/doc/gpprint.html +35 -0
- data/doc/gpview.html +349 -0
- data/doc/grads2nc_with_gphys.html +21 -0
- data/doc/grads_gridded.html +307 -0
- data/doc/grib.html +149 -0
- data/doc/grid.html +224 -0
- data/doc/index.html +145 -0
- data/doc/index.rd +138 -0
- data/doc/netcdf_convention.html +136 -0
- data/doc/unumeric.html +176 -0
- data/doc/update +69 -0
- data/doc/update_rdoc +8 -0
- data/doc/varray.html +299 -0
- data/doc/varraycomposite.html +67 -0
- data/ext_init.c +1 -0
- data/extconf.rb +16 -6
- data/gphys.gemspec +33 -26
- data/interpo.c +1 -1
- data/lib/numru/dclext.rb +718 -546
- data/lib/numru/derivative.rb +2 -0
- data/lib/numru/ganalysis.rb +38 -0
- data/lib/numru/ganalysis/beta_plane.rb +103 -0
- data/lib/numru/ganalysis/eof.rb +3 -2
- data/lib/numru/ganalysis/fitting.rb +559 -0
- data/lib/numru/ganalysis/histogram.rb +36 -19
- data/lib/numru/ganalysis/log_p.rb +130 -0
- data/lib/numru/ganalysis/met.rb +396 -2
- data/lib/numru/ganalysis/met_z.rb +300 -0
- data/lib/numru/ganalysis/planet.rb +17 -7
- data/lib/numru/ganalysis/qg.rb +685 -0
- data/lib/numru/ganalysis/sigma_coord.rb +90 -0
- data/lib/numru/gdir.rb +2 -1
- data/lib/numru/ggraph.rb +204 -60
- data/lib/numru/ggraph_on_merdional_section.rb +1 -1
- data/lib/numru/gphys.rb +6 -0
- data/lib/numru/gphys/assoccoords.rb +18 -3
- data/lib/numru/gphys/axis.rb +209 -8
- data/lib/numru/gphys/derivative.rb +11 -0
- data/lib/numru/gphys/gphys.rb +539 -48
- data/lib/numru/gphys/gphys_dim_op.rb +331 -0
- data/lib/numru/gphys/gphys_fft.rb +48 -2
- data/lib/numru/gphys/gphys_io.rb +241 -13
- data/lib/numru/gphys/gphys_netcdf_io.rb +77 -39
- data/lib/numru/gphys/gphys_nusdas_io.rb +3 -0
- data/lib/numru/gphys/grib.rb +133 -54
- data/lib/numru/gphys/grib_params.rb +26 -3
- data/lib/numru/gphys/grid.rb +75 -34
- data/lib/numru/gphys/interpolate.rb +24 -10
- data/lib/numru/gphys/mdstorage.rb +160 -0
- data/lib/numru/gphys/netcdf_convention.rb +4 -2
- data/lib/numru/gphys/subsetmapping.rb +0 -1
- data/lib/numru/gphys/unumeric.rb +50 -5
- data/lib/numru/gphys/varray.rb +15 -30
- data/lib/numru/gphys/varraycomposite.rb +107 -24
- data/lib/numru/gphys/varraynetcdf.rb +9 -3
- data/lib/numru/gphys/version.rb +5 -0
- data/sample/druby_cli1.rb +2 -0
- data/sample/druby_cli2.rb +0 -6
- data/sample/druby_serv2.rb +0 -13
- data/spec/gphys_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -0
- data/test/test_assoccoords.rb +102 -0
- data/test/test_axis.rb +61 -0
- data/test/test_fitting.rb +116 -0
- data/test/test_gphys.rb +20 -0
- data/test/test_met_z.rb +96 -0
- data/test/test_sigma_coord.rb +50 -0
- data/{test → test_old}/eof_slp.rb +0 -0
- data/{test → test_old}/mltbit.dat +0 -0
- data/{test → test_old}/test_ep_flux.rb +0 -0
- data/{test → test_old}/test_multibitIO.rb +0 -0
- metadata +530 -191
- data/README.md +0 -29
- data/lib/gphys.rb +0 -2
- data/lib/numru/dclext_datetime_ax.rb +0 -220
- data/lib/version.rb +0 -3
data/lib/numru/gphys/unumeric.rb
CHANGED
@@ -183,6 +183,50 @@ module NumRu
|
|
183
183
|
@val, @uni = val, uni
|
184
184
|
end
|
185
185
|
|
186
|
+
##########################
|
187
|
+
# Tentative class to assist basic arithmetic operations between
|
188
|
+
# quantities without (like Numeric) and with (like UNumeric) units.
|
189
|
+
#
|
190
|
+
# The fundamental problem here is that the desired unit conversion
|
191
|
+
# to convert the Numeric is different between additional methods (+,-)
|
192
|
+
# and multiplicative methods (*,/). In the former, the
|
193
|
+
# numeric should be converted to have the same units with
|
194
|
+
# the other operand, and in the latter, it should be
|
195
|
+
# non-dimensional.
|
196
|
+
#
|
197
|
+
class Num2Coerce
|
198
|
+
# * num (Numeric, NArray etc -- numeric-like object without units).
|
199
|
+
# It must be KNOWN by the other operand.
|
200
|
+
def initialize(num)
|
201
|
+
@num = num
|
202
|
+
end
|
203
|
+
|
204
|
+
def num; @num; end
|
205
|
+
|
206
|
+
def +(o); o + num; end
|
207
|
+
def -(o); (-o) + num; end
|
208
|
+
def *(o); o * num; end
|
209
|
+
def /(o); o**(-1) * num;end
|
210
|
+
|
211
|
+
def >(o); o<num; end
|
212
|
+
def <(o); o>num; end
|
213
|
+
def >=(o); o<=num; end
|
214
|
+
def <=(o); o>=num; end
|
215
|
+
def ==(o); o==num; end
|
216
|
+
def ===(o); o===num; end
|
217
|
+
|
218
|
+
def <=>(o); c = o<=>num or -c; end
|
219
|
+
|
220
|
+
['%','**','divmod'].each do |op|
|
221
|
+
eval <<-EOS
|
222
|
+
def #{op}(o)
|
223
|
+
raise("operation #{op} is unavailable between Numeric and "+o.class.to_s)
|
224
|
+
end
|
225
|
+
EOS
|
226
|
+
end
|
227
|
+
end
|
228
|
+
##########################
|
229
|
+
|
186
230
|
def self::[](val, uni)
|
187
231
|
new(val, uni)
|
188
232
|
end
|
@@ -368,11 +412,11 @@ module NumRu
|
|
368
412
|
def coerce(other)
|
369
413
|
case
|
370
414
|
when Numeric
|
371
|
-
c_other =
|
372
|
-
when Array
|
373
|
-
|
374
|
-
when NArray
|
375
|
-
|
415
|
+
c_other = Num2Coerce.new( other )
|
416
|
+
#when Array
|
417
|
+
# c_other = VArray.new( NArray.to_na(other) )
|
418
|
+
#when NArray
|
419
|
+
# c_other = VArray.new( other )
|
376
420
|
else
|
377
421
|
raise "#{self.class}: cannot coerce #{other.class}"
|
378
422
|
end
|
@@ -518,6 +562,7 @@ if $0 == __FILE__
|
|
518
562
|
p a*7
|
519
563
|
p -a
|
520
564
|
p a-b, a-1000, a/100
|
565
|
+
p 1 + a
|
521
566
|
p a.log, a.sin
|
522
567
|
p UNumeric[1.0,Units['1']].atan2( UNumeric[1.0,Units['1']] )
|
523
568
|
|
data/lib/numru/gphys/varray.rb
CHANGED
@@ -547,7 +547,14 @@ These methods returns a NArray (not a VArray).
|
|
547
547
|
end
|
548
548
|
myunits = self.units
|
549
549
|
if myunits != to
|
550
|
-
|
550
|
+
if calendar = self.get_att("calendar")
|
551
|
+
date0 = UNumeric.new(0,myunits).to_datetime
|
552
|
+
un0 = UNumeric.from_date(date0,to,calendar)
|
553
|
+
offset = un0.to_f
|
554
|
+
gp = self + offset
|
555
|
+
else
|
556
|
+
gp = myunits.convert2(self, to)
|
557
|
+
end
|
551
558
|
gp.units = to
|
552
559
|
gp
|
553
560
|
else
|
@@ -619,22 +626,7 @@ These methods returns a NArray (not a VArray).
|
|
619
626
|
end
|
620
627
|
|
621
628
|
def axis_cyclic?
|
622
|
-
|
623
|
-
# You can override it in a sub-class or using convention specific
|
624
|
-
# mixins.
|
625
|
-
topology = attr['topology']
|
626
|
-
case topology
|
627
|
-
when /circular/i
|
628
|
-
true
|
629
|
-
when nil # 'topology' not defined
|
630
|
-
if /degrees?_east/ =~ attr['units']
|
631
|
-
true # special treatment a common convention for the earth
|
632
|
-
else
|
633
|
-
nil # not defined --> nil
|
634
|
-
end
|
635
|
-
else
|
636
|
-
false
|
637
|
-
end
|
629
|
+
axis_modulo != nil
|
638
630
|
end
|
639
631
|
|
640
632
|
def axis_modulo
|
@@ -681,23 +673,16 @@ These methods returns a NArray (not a VArray).
|
|
681
673
|
## ToDo: coerce
|
682
674
|
|
683
675
|
def coerce(other)
|
684
|
-
oattr = self.attr_copy
|
685
676
|
case other
|
686
677
|
when UNumeric
|
678
|
+
oattr = self.attr_copy
|
687
679
|
oattr['units'] = other.units.to_s
|
688
680
|
na_other, = NArray.new(self.typecode, 1).coerce(other.val) # scalar
|
689
681
|
c_other = VArray.new(na_other, oattr, self.name)
|
690
682
|
else
|
691
|
-
oattr['units'] = self.get_att('units') # Assume the same units
|
692
683
|
case other
|
693
|
-
when Numeric
|
694
|
-
|
695
|
-
c_other = VArray.new(na_other, oattr, self.name)
|
696
|
-
when Array
|
697
|
-
na = NArray.to_na(other)
|
698
|
-
c_other = VArray.new(na, oattr, self.name)
|
699
|
-
when NArray, NArrayMiss
|
700
|
-
c_other = VArray.new(other, oattr, self.name)
|
684
|
+
when Numeric, Array, NArrayMiss
|
685
|
+
c_other = UNumeric::Num2Coerce.new( other )
|
701
686
|
else
|
702
687
|
raise "Cannot coerse #{other.class}"
|
703
688
|
end
|
@@ -799,7 +784,7 @@ These methods returns a NArray (not a VArray).
|
|
799
784
|
ary = NArrayMiss.to_nam(vl)#{f}(vr)
|
800
785
|
end
|
801
786
|
va = VArray.new( ary, self.attr_copy, self.name )
|
802
|
-
va.units= self.units#{f}(other.units)
|
787
|
+
va.units= self.units#{f}(other.units) if "#{f}" != "**"
|
803
788
|
va
|
804
789
|
when Numeric, NArray, NArrayMiss, Array
|
805
790
|
vl = self.val
|
@@ -810,7 +795,7 @@ These methods returns a NArray (not a VArray).
|
|
810
795
|
ary = NArrayMiss.to_nam(vl)#{f}(vr)
|
811
796
|
end
|
812
797
|
va = VArray.new( ary, self.attr_copy, self.name )
|
813
|
-
if "#{f}" == "**"
|
798
|
+
if "#{f}" == "**" && other.is_a?(Numeric)
|
814
799
|
va.units= self.units#{f}(other)
|
815
800
|
end
|
816
801
|
va
|
@@ -1072,7 +1057,7 @@ if $0 == __FILE__
|
|
1072
1057
|
p "*3*",vt.log10
|
1073
1058
|
p "*4*",(vt < vs)
|
1074
1059
|
vt.name='vvvttt'
|
1075
|
-
p "*5*",(3+vt), vt.sin, vt.cos
|
1060
|
+
p "*5*",(3+vt).units.to_s, (3*vt).units.to_s, vt.sin, vt.cos
|
1076
1061
|
vc = vt.copy
|
1077
1062
|
p 'atan2'
|
1078
1063
|
vv = VArray.new( NArray.sfloat(5).indgen!, nil, 'vv' )
|
@@ -77,24 +77,31 @@ module NumRu
|
|
77
77
|
|
78
78
|
nvas = varrays.shape
|
79
79
|
vrank = nvas.length
|
80
|
-
rank=0
|
81
80
|
varrays.each{|va|
|
82
|
-
if va.
|
81
|
+
if !va.nil?
|
83
82
|
@first_vary = va
|
84
|
-
@attr = @first_vary.
|
83
|
+
@attr = @first_vary.attr_copy
|
85
84
|
@name = @first_vary.name
|
86
|
-
@
|
85
|
+
@crank = va.rank # rank of the component VArrays
|
87
86
|
break
|
88
87
|
end
|
89
88
|
}
|
90
|
-
if vrank > @
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
89
|
+
if vrank > @crank
|
90
|
+
@rank = vrank #=> @rank > @crank
|
91
|
+
else
|
92
|
+
@rank = @crank
|
93
|
+
if vrank < @crank
|
94
|
+
(@crank - vrank).times{
|
95
|
+
varrays = varrays.newdim(vrank)
|
96
|
+
nvas.push(1)
|
97
|
+
}
|
98
|
+
vrank = @crank # rank of varrays is increased to @crank (==@rank)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
un0 = varrays[0].units
|
102
|
+
for i in 1...varrays.length
|
103
|
+
va = varrays[i]
|
104
|
+
varrays[i] = va.convert_units(un0) if va && va.units != un0
|
98
105
|
end
|
99
106
|
|
100
107
|
@bound_idx = Array.new # will be Array of Array
|
@@ -106,14 +113,24 @@ module NumRu
|
|
106
113
|
len=0
|
107
114
|
varrays[*idx].each{|va|
|
108
115
|
if !set && va
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
116
|
+
### commented out for the duck typing:
|
117
|
+
#if !va.is_a?(VArray)
|
118
|
+
# raise ArgumentError,"Not a VArray: #{va.inspect}"
|
119
|
+
#end
|
120
|
+
if dim < @crank
|
121
|
+
len = va.shape_current[dim]
|
122
|
+
else
|
123
|
+
len = 1
|
124
|
+
end
|
113
125
|
@bound_idx[dim][i+1] = @bound_idx[dim][i] + len
|
114
126
|
set=true
|
115
127
|
elsif va
|
116
|
-
|
128
|
+
if dim < @crank
|
129
|
+
lc = va.shape_current[dim]
|
130
|
+
else
|
131
|
+
lc = 1
|
132
|
+
end
|
133
|
+
if lc != len
|
117
134
|
raise ArgumentError,"Non-uniformity in the #{i}th element"+
|
118
135
|
" of the #{dim}th dimension (#{va.shape_current[dim]} for #{len})"
|
119
136
|
end
|
@@ -165,9 +182,18 @@ module NumRu
|
|
165
182
|
loop_multi_dim_index( @varrays.shape ){|index|
|
166
183
|
vidx = Array.new
|
167
184
|
for d in 0...@rank
|
168
|
-
|
185
|
+
if d < @crank
|
186
|
+
vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
|
187
|
+
else
|
188
|
+
vidx[d] = @bound_idx[d][index[d]]
|
189
|
+
end
|
169
190
|
end
|
170
|
-
|
191
|
+
units = @attr["units"]
|
192
|
+
if units
|
193
|
+
v = @varrays[*index].convert_units(units).val
|
194
|
+
else
|
195
|
+
v = @varrays[*index].val
|
196
|
+
end
|
171
197
|
if !val
|
172
198
|
if NArray===v
|
173
199
|
val = NArray.new(v.typecode,*@shape)
|
@@ -177,7 +203,7 @@ module NumRu
|
|
177
203
|
raise TypeError, "Unexpected type #{v.class}"
|
178
204
|
end
|
179
205
|
end
|
180
|
-
val[*vidx] =
|
206
|
+
val[*vidx] = v
|
181
207
|
}
|
182
208
|
val
|
183
209
|
end
|
@@ -190,7 +216,11 @@ module NumRu
|
|
190
216
|
__check_ary_class(narray)
|
191
217
|
vidx = Array.new
|
192
218
|
for d in 0...@rank
|
193
|
-
|
219
|
+
if d < @crank
|
220
|
+
vidx[d] = (@bound_idx[d][index[d]])..(@bound_idx[d][index[d]+1]-1)
|
221
|
+
else
|
222
|
+
vidx[d] = @bound_idx[d][index[d]]
|
223
|
+
end
|
194
224
|
end
|
195
225
|
sub=narray[*vidx]
|
196
226
|
end
|
@@ -286,12 +316,12 @@ module NumRu
|
|
286
316
|
idx.each_with_index{ |ix, dim|
|
287
317
|
size = @bound_idx[dim][-1]
|
288
318
|
imask[dim] = Array.new
|
289
|
-
isub[dim] = Array.new
|
319
|
+
isub[dim] = Array.new if dim < @crank
|
290
320
|
for j in 0...(@bound_idx[dim].length)
|
291
321
|
match, isb = _imatch( size, ix, @bound_idx[dim][j..j+1] )
|
292
322
|
if match
|
293
323
|
imask[dim].push(j)
|
294
|
-
isub[dim].push(isb)
|
324
|
+
isub[dim].push(isb) if dim < @crank
|
295
325
|
end
|
296
326
|
end
|
297
327
|
}
|
@@ -334,6 +364,11 @@ module NumRu
|
|
334
364
|
stp = 1
|
335
365
|
else # Hash
|
336
366
|
range, stp = index.to_a[0]
|
367
|
+
if stp<=0
|
368
|
+
raise(ArgumentError,"Currently only positive step is supported")
|
369
|
+
# development note: current handling of fst and lst assumes a
|
370
|
+
# positive step
|
371
|
+
end
|
337
372
|
range = 0..-1 if range==true
|
338
373
|
fst = range.first
|
339
374
|
fst += size if fst < 0
|
@@ -349,11 +384,28 @@ module NumRu
|
|
349
384
|
if stp==1
|
350
385
|
return [true, a..b ]
|
351
386
|
else
|
352
|
-
|
387
|
+
len = last-first+1
|
388
|
+
if a<len
|
389
|
+
return [true, {(a..b) => stp} ]
|
390
|
+
else
|
391
|
+
return [false, nil]
|
392
|
+
end
|
353
393
|
end
|
354
394
|
else
|
355
395
|
return [false, nil]
|
356
396
|
end
|
397
|
+
when Array
|
398
|
+
match = false
|
399
|
+
isb = []
|
400
|
+
index.each{ |idx|
|
401
|
+
idx += size if idx < 0
|
402
|
+
if first <= idx && idx <= last
|
403
|
+
match = true
|
404
|
+
isb.push(idx-first)
|
405
|
+
end
|
406
|
+
}
|
407
|
+
isb = nil if isb == []
|
408
|
+
return [match, isb]
|
357
409
|
else
|
358
410
|
raise "Unsupported type for indexing: #{index.class}"
|
359
411
|
end
|
@@ -412,4 +464,35 @@ if __FILE__ == $0
|
|
412
464
|
p vac.get_att('long_name')
|
413
465
|
p va01.get_att('long_name')
|
414
466
|
p vac.typecode,vac.ntype
|
467
|
+
|
468
|
+
puts "testing rank extension.."
|
469
|
+
va0 = VArray.new( NArray.float(3,2).indgen!, {"units"=>"m/s"}, 'V' )
|
470
|
+
va1 = VArray.new( NArray.float(3,2).indgen!+100, {"units"=>"m/s"}, 'V' )
|
471
|
+
va2 = VArray.new( NArray.float(3,2).indgen!+200, {"units"=>"m/s"}, 'V' )
|
472
|
+
va3 = VArray.new( NArray.float(3,2).indgen!+300, {"units"=>"m/s"}, 'V' )
|
473
|
+
varrays = NArray.to_na([ [[va0]], [[va1]], [[va2]], [[va3]] ])
|
474
|
+
vac = VArrayComposite.new(varrays)
|
475
|
+
p vac, vac.val
|
476
|
+
if vac[1,1,1].val == 104.0
|
477
|
+
puts "test OK"
|
478
|
+
else
|
479
|
+
raise "test failed"
|
480
|
+
end
|
481
|
+
|
482
|
+
v = vac[0..1,0,{1..-1=>2}].val
|
483
|
+
ans = NArray.to_na( [ [100.0,101.0], [300.0, 301.0] ] )
|
484
|
+
if v==ans
|
485
|
+
puts "test OK"
|
486
|
+
else
|
487
|
+
raise "test failed"
|
488
|
+
end
|
489
|
+
|
490
|
+
vac[-1,true,1..2] = -999.0
|
491
|
+
if vac[-1,true,1..2].val.to_a.flatten.uniq == [-999.0 ]
|
492
|
+
puts "test OK"
|
493
|
+
else
|
494
|
+
raise "test failed"
|
495
|
+
end
|
496
|
+
#vac.val = NArray.float(3,2,4).random!
|
497
|
+
#p vac.val
|
415
498
|
end
|
@@ -55,7 +55,7 @@ module NumRu
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
def close
|
58
|
-
enddef
|
58
|
+
enddef rescue nil
|
59
59
|
super
|
60
60
|
end
|
61
61
|
end # module NetCDFDeferred
|
@@ -216,9 +216,15 @@ module NumRu
|
|
216
216
|
## < redefined instance methods > ##
|
217
217
|
|
218
218
|
def val
|
219
|
-
|
219
|
+
begin
|
220
|
+
mode_switched = @ary.file.enddef
|
221
|
+
rescue
|
222
|
+
end
|
220
223
|
v = @ary.get
|
221
|
-
|
224
|
+
begin
|
225
|
+
if mode_switched; @ary.file.redef; end
|
226
|
+
rescue
|
227
|
+
end
|
222
228
|
v
|
223
229
|
end
|
224
230
|
|
data/sample/druby_cli1.rb
CHANGED
data/sample/druby_cli2.rb
CHANGED
@@ -17,10 +17,6 @@ p gp.grid.axis(0).pos.name
|
|
17
17
|
gpmean = gp.mean(0)
|
18
18
|
p gpmean.class, gpmean.name, gpmean.rank
|
19
19
|
|
20
|
-
class NArray
|
21
|
-
def self._load(o) to_na(*Marshal::load(o)).ntoh end
|
22
|
-
end
|
23
|
-
|
24
20
|
p ( gpmean_copy = gpmean.copy )
|
25
21
|
DCL.gropn(1)
|
26
22
|
DCL.sgpset('lfull',true)
|
@@ -30,5 +26,3 @@ GGraph.set_fig('viewport'=>[0.25,0.7,0.15,0.6], 'itr'=>2 )
|
|
30
26
|
GGraph.contour( gpmean_copy )
|
31
27
|
DCL.grcls
|
32
28
|
|
33
|
-
print "\nThe following will be a DRbObject rather than GPhys since the size is too large\n(see druby_serv2.rb):\n"
|
34
|
-
p ( gpcopy = gp.copy )
|
data/sample/druby_serv2.rb
CHANGED
@@ -41,19 +41,6 @@ port = ARGV.shift
|
|
41
41
|
usage if port && port.to_i.to_s != port
|
42
42
|
usage if ARGV.length > 0
|
43
43
|
|
44
|
-
class NArray
|
45
|
-
DUMP_SIZE_LIMIT = 5000
|
46
|
-
def self._load(o) to_na(*Marshal::load(o)).ntoh end
|
47
|
-
def _dump(limit)
|
48
|
-
if size <= DUMP_SIZE_LIMIT
|
49
|
-
Marshal::dump([hton.to_s, typecode, *shape])
|
50
|
-
else
|
51
|
-
raise "size of the NArray (#{size}) is too large to dump "+
|
52
|
-
"(limit: #{DUMP_SIZE_LIMIT})"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
44
|
file = NetCDF.open("../testdata/T.jan.nc")
|
58
45
|
gp = GPhys::NetCDF_IO.open(file,"T")
|
59
46
|
|