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
@@ -525,7 +525,7 @@ module NumRu
|
|
525
525
|
# Single file. Returns a VArrayNetCDF. dim is ignored.
|
526
526
|
file = files
|
527
527
|
var = file.var( varname )
|
528
|
-
raise "variable '#{varname}' not found in #{file}" if !var
|
528
|
+
raise "variable '#{varname}' not found in #{file.inspect}" if !var
|
529
529
|
VArrayNetCDF.new( var )
|
530
530
|
elsif files.is_a?(NArray)
|
531
531
|
# Suppose that files is a NArray of NetCDF. Returns a VArrayCompsite.
|
@@ -566,9 +566,30 @@ module NumRu
|
|
566
566
|
[files, ncvar0]
|
567
567
|
end
|
568
568
|
|
569
|
+
#--
|
570
|
+
# re-arrange the array of files and check some inconsistencies
|
571
|
+
#
|
572
|
+
# e.g.)
|
573
|
+
# files = NArray[ file0.nc, file1.nc, file2.nc, file3.nc ]
|
574
|
+
# The files have a variable, u(lat,lev,time),
|
575
|
+
# which is tiled to four parts as the followings:
|
576
|
+
# | lat | lev | time |
|
577
|
+
# file0.nc | -90...0 | 1000...500 | 0..1 |
|
578
|
+
# file1.nc | 0..90 | 1000...500 | 0..1 |
|
579
|
+
# file2.nc | -90...0 | 500..100 | 0..1 |
|
580
|
+
# file3.nc | 0..90 | 500..100 | 0..1 |
|
581
|
+
#
|
582
|
+
# Then the output is
|
583
|
+
# NArray[ [ [ file0.nc, file1.nc ],
|
584
|
+
# [ file2.nc, file3.nc ] ] ].
|
585
|
+
#
|
586
|
+
# The order of the elements of the input array is arbitrary.
|
587
|
+
#
|
569
588
|
def __files_dim_matching( files, varname )
|
570
589
|
# files: NArray of NetCDF
|
571
590
|
|
591
|
+
return files if files.length == 1
|
592
|
+
|
572
593
|
# < read the first file and check its rank >
|
573
594
|
|
574
595
|
file0 = files[0]
|
@@ -581,44 +602,61 @@ module NumRu
|
|
581
602
|
|
582
603
|
#< find correspoding dimensions >
|
583
604
|
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
605
|
+
rank = axposnames.length
|
606
|
+
cvals = Array.new(rank){ Array.new }
|
607
|
+
sign = Array.new(rank)
|
608
|
+
units = Array.new(rank)
|
609
|
+
files.each do |file|
|
610
|
+
axposnames.each_with_index do |axposname, i|
|
611
|
+
nvax = file.var(axposname)
|
612
|
+
raise "No coordinate variable: #{axposname}' not found" if !nvax
|
613
|
+
axpos = VArrayNetCDF.new( nvax )
|
614
|
+
axv0 = axpos.val[0]
|
615
|
+
if units[i]
|
616
|
+
un = axpos.units
|
617
|
+
axv0 = un.convert2(axv0,units[i]) unless un == units[i]
|
618
|
+
else # the first file
|
619
|
+
units[i] = axpos.units
|
620
|
+
sign[i] = (axpos.val[-1] >= axv0 ? 1 : -1)
|
621
|
+
end
|
622
|
+
cvals[i].push axv0
|
623
|
+
end
|
624
|
+
end
|
625
|
+
# For the above example,
|
626
|
+
# cvals = [ [ -90, 0, -90, 0 ],
|
627
|
+
# [ 1000, 1000, 500, 500 ],
|
628
|
+
# [ 0, 0, 0, 0 ] ]
|
629
|
+
# sign = [ 1, -1, 1 ]
|
630
|
+
|
631
|
+
axs = Array.new(rank)
|
632
|
+
cvals.each_with_index do |cval, i|
|
633
|
+
axs[i] = cval.uniq
|
634
|
+
axs[i].sort!{|a,b| (a <=> b)*sign[i] }
|
635
|
+
end
|
636
|
+
# For the above example,
|
637
|
+
# axs = [ [ -90, 0 ], [ 1000, 500 ], [ 0 ] ]
|
638
|
+
files_new = NArray.object( *axs.map{|ax| ax.length} )
|
639
|
+
# For the above example,
|
640
|
+
# shape of the files_new is [2, 2, 1]
|
641
|
+
files.length.times do |n|
|
642
|
+
file = files[n]
|
643
|
+
idx = Array.new(rank)
|
644
|
+
rank.times do |i|
|
645
|
+
axv0 = cvals[i][n]
|
646
|
+
idx[i] = axs[i].index(axv0)
|
647
|
+
end
|
648
|
+
# For the above example,
|
649
|
+
# idx =
|
650
|
+
# [ 0, 0, 0 ] for n==0
|
651
|
+
# [ 1, 0, 0 ] for n==1
|
652
|
+
# [ 0, 1, 0 ] for n==2
|
653
|
+
# [ 1, 1, 0 ] for n==3
|
654
|
+
files_new[*idx] = file
|
655
|
+
end
|
656
|
+
if files_new.eq(nil).count_true > 0
|
657
|
+
raise "No dimension correspondence found"
|
658
|
+
end
|
659
|
+
files = files_new
|
622
660
|
|
623
661
|
files
|
624
662
|
end
|
@@ -34,6 +34,9 @@ module NumRu
|
|
34
34
|
unless NuSDaS === nusdas
|
35
35
|
raise ArgumentError, "1st arg must be a NuSDaS of path name"
|
36
36
|
end
|
37
|
+
unless (meta = nusdas.instance_variable_get(:@meta)) && meta[:nbasetime] && meta[:nbasetime] > 0
|
38
|
+
raise "NuSDaS directory is empty or nusdas_def is inconsistent with data: #{nusdas.path}"
|
39
|
+
end
|
37
40
|
|
38
41
|
var = nusdas.var(varname)
|
39
42
|
var.nil? && raise("#{varname} is not found")
|
data/lib/numru/gphys/grib.rb
CHANGED
@@ -407,6 +407,12 @@ class GPhys
|
|
407
407
|
params = PARAMS_JMA
|
408
408
|
end
|
409
409
|
end
|
410
|
+
when 200
|
411
|
+
if cid == 34 # JMA
|
412
|
+
params = PARAMS_JRA55
|
413
|
+
else
|
414
|
+
warn "parameter table version #{version}, center id #{cid} has not been defined yet"
|
415
|
+
end
|
410
416
|
else
|
411
417
|
if cid==98 # ECMWF
|
412
418
|
if version==128
|
@@ -810,7 +816,7 @@ class GPhys
|
|
810
816
|
vlat = y*1000
|
811
817
|
grid[4,3] = int2str(vlat[0],3)
|
812
818
|
grid[7,3] = int2str(vlon[0],3)
|
813
|
-
flag = 1<<7
|
819
|
+
flag = 1 << 7
|
814
820
|
grid[10,1] = uint2str(flag,1)
|
815
821
|
grid[11,3] = int2str(vlat[-1],3)
|
816
822
|
grid[14,3] = int2str(vlon[-1],3)
|
@@ -823,7 +829,7 @@ class GPhys
|
|
823
829
|
raise "not defined yet"
|
824
830
|
end
|
825
831
|
if rev
|
826
|
-
flag=1<<5
|
832
|
+
flag=1 << 5
|
827
833
|
else
|
828
834
|
flag=0
|
829
835
|
end
|
@@ -963,7 +969,7 @@ class GPhys
|
|
963
969
|
end
|
964
970
|
end
|
965
971
|
def get
|
966
|
-
@gds && uint2str(length,3)
|
972
|
+
@gds && uint2str(length,3) << @gds
|
967
973
|
end
|
968
974
|
end # end definition of class GribGDS
|
969
975
|
class GribBMS
|
@@ -1008,12 +1014,12 @@ class GPhys
|
|
1008
1014
|
def set_map(mask)
|
1009
1015
|
map,n = data2str(mask,1,1)
|
1010
1016
|
@bms[0..0] = uint2str(n,1)
|
1011
|
-
@bms = @bms[0,3]<<map
|
1017
|
+
@bms = @bms[0,3] << map
|
1012
1018
|
@sgm.is.update_total_length
|
1013
1019
|
return true
|
1014
1020
|
end
|
1015
1021
|
def get
|
1016
|
-
@bms && uint2str(length,3)
|
1022
|
+
@bms && uint2str(length,3) << @bms
|
1017
1023
|
end
|
1018
1024
|
end # end definition of class GribBMS
|
1019
1025
|
class GribBDS
|
@@ -1194,7 +1200,7 @@ class GPhys
|
|
1194
1200
|
@efactor = 2.0**str2int2( @sgm.file.read(2) )
|
1195
1201
|
return @efactor
|
1196
1202
|
end
|
1197
|
-
def value(shape
|
1203
|
+
def value(shape,index=nil)
|
1198
1204
|
nbits_unuse = oct4&15
|
1199
1205
|
@sgm.file.seek(@pos+7, ::IO::SEEK_SET)
|
1200
1206
|
nbits_pack = @sgm.file.read(1).to_uint1
|
@@ -1215,8 +1221,7 @@ class GPhys
|
|
1215
1221
|
nlen = ((length-3-8)*8-nbits_unuse)/nbits_pack
|
1216
1222
|
nlon,nlat = shape
|
1217
1223
|
(nlon*nlat)==nlen+nmiss || raise("length is not collect")
|
1218
|
-
if
|
1219
|
-
index, shape2 = arg
|
1224
|
+
if index
|
1220
1225
|
index = index.collect{|el| Fixnum===el ? el..el : el}
|
1221
1226
|
il = index[0]
|
1222
1227
|
i0 = il.first
|
@@ -1230,10 +1235,10 @@ class GPhys
|
|
1230
1235
|
i0 = i0 < 0 ? nlat+i0 : i0
|
1231
1236
|
i1 = i1 < 0 ? nlat+i1 : i1
|
1232
1237
|
index[1] = il.exclude_end? ? i0...i1 : i0..i1
|
1233
|
-
j = nil
|
1234
|
-
i = nil
|
1238
|
+
#j = nil
|
1239
|
+
#i = nil
|
1235
1240
|
if map
|
1236
|
-
var = NArrayMiss.sfloat(
|
1241
|
+
var = NArrayMiss.sfloat(index[0].count, index[1].count)
|
1237
1242
|
map.reshape!(nlon,nlat)
|
1238
1243
|
mask = map[*index]
|
1239
1244
|
nd = mask.count_true
|
@@ -1323,13 +1328,13 @@ class GPhys
|
|
1323
1328
|
a = 127 if a>127
|
1324
1329
|
b = ref*2**24*16**(64-a)
|
1325
1330
|
a = a*s
|
1326
|
-
@bds[3,4] = int2str(a,1)<<uint2str(b,3)
|
1331
|
+
@bds[3,4] = int2str(a,1) << uint2str(b,3)
|
1327
1332
|
@bds[7,1] = uint2str(nbits,1)
|
1328
|
-
@bds = @bds[0,8]<<str
|
1333
|
+
@bds = @bds[0,8] << str
|
1329
1334
|
@sgm.is.update_total_length
|
1330
1335
|
end
|
1331
1336
|
def get
|
1332
|
-
uint2str(length,3)
|
1337
|
+
uint2str(length,3) << @bds
|
1333
1338
|
end
|
1334
1339
|
end # end definition of class GribBDS
|
1335
1340
|
class GribES
|
@@ -1366,7 +1371,7 @@ class GPhys
|
|
1366
1371
|
|
1367
1372
|
public
|
1368
1373
|
=begin
|
1369
|
-
=NumRu::Grib -- a class for Grib datasets
|
1374
|
+
=NumRu::GPhys::Grib -- a class for Grib datasets
|
1370
1375
|
|
1371
1376
|
==Class Methods
|
1372
1377
|
---Grib.new(filename, mode="r")
|
@@ -1555,7 +1560,7 @@ class GPhys
|
|
1555
1560
|
end # end of definition of class Grib
|
1556
1561
|
|
1557
1562
|
=begin
|
1558
|
-
=NumRu::GribDim
|
1563
|
+
=NumRu::GPhys::GribDim
|
1559
1564
|
|
1560
1565
|
==Class Methods
|
1561
1566
|
---new( vat, name, length )
|
@@ -1611,10 +1616,25 @@ class GPhys
|
|
1611
1616
|
return @ary
|
1612
1617
|
end
|
1613
1618
|
end
|
1614
|
-
def [](
|
1615
|
-
|
1619
|
+
def [](ind)
|
1620
|
+
v = val
|
1621
|
+
if Hash === ind # {range=>step} --> array of indices
|
1622
|
+
ran, step = ind.to_a[0]
|
1623
|
+
dlen = v.length
|
1624
|
+
f = ran.first
|
1625
|
+
f += dlen if f<0
|
1626
|
+
e = ran.end
|
1627
|
+
e += dlen if e<0
|
1628
|
+
e -= 1 if ran.exclude_end?
|
1629
|
+
ind = Array.new
|
1630
|
+
(f..e).step(step){|n| ind.push(n)}
|
1631
|
+
end
|
1632
|
+
return v[ind]
|
1616
1633
|
end
|
1617
1634
|
def put(ary)
|
1635
|
+
if ary.typecode <= NArray::INT # 2014-09-22 horinouchi
|
1636
|
+
ary = ary.to_type(NArray::DFLOAT)
|
1637
|
+
end
|
1618
1638
|
@ary = ary
|
1619
1639
|
@length = val.length
|
1620
1640
|
return @ary
|
@@ -1635,9 +1655,13 @@ class GPhys
|
|
1635
1655
|
end
|
1636
1656
|
|
1637
1657
|
=begin
|
1638
|
-
=NumRu::GribVar
|
1658
|
+
=NumRu::GPhys::GribVar
|
1639
1659
|
|
1640
1660
|
==Class Methods
|
1661
|
+
---always_time_seq=(t_or_f)
|
1662
|
+
If true is given, a GribVar will always have a time dimension,
|
1663
|
+
even when the time is unique (i.e., length of the time coordinate is 1).
|
1664
|
+
|
1641
1665
|
---new( file, name, obj, dims )
|
1642
1666
|
|
1643
1667
|
==Methods
|
@@ -1666,6 +1690,15 @@ class GPhys
|
|
1666
1690
|
include GribUtils
|
1667
1691
|
class << self
|
1668
1692
|
include GribUtils
|
1693
|
+
|
1694
|
+
@@always_time_seq = false
|
1695
|
+
def always_time_seq=(t_or_f)
|
1696
|
+
@@always_time_seq = t_or_f
|
1697
|
+
end
|
1698
|
+
def always_time_seq
|
1699
|
+
@@always_time_seq
|
1700
|
+
end
|
1701
|
+
|
1669
1702
|
private
|
1670
1703
|
def vars_same?(var1,var2)
|
1671
1704
|
pds1 = var1.pds
|
@@ -1816,7 +1849,7 @@ class GPhys
|
|
1816
1849
|
# time.push( get_time(sgm.pds.date) )
|
1817
1850
|
# }
|
1818
1851
|
time.uniq!
|
1819
|
-
if time.length>1
|
1852
|
+
if @@always_time_seq or time.length>1
|
1820
1853
|
time = NArray.to_na(time)
|
1821
1854
|
d = va.def_dim("time",-1)
|
1822
1855
|
d.put(time)
|
@@ -1909,55 +1942,96 @@ class GPhys
|
|
1909
1942
|
return @obj[*indices]
|
1910
1943
|
else
|
1911
1944
|
sha = shape
|
1945
|
+
ndims = sha.length
|
1946
|
+
after_slice = false
|
1947
|
+
dimdel = nil
|
1912
1948
|
if indices.length!=0
|
1949
|
+
after_slicer = Array.new(2,true)
|
1950
|
+
imap = (3..ndims).collect{Hash.new} # index map org-->current for z,t
|
1913
1951
|
if indices[0] == false
|
1914
|
-
indices[0] = [true]*(
|
1952
|
+
indices[0] = [true]*(ndims-indices.length+1)
|
1915
1953
|
elsif indices[-1] == false
|
1916
|
-
indices[-1] = [true]*(
|
1954
|
+
indices[-1] = [true]*(ndims-indices.length+1)
|
1917
1955
|
elsif indices.include?(false)
|
1918
1956
|
raise "invalid indices"
|
1919
|
-
elsif
|
1957
|
+
elsif ndims!=indices.length
|
1920
1958
|
raise "invalid indices"
|
1921
1959
|
end
|
1922
|
-
|
1960
|
+
dimdel = []
|
1961
|
+
ndims.times{|n|
|
1923
1962
|
ind = indices[n]
|
1924
|
-
|
1925
|
-
|
1963
|
+
dlen = sha[n]
|
1964
|
+
case ind
|
1965
|
+
when true
|
1966
|
+
if n<=1
|
1967
|
+
indices[n] = 0..dlen-1
|
1968
|
+
else
|
1969
|
+
(0..dlen-1).each{|i| imap[n-2][i] = i}
|
1970
|
+
end
|
1926
1971
|
next
|
1927
|
-
|
1972
|
+
when Fixnum
|
1928
1973
|
sha[n] = 1
|
1974
|
+
imap[n-2][ind] = 0
|
1975
|
+
dimdel.push(n)
|
1929
1976
|
next
|
1930
|
-
|
1977
|
+
when Range
|
1931
1978
|
f = ind.first
|
1979
|
+
f += dlen if f<0
|
1932
1980
|
e = ind.end
|
1933
|
-
e
|
1981
|
+
e += dlen if e<0
|
1934
1982
|
e -= 1 if ind.exclude_end?
|
1935
1983
|
sha[n] = e-f+1
|
1936
|
-
|
1984
|
+
if n<=1
|
1985
|
+
indices[n] = f..e
|
1986
|
+
else
|
1987
|
+
(f..e).each{|i| imap[n-2][i] = i-f}
|
1988
|
+
end
|
1937
1989
|
next
|
1990
|
+
when Hash
|
1991
|
+
ran, step = ind.to_a[0]
|
1992
|
+
f = ran.first
|
1993
|
+
f += dlen if f<0
|
1994
|
+
e = ran.end
|
1995
|
+
e += dlen if e<0
|
1996
|
+
e -= 1 if ran.exclude_end?
|
1997
|
+
sha[n] = (e-f)/step + 1
|
1998
|
+
if n<=1
|
1999
|
+
indices[n] = f..e
|
2000
|
+
after_slice = true
|
2001
|
+
after_slicer[n] = (0...sha[n]).collect{|i| i*step}
|
2002
|
+
else
|
2003
|
+
ia = NArray.int(sha[n]).indgen! * step + f
|
2004
|
+
indices[n] = NArray.to_na(ia)
|
2005
|
+
j=0
|
2006
|
+
(f..e).step(step){|i| imap[n-2][i] = j; j+=1} if n>=2
|
2007
|
+
end
|
2008
|
+
next
|
2009
|
+
when Array, NArray
|
2010
|
+
ind = ind.collect{|i|
|
2011
|
+
raise("Array indices must be integers") unless Integer===i
|
2012
|
+
i>=0 ? i : i+dlen
|
2013
|
+
}
|
2014
|
+
sha[n] = ind.length
|
2015
|
+
if n<=1
|
2016
|
+
f = ind.min
|
2017
|
+
e = ind.max
|
2018
|
+
indices[n] = f..e
|
2019
|
+
after_slice = true
|
2020
|
+
after_slicer[n] = ind.collect{|i| i-f}
|
2021
|
+
else
|
2022
|
+
(0...ind.length).each{|i| imap[n-2][ind[i]] = i }
|
2023
|
+
end
|
1938
2024
|
else
|
1939
2025
|
raise "invalid indices"
|
1940
2026
|
end
|
1941
2027
|
}
|
1942
2028
|
if rank>2
|
1943
|
-
|
1944
|
-
mask[*indices[2..-1]]= 1
|
1945
|
-
first = Array.new(indices.length-2)
|
1946
|
-
first.length.times{|i|
|
1947
|
-
ind = indices[2+i]
|
1948
|
-
if Fixnum===ind
|
1949
|
-
first[i] = ind < 0 ? shape[2+i]+ind : ind
|
1950
|
-
elsif Range===ind
|
1951
|
-
first[i] = ind.first
|
1952
|
-
else
|
1953
|
-
raise "invalid indices"
|
1954
|
-
end
|
1955
|
-
}
|
2029
|
+
subsetzt = true
|
1956
2030
|
else
|
1957
|
-
|
2031
|
+
subsetzt = false
|
1958
2032
|
end
|
1959
2033
|
else
|
1960
|
-
|
2034
|
+
subsetzt = false
|
1961
2035
|
end
|
1962
2036
|
value = @miss ? NArrayMiss.sfloat(*sha) : NArray.sfloat(*sha)
|
1963
2037
|
if rank==2
|
@@ -1985,24 +2059,29 @@ class GPhys
|
|
1985
2059
|
if vt
|
1986
2060
|
index[-1] = vt.eq(get_time(pds.date)).where[0]
|
1987
2061
|
end
|
1988
|
-
|
2062
|
+
if subsetzt
|
2063
|
+
to_read = true
|
2064
|
+
index.each_with_index{|i,d| to_read &&= imap[d][i]}
|
2065
|
+
next unless to_read
|
2066
|
+
end
|
1989
2067
|
bds = sgm.bds
|
1990
2068
|
if indices.length==0 || (indices[0]==true&&indices[1]==true)
|
1991
2069
|
val = bds.value(shape[0..1])
|
1992
2070
|
else
|
1993
|
-
val = bds.value(shape[0..1],indices[0..1]
|
2071
|
+
val = bds.value(shape[0..1],indices[0..1])
|
1994
2072
|
end
|
1995
2073
|
d = pds.dfact
|
1996
2074
|
val = val*10.0**(-d)
|
1997
|
-
|
1998
|
-
|
1999
|
-
index
|
2000
|
-
|
2001
|
-
|
2075
|
+
val = val[*after_slicer] if after_slice
|
2076
|
+
if !subsetzt
|
2077
|
+
idx = index
|
2078
|
+
else
|
2079
|
+
idx = []
|
2080
|
+
index.each_with_index{|i,d| idx.push(imap[d][i])}
|
2002
2081
|
end
|
2003
|
-
value[true,true,*
|
2082
|
+
value[true,true,*idx] = val
|
2004
2083
|
}
|
2005
|
-
sha.
|
2084
|
+
dimdel.reverse_each{|d| sha.delete_at(d)} if dimdel
|
2006
2085
|
value.reshape!(*sha)
|
2007
2086
|
return value
|
2008
2087
|
end
|