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/doc/gphys_fft.html
ADDED
@@ -0,0 +1,324 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
+
<head>
|
7
|
+
<title>../lib/numru/gphys/gphys_fft.rb</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<h1><a name="label-0" id="label-0">extension of class NumRu::GPhys -- Fast Fourier transformation and its applications</a></h1><!-- RDLabel: "extension of class NumRu::GPhys ­­ Fast Fourier transformation and its applications" -->
|
11
|
+
<p>This manual documents the methods of NumRu::GPhys defined in gphys_fft.rb</p>
|
12
|
+
<h1><a name="label-1" id="label-1">class methods</a></h1><!-- RDLabel: "class methods" -->
|
13
|
+
<dl>
|
14
|
+
<dt><h4><a name="label-2" id="label-2"><code>GPhys::fft_ignore_missing( <var>ignore</var>=<var>true</var>, <var>replace_val</var>=<var>nil</var> )</code></a></h4></dt><!-- RDLabel: "GPhys::fft_ignore_missing" -->
|
15
|
+
<dd>
|
16
|
+
Set a flag (class variable) to ignore missing values.
|
17
|
+
This is for data that do not have missing
|
18
|
+
but is treated as potentially having missing (often
|
19
|
+
by having the valid_* attributes of NetCDF.)
|
20
|
+
If replace_val is specified, data missing with replaced
|
21
|
+
with that value.</dd>
|
22
|
+
</dl>
|
23
|
+
<h1><a name="label-3" id="label-3">methods</a></h1><!-- RDLabel: "methods" -->
|
24
|
+
<dl>
|
25
|
+
<dt><h4><a name="label-4" id="label-4"><code>fft(<var>backward</var>=<var>false</var>, *<var>dims</var>)</code></a></h4></dt><!-- RDLabel: "fft" -->
|
26
|
+
<dd>
|
27
|
+
<p>Fast Fourier Transformation (FFT) by using
|
28
|
+
(<a href="http://www.fftw.org">FFTW</a>) ver 3 or ver 2.
|
29
|
+
A FFTW ver.2 interface is included in NArray, while
|
30
|
+
to use FFTW ver.3, you have to install separately.
|
31
|
+
Dimension specification by the argument dims is available
|
32
|
+
only with ver.3. By default, FFT is applied to all dimensions.</p>
|
33
|
+
<p>The transformation is complex. If the input data is not complex,
|
34
|
+
it will be coerced to complex before transformation.</p>
|
35
|
+
<p>When the FT is forward, the result is normalized
|
36
|
+
(i.e., divided by the data number), unlike the default behavior of
|
37
|
+
FFTW.</p>
|
38
|
+
<p>Each coordinate is assumed to be equally spaced without checking.
|
39
|
+
The new coordinate variables will be set equal to wavenumbers,
|
40
|
+
derived as 2*PI/(length of the axis)*[0,1,2,..], where the length
|
41
|
+
of the axis is derived as (coord.val.max - coord.val.min)*(n+1)/n.</p>
|
42
|
+
<p>REMARK</p>
|
43
|
+
<ul>
|
44
|
+
<li>If the units of the original coordinate is degree (or its
|
45
|
+
equivalent ones such as degrees_east), the wavenumber was
|
46
|
+
made in integers by converting the coordinate based on
|
47
|
+
radian.</li>
|
48
|
+
</ul>
|
49
|
+
<p>ARGUMENTS</p>
|
50
|
+
<ul>
|
51
|
+
<li>backward (true of false) : when true, backward FT is done;
|
52
|
+
otherwise forward FT is done.</li>
|
53
|
+
<li>dims (integers) : dimensions to apply FFT</li>
|
54
|
+
</ul>
|
55
|
+
<p>RETURN VALUE</p>
|
56
|
+
<ul>
|
57
|
+
<li>a GPhys</li>
|
58
|
+
</ul>
|
59
|
+
<p>EXAMPLE</p>
|
60
|
+
<pre>gphy.fft # forward, for all dimensions
|
61
|
+
gphy.fft(true) # backward, for all dimensions
|
62
|
+
gphy.fft(nil, 0,1) # forward, for the first and second dimensions.
|
63
|
+
gphy.fft(true, -1) # backward, for the last dimension.</pre></dd>
|
64
|
+
<dt><h4><a name="label-5" id="label-5"><code>detrend(<var>dim1</var>[,<var>dim2</var>[,...]])</code></a></h4></dt><!-- RDLabel: "detrend" -->
|
65
|
+
<dd>
|
66
|
+
<p>Remove means and linear trends along dimension(s) specified.
|
67
|
+
Algorithm: 1st order polynomial fitting.</p>
|
68
|
+
<p>ARGUMENTS</p>
|
69
|
+
<ul>
|
70
|
+
<li>dim? (Integer of String): the dimension along which you want to remove
|
71
|
+
trends.</li>
|
72
|
+
</ul>
|
73
|
+
<p>RETURN VALUE</p>
|
74
|
+
<ul>
|
75
|
+
<li>a GPhys</li>
|
76
|
+
</ul>
|
77
|
+
<p>EXAMPLE</p>
|
78
|
+
<ul>
|
79
|
+
<li>See <a href="#label-5">detrend</a>.</li>
|
80
|
+
</ul></dd>
|
81
|
+
<dt><h4><a name="label-6" id="label-6"><code>cos_taper(<var>dim1</var>[,<var>dim2</var>[,...]])</code></a></h4></dt><!-- RDLabel: "cos_taper" -->
|
82
|
+
<dd>
|
83
|
+
<p>Cosine tapering along dimension(s) specified.</p>
|
84
|
+
<p>Algorithm: to multiply with the half cosine curves at the both
|
85
|
+
1/10 ends of the data.</p>
|
86
|
+
<pre>cos taper shape:
|
87
|
+
_____________
|
88
|
+
_/ \_
|
89
|
+
-> <- -> <-
|
90
|
+
T/10 T/10
|
91
|
+
half-cosine half-cosine
|
92
|
+
shaped shaped</pre>
|
93
|
+
<p>The spectra of tapered data should be multiplied by 1/0.875,
|
94
|
+
which is stored as GPhys::COS_TAPER_SP_FACTOR (==1/0.875).</p>
|
95
|
+
<p>ARGUMENTS</p>
|
96
|
+
<ul>
|
97
|
+
<li>dim? (Integer of String): the dimension along which you want to remove
|
98
|
+
trends.</li>
|
99
|
+
</ul>
|
100
|
+
<p>RETURN VALUE</p>
|
101
|
+
<ul>
|
102
|
+
<li>a GPhys</li>
|
103
|
+
</ul>
|
104
|
+
<p>EXAMPLE</p>
|
105
|
+
<pre>dim = 0 # for the 1st dimension
|
106
|
+
fc = gphys.detrend(dim).cos_taper(dim).fft(nil,dim)
|
107
|
+
sp = fc.abs**2 * GPhys::COS_TAPER_SP_FACTOR</pre></dd>
|
108
|
+
<dt><h4><a name="label-7" id="label-7"><code>spect_zero_centering(<var>dim</var>)</code></a></h4></dt><!-- RDLabel: "spect_zero_centering" -->
|
109
|
+
<dd>
|
110
|
+
<p>Shifts the wavenumber axis to cover from -K/2 to K/2 instead of
|
111
|
+
from 0 to K-1, where the wavenumber is symbolically treated as integer,
|
112
|
+
which is actually not the case, though. Since the first (-K/2) and
|
113
|
+
the last (K/2) elements are duplicated, both are divided by 2.
|
114
|
+
Therefore, this method is to be used for spectra (squared quantity)
|
115
|
+
rather than the raw Fourier coefficients. (That is why the method name
|
116
|
+
is prefixed by "spect_").</p>
|
117
|
+
<p>The method is applied for a single dimension (specified by the argument
|
118
|
+
dim). If you need to apply for multiple dimensions, use it for multiple
|
119
|
+
times.</p>
|
120
|
+
<p>ARGUMENTS</p>
|
121
|
+
<ul>
|
122
|
+
<li>dim (integer): the dimension you want to shift spectra elements.
|
123
|
+
Count starts from zero.</li>
|
124
|
+
</ul>
|
125
|
+
<p>RETURN VALUE</p>
|
126
|
+
<ul>
|
127
|
+
<li>a GPhys</li>
|
128
|
+
</ul>
|
129
|
+
<p>EXAMPLE</p>
|
130
|
+
<ul>
|
131
|
+
<li><p>To get a spectra of a variable var along the 1st and 2nd dimensions:</p>
|
132
|
+
<pre>fc = var.fft(nil, 0,1) # --> Fourier coef
|
133
|
+
sp = ( fc.abs**2 ).spect_zero_centering(0).spect_zero_centering(1)</pre>
|
134
|
+
<p>Note that spect_zero_centering is applied after taking |fc|^2.</p></li>
|
135
|
+
<li><p>Same but if you want to have the 2nd dimension one-sided:</p>
|
136
|
+
<pre>fc = var.fft(nil, 0,1)
|
137
|
+
sp = ( fc.abs**2 ).spect_zero_centering(0).spect_one_sided(1)</pre></li>
|
138
|
+
<li><p>Similar to the first example but for cross spectra:</p>
|
139
|
+
<pre>fc1 = var1.fft(nil, 0,1)
|
140
|
+
fc2 = var2.fft(nil, 0,1)
|
141
|
+
xsp = (fc1 * fc2.conj).spect_zero_centering(0).spect_zero_centering(1)</pre></li>
|
142
|
+
</ul></dd>
|
143
|
+
<dt><h4><a name="label-8" id="label-8"><code>spect_one_sided(<var>dim</var>)</code></a></h4></dt><!-- RDLabel: "spect_one_sided" -->
|
144
|
+
<dd>
|
145
|
+
<p>Similar to <a href="#label-7">spect_zero_centering</a> but to make one-sided spectra.
|
146
|
+
Namely, to convert from 0..K-1 to 0..K/2. To be applied for spectra;
|
147
|
+
wavenumber 2..K/2-1 are multiplied by 2.</p>
|
148
|
+
<p>ARGUMENTS</p>
|
149
|
+
<ul>
|
150
|
+
<li>dim (integer): the dimension you want to shift spectra elements.
|
151
|
+
Count starts from zero.</li>
|
152
|
+
</ul>
|
153
|
+
<p>RETURN VALUE</p>
|
154
|
+
<ul>
|
155
|
+
<li>a GPhys</li>
|
156
|
+
</ul>
|
157
|
+
<p>EXAMPLE</p>
|
158
|
+
<ul>
|
159
|
+
<li>See the 2nd example of <a href="#label-7">spect_zero_centering</a>.</li>
|
160
|
+
</ul></dd>
|
161
|
+
<dt><h4><a name="label-9" id="label-9"><code>rawspect2powerspect(*<var>dims</var>)</code></a></h4></dt><!-- RDLabel: "rawspect2powerspect" -->
|
162
|
+
<dd>
|
163
|
+
<p>Converts raw spectra obtained by gphys.fft.abs**2 into
|
164
|
+
power spectra by dividing by wavenumber increments
|
165
|
+
along the dimensions specified by dims.</p>
|
166
|
+
<p>ARGUMENTS</p>
|
167
|
+
<ul>
|
168
|
+
<li>dims (integers): the dimensions corresponding to wavenumbers.</li>
|
169
|
+
</ul>
|
170
|
+
<p>RETURN VALUE</p>
|
171
|
+
<ul>
|
172
|
+
<li>a GPhys</li>
|
173
|
+
</ul>
|
174
|
+
<p>EXAMPLE</p>
|
175
|
+
<ul>
|
176
|
+
<li><p>Suppose a 2 (or more) dimensional data gphys.</p>
|
177
|
+
<pre>fc = gphys.fft(nil, 0, 1)
|
178
|
+
sp = fc.abs**2
|
179
|
+
ps = sp.rawspect2powerspect(0,1)</pre>
|
180
|
+
<p>Here, sp is the raw spectrum of gphys, and ps is the power spectrum.
|
181
|
+
The Parseval relation for them are as follows:</p>
|
182
|
+
<pre>(gphys**2).mean == sp.sum
|
183
|
+
== pw.sum*dk*dl (== \int pw dk dl, mathematically),</pre>
|
184
|
+
<p>where, dk = (pw.coord(0)[1] - pw.coord(0)[0]), and
|
185
|
+
dl = (pw.coord(1)[1] - pw.coord(1)[0]).</p></li>
|
186
|
+
</ul></dd>
|
187
|
+
<dt><h4><a name="label-10" id="label-10"><code>phase_velocity_filter(<var>xdim</var>, <var>tdim</var>, <var>cmin</var>=<var>nil</var>, <var>cmax</var>=<var>nil</var>, <var>xconv</var>=<var>nil</var>, <var>tconv</var>=<var>nil</var>, <var>remove_xtmean</var>=<var>false</var>)</code></a></h4></dt><!-- RDLabel: "phase_velocity_filter" -->
|
188
|
+
<dd>
|
189
|
+
<p>Filtering by phase velocity (between cmin and cmax)</p>
|
190
|
+
<p>REMARKS</p>
|
191
|
+
<ul>
|
192
|
+
<li>If the number of the grid points along x or t is an even number,
|
193
|
+
the maximum wavenumber or frequency is treated as positive
|
194
|
+
and negative, respectively, which results in an asymmetry of
|
195
|
+
the treatment of positive and negative phase speeds.
|
196
|
+
(That should be ok. -- In case its effect is significant,
|
197
|
+
to do the filtering itself is not meaningful.)</li>
|
198
|
+
</ul>
|
199
|
+
<p>ARGUMENTS</p>
|
200
|
+
<ul>
|
201
|
+
<li>xdim (Integer or String): spacial dimension</li>
|
202
|
+
<li>tdim (Integer or String): time dimension</li>
|
203
|
+
<li>cmin (Float or nil): minimum phase velocity. nil means no specification.
|
204
|
+
(at least cmin or cmax must be given by Float)</li>
|
205
|
+
<li>cmax (Float or nil): maximum phase velocity. nil means no specification.
|
206
|
+
(at least cmin or cmax must be given by Float)</li>
|
207
|
+
<li>xconv (nil or UNumeric) : (optional) if given, xconv is multiplied
|
208
|
+
with the x axis before computing the phase velocity
|
209
|
+
(kconv=1/xconv is used to scale wavenumbers)</li>
|
210
|
+
<li>tconv (nil or UNumeric) : (optional) if given, tconv is multiplied
|
211
|
+
with the t axis before computing the phase velocity
|
212
|
+
(fconv=1/tconv is used to scale frequency)</li>
|
213
|
+
<li>remove_xtmean (false or true) : if false (default),
|
214
|
+
components with k=0 and f=0 are counted as c=0 (stationary),
|
215
|
+
(unlike <a href="#label-12">phase_velocity_binning</a>), so they are included if
|
216
|
+
cmin*cmax <= 0; if true, k=0 & f=0 components are always removed.</li>
|
217
|
+
</ul>
|
218
|
+
<p>RETURN VALUE</p>
|
219
|
+
<ul>
|
220
|
+
<li>a GPhys</li>
|
221
|
+
</ul>
|
222
|
+
<p>EXAMPLE</p>
|
223
|
+
<ul>
|
224
|
+
<li><p>For a 4D data with [x,y,z,t] dimensions, filtering by the phase
|
225
|
+
velocity in the y dimension greater than 10.0 (in the unit
|
226
|
+
of y/t) can be made by</p>
|
227
|
+
<pre>cmin = 10.0; cmax = nil
|
228
|
+
gpfilt = gp.phase_velocity_filter(1, 3, cmin, cmax)</pre></li>
|
229
|
+
<li><p>For a global data (on the Earth's surface) with
|
230
|
+
[lon, lat, z, time] axes, where the units of lon is
|
231
|
+
"degrees" (or "degrees_east" or "radian")
|
232
|
+
and the units of time is "hours", to filter disturbances
|
233
|
+
whose zonal phase speed MEASURED AT THE EQUATOR is less or
|
234
|
+
equal to 30 m/s can be made by</p>
|
235
|
+
<pre>cmin = -30.0; cmax = 30.0
|
236
|
+
xconv = UNumeric[6.37e6, "m"] # Earth's radius (i.e., m/radian)
|
237
|
+
# This is a special case since "radian" is exceptionally omitted.
|
238
|
+
# See the private method __predefined_coord_units_conversion.
|
239
|
+
tconv = UNumeric[3.6e3, "s/hours"]
|
240
|
+
gpfilt = gp.phase_velocity_filter(1, 3, cmin, cmax, xconv, tconv)</pre></li>
|
241
|
+
</ul></dd>
|
242
|
+
<dt><h4><a name="label-11" id="label-11"><code>phase_velocity_binning_iso_norml(<var>kdim</var>, <var>fdim</var>, <var>cmin</var>, <var>cmax</var>, <var>cint</var>, <var>kconv</var>=<var>nil</var>, <var>fconv</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "phase_velocity_binning_iso_norml" -->
|
243
|
+
<dd>
|
244
|
+
<p>Same as <a href="#label-12">phase_velocity_binning</a> but exclusively for
|
245
|
+
equal phase velocity spacing. Also, a normalization is
|
246
|
+
additionally made, to scale spectra in terms of integration
|
247
|
+
along phase velocity axis --- The result of
|
248
|
+
<a href="#label-12">phase_velocity_binning</a> called inside
|
249
|
+
this method is divided by cint along with corresponding
|
250
|
+
units conversion. Therefore, if this method is applied
|
251
|
+
to spectra, a normalization is made such that an integration
|
252
|
+
(not summation) along the phase velocity gives the variance
|
253
|
+
(or covariance etc.) -- This normalization is suitable to
|
254
|
+
quadratic quantities (such as spectra) but is not suitable to
|
255
|
+
raw Fourier coefficients.</p>
|
256
|
+
<p>ARGUMENTS</p>
|
257
|
+
<ul>
|
258
|
+
<li>kdim (Integer or String): see <a href="#label-12">phase_velocity_binning</a></li>
|
259
|
+
<li>fdim (Integer or String): see <a href="#label-12">phase_velocity_binning</a></li>
|
260
|
+
<li>cmin (Float) : minimum phase velocity</li>
|
261
|
+
<li>cmin (Float) : maximum phase velocity</li>
|
262
|
+
<li>cint (Float) : inter val with which the range [cmin and cmax]
|
263
|
+
is divided.</li>
|
264
|
+
<li>kconv (nil or UNumeric) : see <a href="#label-12">phase_velocity_binning</a></li>
|
265
|
+
<li>fconv (nil or UNumeric) : see <a href="#label-12">phase_velocity_binning</a></li>
|
266
|
+
</ul>
|
267
|
+
<p>RETURN VALUE</p>
|
268
|
+
<ul>
|
269
|
+
<li>a GPhys</li>
|
270
|
+
</ul></dd>
|
271
|
+
<dt><h4><a name="label-12" id="label-12"><code>phase_velocity_binning(<var>kdim</var>, <var>fdim</var>, <var>cbins</var>, <var>kconv</var>=<var>nil</var>, <var>fconv</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "phase_velocity_binning" -->
|
272
|
+
<dd>
|
273
|
+
<p>Bin a 2D spectrum in space and time based on phase velocity.
|
274
|
+
The operand (self) must be Fourier coefficients or spectra,
|
275
|
+
whose grid has not been altered since the call of the method
|
276
|
+
fft (i.e., those that have not applied with zero centering
|
277
|
+
etc, since it is done in this method).</p>
|
278
|
+
<p>Binning by this method is based on summation, leaving
|
279
|
+
the units unchanged.</p>
|
280
|
+
<p>REMARKS</p>
|
281
|
+
<ul>
|
282
|
+
<li>Components whose phase velocities are exactly equal to one
|
283
|
+
of the boundaries are divided into the two bins half by half</li>
|
284
|
+
<li>components with k=0 and f=0 are excluded -- the spatio-temporal
|
285
|
+
mean do not reflect in the result </li>
|
286
|
+
</ul>
|
287
|
+
<p>ARGUMENTS</p>
|
288
|
+
<ul>
|
289
|
+
<li>kdim (Integer or String): wavenumber dimension (from spacial dimension)</li>
|
290
|
+
<li>fdim (Integer or String): frequency dimension (from time dimension)</li>
|
291
|
+
<li>cbins : an Array of bin bounds or a Hash of max, min, int
|
292
|
+
e.g., [-10,-1,-0.1,0.1,11,10], {"min"=>-30,"max"=>30,"int"=>5}</li>
|
293
|
+
<li>kconv (nil or UNumeric) : (optional) if given, kconv is multiplied
|
294
|
+
with the wavenumber axis before computing the phase velocity</li>
|
295
|
+
<li>fconv (nil or UNumeric) : (optional) if given, fconv is multiplied
|
296
|
+
with the frequency axis before computing the phase velocity</li>
|
297
|
+
</ul>
|
298
|
+
<p>RETURN VALUE</p>
|
299
|
+
<ul>
|
300
|
+
<li>a GPhys</li>
|
301
|
+
</ul>
|
302
|
+
<p>EXAMPLES</p>
|
303
|
+
<ul>
|
304
|
+
<li><p>Example A</p>
|
305
|
+
<pre>fu = u.fft(nil, 0, 2)
|
306
|
+
cfu = fu.phase_velocity_binning(0, 2, {"min"=>-1,"max"=>1,"int"=>0.1})</pre></li>
|
307
|
+
<li><p>Example B</p>
|
308
|
+
<pre>fu = u.fft(nil, 0, 2)
|
309
|
+
pw = fu.abs**2rawspect2powerspect(0,2) # power spectrum
|
310
|
+
cbins = [-100.0, -10.0, -1.0, 1.0, 10.0, 100.0] # logarithmic spacing
|
311
|
+
cpw = pw.phase_velocity_binning(0, 2, cbins)</pre></li>
|
312
|
+
<li><p>Example C</p>
|
313
|
+
<pre>fu = u.fft(nil, 0, 3)
|
314
|
+
fv = v.fft(nil, 0, 3)
|
315
|
+
kconv = UNumeric[1/6.37e6, "m-1"]
|
316
|
+
fconv = UNumeric[1/3.6e3, "hours/s"]
|
317
|
+
fuv = (fu * fv.conj) # cross spectra
|
318
|
+
cfuv = fuv.phase_velocity_binning(0, 3, {"min"=>-50,"max"=>50,"int"=>5},
|
319
|
+
kconv, fconv)</pre></li>
|
320
|
+
</ul></dd>
|
321
|
+
</dl>
|
322
|
+
|
323
|
+
</body>
|
324
|
+
</html>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
+
<head>
|
7
|
+
<title>../lib/numru/gphys/gphys_grads_io.rb</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<h1><a name="label-0" id="label-0">module NumRu::GPhys::GrADS_IO</a></h1><!-- RDLabel: "module NumRu::GPhys::GrADS_IO" -->
|
11
|
+
<p>helps read/write GrADS-formatted data</p>
|
12
|
+
<h2><a name="label-1" id="label-1">Module functions</a></h2><!-- RDLabel: "Module functions" -->
|
13
|
+
<dl>
|
14
|
+
<dt><h4><a name="label-2" id="label-2"><code>is_a_GrADS?(<var>filename</var>)</code></a></h4></dt><!-- RDLabel: "is_a_GrADS?" -->
|
15
|
+
<dd>
|
16
|
+
<p>test whether the file is a GrADS control file.</p>
|
17
|
+
<p>ARGUMENTS</p>
|
18
|
+
<ul>
|
19
|
+
<li>filename (String): filename to test.</li>
|
20
|
+
</ul>
|
21
|
+
<p>RETURN VALUE</p>
|
22
|
+
<ul>
|
23
|
+
<li>true/false</li>
|
24
|
+
</ul></dd>
|
25
|
+
<dt><h4><a name="label-3" id="label-3"><code>open(<var>file</var>, <var>varname</var>)</code></a></h4></dt><!-- RDLabel: "open" -->
|
26
|
+
<dd>
|
27
|
+
<p>GPhys constructor from GrADS.</p>
|
28
|
+
<p>ARGUMENTS</p>
|
29
|
+
<ul>
|
30
|
+
<li>file (GrADS_Gridded or String): file to read. If string,
|
31
|
+
it must be the name (path) of a GrADS control file. </li>
|
32
|
+
<li>varname (String): name of the varible in the file, for which
|
33
|
+
a GPhys object is constructed.</li>
|
34
|
+
</ul>
|
35
|
+
<p>RETURN VALUE</p>
|
36
|
+
<ul>
|
37
|
+
<li>a GPhys</li>
|
38
|
+
</ul>
|
39
|
+
<p>EXAMPLE</p>
|
40
|
+
<ul>
|
41
|
+
<li><p>Suppose that you have a file T.jan.ctl in the currentdirectly,
|
42
|
+
and it contains a variable "T". The following creates a GPhys
|
43
|
+
object representing the variable in the file.</p>
|
44
|
+
<pre>require "numru/gphys"
|
45
|
+
include GPhys
|
46
|
+
temp = GPhys::GrADS_IO.open("T.jan.ctl","T")</pre></li>
|
47
|
+
</ul></dd>
|
48
|
+
<dt><h4><a name="label-4" id="label-4"><code>write(<var>file</var>, <var>gphys</var>, <var>name</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "write" -->
|
49
|
+
<dd>
|
50
|
+
writes a GPhys object into a GrADS file. -- !!only 4D data is supported!!</dd>
|
51
|
+
<dt><h4><a name="label-5" id="label-5"><code>var_names(<var>file</var>)</code></a></h4></dt><!-- RDLabel: "var_names" -->
|
52
|
+
<dd>
|
53
|
+
<p>ARGUMENTS</p>
|
54
|
+
<ul>
|
55
|
+
<li>file (GrADS_Gridded or String): if string,
|
56
|
+
it must be the name (path) of a GrADS control file.</li>
|
57
|
+
</ul>
|
58
|
+
<p>RETURN VALUE</p>
|
59
|
+
<ul>
|
60
|
+
<li>names of variables (Array): this return the names of variables
|
61
|
+
which the file has.</li>
|
62
|
+
</ul></dd>
|
63
|
+
<dt><h4><a name="label-6" id="label-6"><code>var_names_except_coordinates(<var>file</var>)</code></a></h4></dt><!-- RDLabel: "var_names_except_coordinates" -->
|
64
|
+
<dd>
|
65
|
+
same as var_names</dd>
|
66
|
+
</dl>
|
67
|
+
|
68
|
+
</body>
|
69
|
+
</html>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
+
<head>
|
7
|
+
<title>../lib/numru/gphys/gphys_grib_io.rb</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<h1><a name="label-0" id="label-0">module NumRu::GPhys::Grib_IO</a></h1><!-- RDLabel: "module NumRu::GPhys::Grib_IO" -->
|
11
|
+
<p>helps read Grib-formatted data</p>
|
12
|
+
<h2><a name="label-1" id="label-1">Module functions</a></h2><!-- RDLabel: "Module functions" -->
|
13
|
+
<dl>
|
14
|
+
<dt><h4><a name="label-2" id="label-2"><code>is_a_Grib? <var>filename</var>)</code></a></h4></dt><!-- RDLabel: "is_a_Grib? filename)" -->
|
15
|
+
<dd>
|
16
|
+
<p>test whether the file is a Grib file.</p>
|
17
|
+
<p>ARGUMENTS</p>
|
18
|
+
<ul>
|
19
|
+
<li>filename (String): filename to test.</li>
|
20
|
+
</ul>
|
21
|
+
<p>RETURN VALUE</p>
|
22
|
+
<ul>
|
23
|
+
<li>true/false</li>
|
24
|
+
</ul></dd>
|
25
|
+
<dt><h4><a name="label-3" id="label-3"><code>open(<var>file</var>, <var>varname</var>)</code></a></h4></dt><!-- RDLabel: "open" -->
|
26
|
+
<dd>
|
27
|
+
<p>GPhys constructor from Grib.</p>
|
28
|
+
<p>ARGUMENTS</p>
|
29
|
+
<ul>
|
30
|
+
<li>file (Grib or String): file to read. If string,
|
31
|
+
it must be the name (path) of a Grib file. </li>
|
32
|
+
<li>varname (String): name of the varible in the file, for which
|
33
|
+
a GPhys object is constructed.</li>
|
34
|
+
</ul>
|
35
|
+
<p>RETURN VALUE</p>
|
36
|
+
<ul>
|
37
|
+
<li>a GPhys</li>
|
38
|
+
</ul>
|
39
|
+
<p>EXAMPLE</p>
|
40
|
+
<ul>
|
41
|
+
<li><p>Suppose that you have a file temp in the currentdirectly,
|
42
|
+
and it contains a variable "T". The following creates a GPhys
|
43
|
+
object representing the variable in the file.</p>
|
44
|
+
<pre>require "numru/gphys"
|
45
|
+
include GPhys
|
46
|
+
temp = GPhys::Grib_IO.open("temp","T")</pre></li>
|
47
|
+
</ul></dd>
|
48
|
+
<dt><h4><a name="label-4" id="label-4"><code>write(<var>file</var>, <var>gphys</var>, <var>name_dummy</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "write" -->
|
49
|
+
<dd>
|
50
|
+
<p>Write a GPhys into a Grib file. The whole data under the GPhys
|
51
|
+
(such as coordinate vars) are written self-descriptively.</p>
|
52
|
+
<p>ARGUMENTS</p>
|
53
|
+
<ul>
|
54
|
+
<li>file (Grib): the Grib file to write in. Must be writable of course.</li>
|
55
|
+
<li>gphys (GPhys): the GPhys to write.</li>
|
56
|
+
<li>name_dummy (nil) : Unused in this module; Just for consistency with others.</li>
|
57
|
+
</ul>
|
58
|
+
<p>RETURN VALUE</p>
|
59
|
+
<ul>
|
60
|
+
<li>nil</li>
|
61
|
+
</ul></dd>
|
62
|
+
<dt><h4><a name="label-5" id="label-5"><code>var_names(<var>file</var>)</code></a></h4></dt><!-- RDLabel: "var_names" -->
|
63
|
+
<dd>
|
64
|
+
<p>ARGUMENTS</p>
|
65
|
+
<ul>
|
66
|
+
<li>file (Grib or String): if string,
|
67
|
+
it must be the name (path) of a Grib file.</li>
|
68
|
+
</ul>
|
69
|
+
<p>RETURN VALUE</p>
|
70
|
+
<ul>
|
71
|
+
<li>names of variables (Array): this return the names of variables
|
72
|
+
which the file has.</li>
|
73
|
+
</ul></dd>
|
74
|
+
<dt><h4><a name="label-6" id="label-6"><code>var_names_except_coordinates(<var>file</var>)</code></a></h4></dt><!-- RDLabel: "var_names_except_coordinates" -->
|
75
|
+
<dd>
|
76
|
+
<ul>
|
77
|
+
<li>same as var_names</li>
|
78
|
+
</ul></dd>
|
79
|
+
</dl>
|
80
|
+
|
81
|
+
</body>
|
82
|
+
</html>
|