gphys 1.1.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/ChangeLog +221 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +18 -30
- data/README +23 -26
- data/README.md +29 -0
- data/Rakefile +1 -56
- data/bin/gpaop +2 -1
- data/bin/gpcut +3 -2
- data/bin/gpedit +6 -2
- data/bin/gpmath +3 -2
- data/bin/gpmaxmin +3 -2
- data/bin/gpprint +2 -1
- data/bin/gpvect +28 -5
- data/bin/gpview +43 -5
- data/extconf.rb +5 -6
- data/gphys.gemspec +34 -0
- data/interpo.c +63 -24
- data/lib/gphys.rb +2 -0
- data/lib/numru/dclext.rb +2636 -0
- data/lib/numru/derivative.rb +53 -12
- data/lib/numru/ganalysis/eof.rb +4 -0
- data/lib/numru/ganalysis/histogram.rb +73 -5
- data/lib/numru/ganalysis/met.rb +163 -2
- data/lib/numru/ganalysis/planet.rb +230 -20
- data/lib/numru/ggraph.rb +147 -2247
- data/lib/numru/gphys/assoccoords.rb +19 -3
- data/lib/numru/gphys/axis.rb +1 -1
- data/lib/numru/gphys/coordmapping.rb +2 -2
- data/lib/numru/gphys/derivative.rb +56 -13
- data/lib/numru/gphys/gphys.rb +17 -1
- data/lib/numru/gphys/gphys_grads_io.rb +6 -5
- data/lib/numru/gphys/gphys_grib_io.rb +6 -6
- data/lib/numru/gphys/gphys_io.rb +25 -6
- data/lib/numru/gphys/grads_gridded.rb +31 -29
- data/lib/numru/gphys/grib.rb +13 -9
- data/lib/numru/gphys/interpolate.rb +153 -29
- data/lib/numru/gphys/unumeric.rb +29 -6
- data/lib/numru/gphys/varray.rb +9 -0
- data/lib/numru/gphys/varraygrib.rb +70 -8
- data/lib/version.rb +3 -0
- metadata +247 -531
- data/doc/attribute.html +0 -19
- data/doc/attributenetcdf.html +0 -15
- data/doc/axis.html +0 -376
- data/doc/coordmapping.html +0 -111
- data/doc/coordtransform.html +0 -36
- data/doc/derivative/gphys-derivative.html +0 -80
- data/doc/derivative/index.html +0 -21
- data/doc/derivative/index.rd +0 -14
- data/doc/derivative/math-doc/document/document.css +0 -30
- data/doc/derivative/math-doc/document/document.html +0 -57
- data/doc/derivative/math-doc/document/images.aux +0 -1
- data/doc/derivative/math-doc/document/images.log +0 -385
- data/doc/derivative/math-doc/document/images.pl +0 -186
- data/doc/derivative/math-doc/document/images.tex +0 -364
- 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 +0 -57
- data/doc/derivative/math-doc/document/labels.pl +0 -13
- 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 +0 -238
- data/doc/derivative/math-doc/document/node2.html +0 -75
- data/doc/derivative/math-doc/document/prev.png +0 -0
- data/doc/derivative/math-doc/document/prev_g.png +0 -0
- data/doc/derivative/math-doc/document/up.png +0 -0
- data/doc/derivative/math-doc/document/up_g.png +0 -0
- data/doc/derivative/math-doc/document.pdf +0 -0
- data/doc/derivative/math-doc/document.tex +0 -158
- data/doc/derivative/numru-derivative.html +0 -129
- data/doc/ep_flux/ep_flux.html +0 -469
- data/doc/ep_flux/ggraph_on_merdional_section.html +0 -71
- data/doc/ep_flux/index.html +0 -31
- data/doc/ep_flux/index.rd +0 -24
- data/doc/ep_flux/math-doc/document/WARNINGS +0 -1
- 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 +0 -30
- data/doc/ep_flux/math-doc/document/document.html +0 -101
- data/doc/ep_flux/math-doc/document/images.aux +0 -1
- data/doc/ep_flux/math-doc/document/images.log +0 -1375
- data/doc/ep_flux/math-doc/document/images.pl +0 -1328
- data/doc/ep_flux/math-doc/document/images.tex +0 -1471
- 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 +0 -101
- data/doc/ep_flux/math-doc/document/internals.pl +0 -258
- data/doc/ep_flux/math-doc/document/labels.pl +0 -265
- 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 +0 -104
- data/doc/ep_flux/math-doc/document/node10.html +0 -164
- data/doc/ep_flux/math-doc/document/node11.html +0 -86
- data/doc/ep_flux/math-doc/document/node12.html +0 -166
- data/doc/ep_flux/math-doc/document/node13.html +0 -897
- data/doc/ep_flux/math-doc/document/node14.html +0 -1065
- data/doc/ep_flux/math-doc/document/node15.html +0 -72
- data/doc/ep_flux/math-doc/document/node16.html +0 -81
- data/doc/ep_flux/math-doc/document/node2.html +0 -82
- data/doc/ep_flux/math-doc/document/node3.html +0 -91
- data/doc/ep_flux/math-doc/document/node4.html +0 -149
- data/doc/ep_flux/math-doc/document/node5.html +0 -330
- data/doc/ep_flux/math-doc/document/node6.html +0 -99
- data/doc/ep_flux/math-doc/document/node7.html +0 -98
- data/doc/ep_flux/math-doc/document/node8.html +0 -83
- data/doc/ep_flux/math-doc/document/node9.html +0 -140
- data/doc/ep_flux/math-doc/document/prev.png +0 -0
- data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
- data/doc/ep_flux/math-doc/document/up.png +0 -0
- data/doc/ep_flux/math-doc/document/up_g.png +0 -0
- data/doc/ep_flux/math-doc/document.pdf +0 -0
- data/doc/ep_flux/math-doc/document.tex +0 -2018
- data/doc/gdir.html +0 -412
- data/doc/gdir_client.html +0 -16
- data/doc/gdir_connect_ftp-like.html +0 -61
- data/doc/gdir_server.html +0 -45
- data/doc/ggraph.html +0 -1615
- data/doc/gpcat.html +0 -44
- data/doc/gpcut.html +0 -41
- data/doc/gphys.html +0 -532
- data/doc/gphys_fft.html +0 -324
- data/doc/gphys_grads_io.html +0 -69
- data/doc/gphys_grib_io.html +0 -82
- data/doc/gphys_io.html +0 -120
- data/doc/gphys_io_common.html +0 -18
- data/doc/gphys_netcdf_io.html +0 -283
- data/doc/gplist.html +0 -24
- data/doc/gpmath.html +0 -51
- data/doc/gpmaxmin.html +0 -31
- data/doc/gpprint.html +0 -34
- data/doc/gpview.html +0 -270
- data/doc/grads2nc_with_gphys.html +0 -21
- data/doc/grads_gridded.html +0 -307
- data/doc/grib.html +0 -144
- data/doc/grid.html +0 -212
- data/doc/index.html +0 -133
- data/doc/index.rd +0 -127
- data/doc/netcdf_convention.html +0 -136
- data/doc/unumeric.html +0 -176
- data/doc/update +0 -64
- data/doc/varray.html +0 -299
- data/doc/varraycomposite.html +0 -67
@@ -39,18 +39,35 @@ module NumRu
|
|
39
39
|
#< Class variables regarding lon & lat >
|
40
40
|
|
41
41
|
@@lonbc = GPhys::Derivative::CYCLIC_OR_LINEAR # this should be always fine
|
42
|
-
@@latbc = GPhys::Derivative::LINEAR_EXT # this should be always fine
|
42
|
+
# @@latbc = GPhys::Derivative::LINEAR_EXT # this should be always fine
|
43
43
|
|
44
|
-
@@lam = nil
|
45
|
-
@@phi = nil
|
44
|
+
@@lam = nil # lambda (lon in radian) obtaiend lately (see get_lambda_phi)
|
45
|
+
@@phi = nil # phi (lat in radian) obtaiend lately (see get_lambda_phi)
|
46
46
|
|
47
47
|
#< Differentian at the planets's near surface. With suffix "_s" >
|
48
48
|
|
49
|
+
def latbc(phi)
|
50
|
+
=begin
|
51
|
+
# not so good
|
52
|
+
pi2 = Math::PI/2
|
53
|
+
eps = 0.1
|
54
|
+
xs = phi[0..1].val
|
55
|
+
xe = phi[-2..-1].val
|
56
|
+
if (pi2-xs[0].abs) / (xs[0]-xs[1]).abs < eps and
|
57
|
+
(pi2-xe[-1].abs) / (xe[-1]-xe[-2]).abs < eps
|
58
|
+
GPhys::Derivative::MIRROR_B
|
59
|
+
else
|
60
|
+
GPhys::Derivative::LINEAR_EXT
|
61
|
+
end
|
62
|
+
=end
|
63
|
+
GPhys::Derivative::LINEAR_EXT
|
64
|
+
end
|
65
|
+
|
49
66
|
def rot_s(u,v)
|
50
|
-
|
67
|
+
lam, phi, lond, latd = get_lambda_phi(u)
|
51
68
|
cos_phi = phi.cos
|
52
69
|
dv_dlam = v.cderiv(lond,@@lonbc,lam)
|
53
|
-
duc_dphi = (u*cos_phi).cderiv(latd
|
70
|
+
duc_dphi = (u*cos_phi).cderiv(latd,latbc(phi),phi)
|
54
71
|
rot = (dv_dlam - duc_dphi) / (@@R*cos_phi)
|
55
72
|
rot.long_name = "rot(#{u.name},#{v.name})"
|
56
73
|
rot.name = "rot"
|
@@ -58,10 +75,10 @@ module NumRu
|
|
58
75
|
end
|
59
76
|
|
60
77
|
def div_s(u,v)
|
61
|
-
|
78
|
+
lam, phi, lond, latd = get_lambda_phi(u)
|
62
79
|
cos_phi = phi.cos
|
63
80
|
du_dlam = u.cderiv(lond,@@lonbc,lam)
|
64
|
-
dvc_dphi = (v*cos_phi).cderiv(latd
|
81
|
+
dvc_dphi = (v*cos_phi).cderiv(latd,latbc(phi),phi)
|
65
82
|
rot = (du_dlam + dvc_dphi) / (@@R*cos_phi)
|
66
83
|
rot.long_name = "div(#{u.name},#{v.name})"
|
67
84
|
rot.name = "div"
|
@@ -83,10 +100,10 @@ module NumRu
|
|
83
100
|
end
|
84
101
|
|
85
102
|
def grad_s(s)
|
86
|
-
|
103
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
87
104
|
cos_phi = phi.cos
|
88
105
|
xs = s.cderiv(lond,@@lonbc,lam) / (@@R*cos_phi)
|
89
|
-
ys = s.cderiv(latd
|
106
|
+
ys = s.cderiv(latd,latbc(phi),phi) / @@R
|
90
107
|
xs.long_name = "xgrad(#{s.name})"
|
91
108
|
xs.name = "xgrad"
|
92
109
|
ys.long_name = "ygrad(#{s.name})"
|
@@ -94,36 +111,129 @@ module NumRu
|
|
94
111
|
[xs,ys]
|
95
112
|
end
|
96
113
|
|
114
|
+
def grad_sx(s)
|
115
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
116
|
+
cos_phi = phi.cos
|
117
|
+
xs = s.cderiv(lond,@@lonbc,lam) / (@@R*cos_phi)
|
118
|
+
xs.long_name = "xgrad(#{s.name})"
|
119
|
+
xs.name = "xgrad"
|
120
|
+
xs
|
121
|
+
end
|
122
|
+
|
123
|
+
def grad_sy(s)
|
124
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
125
|
+
cos_phi = phi.cos
|
126
|
+
ys = s.cderiv(latd,latbc(phi),phi) / @@R
|
127
|
+
ys.long_name = "ygrad(#{s.name})"
|
128
|
+
ys.name = "ygrad"
|
129
|
+
ys
|
130
|
+
end
|
131
|
+
|
132
|
+
def grad_sy_cosphifact(s,cosphi_exponent)
|
133
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
134
|
+
cos_phi = phi.cos
|
135
|
+
cos_phi_factor = cos_phi**cosphi_exponent
|
136
|
+
ys = (s*cos_phi_factor).cderiv(latd,latbc(phi),phi)/cos_phi_factor / @@R
|
137
|
+
ys.long_name = "ygrad(#{s.name})"
|
138
|
+
ys.name = "ygrad"
|
139
|
+
ys
|
140
|
+
end
|
141
|
+
|
142
|
+
def weight_tanphi(s, tan_exp, r_exp)
|
143
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
144
|
+
tan_phi = phi.tan
|
145
|
+
ys = s * (tan_phi**tan_exp * @@R**r_exp)
|
146
|
+
ys
|
147
|
+
end
|
148
|
+
|
149
|
+
def weight_cosphi(s, cos_exp, r_exp)
|
150
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
151
|
+
cos_phi = phi.cos
|
152
|
+
ys = s * (cos_phi**cos_exp * @@R**r_exp)
|
153
|
+
ys
|
154
|
+
end
|
155
|
+
|
156
|
+
def weight_sinphi(s, sin_exp, r_exp)
|
157
|
+
lam, phi, lond, latd = get_lambda_phi(s)
|
158
|
+
sin_phi = phi.sin
|
159
|
+
ys = s * (sin_phi**sin_exp * @@R**r_exp)
|
160
|
+
ys
|
161
|
+
end
|
162
|
+
|
97
163
|
#< helper methods >
|
98
164
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
165
|
+
# Find longitude and latitude coordinates and convert into
|
166
|
+
# radian.
|
167
|
+
#
|
168
|
+
# RETURN VALUE
|
169
|
+
# * [lam, phi, lond, latd]
|
170
|
+
# * lam (GPhys): longitude in radian (lambda).
|
171
|
+
# (nil if not found && !err_raise)
|
172
|
+
# * phi (GPhys): latitude in radian (lambda).
|
173
|
+
# (nil if not found && !err_raise)
|
174
|
+
# * lond : Interger to show that longitude is the lon-th dim if found;
|
175
|
+
# (nil if not found && !err_raise)
|
176
|
+
# * latd : Interger to show that latitude is the lat-th dim iffound;
|
177
|
+
# (nil if not found && !err_raise)
|
178
|
+
def get_lambda_phi(gp, err_raise=true)
|
179
|
+
lond, latd = find_lon_lat_dims(gp, err_raise)
|
180
|
+
lam = lond && gp.axis(lond).to_gphys.convert_units("rad") # lon in rad
|
181
|
+
lam.units = "" if lond # treat as non-dim
|
182
|
+
phi = latd && gp.axis(latd).to_gphys.convert_units("rad") # lat in rad
|
183
|
+
phi.units = "" if latd # treat as non-dim
|
105
184
|
@@lam = lam
|
106
185
|
@@phi = phi
|
107
|
-
[
|
186
|
+
[lam, phi, lond, latd]
|
108
187
|
end
|
109
188
|
|
189
|
+
# Find longitude and latitude coordinates.
|
190
|
+
#
|
191
|
+
# ARGUMENTS
|
192
|
+
# * gp : GPhys to inspect
|
193
|
+
# * err_raise (OPTIONAL; default:false) : if true, exception is raised
|
194
|
+
# if longitude or latitude coordinate is not found.
|
195
|
+
#
|
196
|
+
# SEARCH CRITERIA
|
197
|
+
# (1) Find coord having units "degrees_east" (lon) or
|
198
|
+
# "degrees_north" (lat)
|
199
|
+
# (2) Investigate coordinate name matches (to find a lonitude coord,
|
200
|
+
# /longitude/i for long_name or standard_name, or /^lon/ for name)
|
201
|
+
# and match units compatible with "degrees".
|
202
|
+
#
|
203
|
+
#
|
204
|
+
# RETURN VALUE
|
205
|
+
# * [lond,latd]
|
206
|
+
# * lond: dimension number of longitude (0,1,..) if found /
|
207
|
+
# nil if not found
|
208
|
+
# * latd: dimension number of latitude (0,1,..) if found /
|
209
|
+
# nil if not found
|
210
|
+
#
|
110
211
|
def find_lon_lat_dims(gp, err_raise=false)
|
111
212
|
lond = nil
|
112
213
|
latd = nil
|
113
214
|
(0...gp.rank).each do |dim|
|
114
|
-
|
215
|
+
crd = gp.coord(dim)
|
216
|
+
if /^degrees?_east$/i =~ crd.get_att("units")
|
115
217
|
lond = dim
|
116
218
|
break
|
117
|
-
elsif
|
219
|
+
elsif ( ( /longitude/i =~ crd.long_name ||
|
220
|
+
/^lon/i =~ crd.name ||
|
221
|
+
(nm=crd.get_att("standard_name") && /longitude/i =~ nm ) &&
|
222
|
+
(crd.units =~ Units["degrees_east"]) ) )
|
118
223
|
lond = dim
|
119
224
|
break
|
120
225
|
end
|
121
226
|
end
|
122
227
|
(0...gp.rank).each do |dim|
|
123
|
-
if
|
228
|
+
next if dim == lond
|
229
|
+
crd = gp.coord(dim)
|
230
|
+
if /^degrees?_north$/i =~ crd.get_att("units")
|
124
231
|
latd = dim
|
125
232
|
break
|
126
|
-
elsif
|
233
|
+
elsif ( ( /latitude/i =~ crd.long_name ||
|
234
|
+
/^lat/i =~ crd.name ||
|
235
|
+
(nm=crd.get_att("standard_name") && /latitude/i =~ nm ) &&
|
236
|
+
(crd.units =~ Units["degrees_north"]) ) )
|
127
237
|
latd = dim
|
128
238
|
break
|
129
239
|
end
|
@@ -136,9 +246,104 @@ module NumRu
|
|
136
246
|
end
|
137
247
|
end
|
138
248
|
|
249
|
+
end
|
139
250
|
|
251
|
+
=begin
|
252
|
+
class GPhys
|
140
253
|
|
254
|
+
# Find longitude and latitude coordinates.
|
255
|
+
#
|
256
|
+
# SEARCH CRITERIA
|
257
|
+
# (1) Find coord having units "degrees_east" (lon) or
|
258
|
+
# "degrees_north" (lat)
|
259
|
+
# (2) Investigate coordinate name matches (to find a lonitude coord,
|
260
|
+
# /longitude/i for long_name or standard_name, or /^lon/ for name)
|
261
|
+
# and match units compatible with "degrees".
|
262
|
+
#
|
263
|
+
# ARGUMENT
|
264
|
+
# * out_in_radian (OPTIONAL default:false) : if true, output is made
|
265
|
+
# in radian
|
266
|
+
#
|
267
|
+
# RETURN VALUE
|
268
|
+
# * [lon, lat, dimlon, dimlat]
|
269
|
+
# * lon : VArray representing longitude if found; nil if not found.
|
270
|
+
# By default (out_in_radian==false), its units are converted into
|
271
|
+
# "degrees_east" if not; If out_in_radian==true, converion is made
|
272
|
+
# into "radian".
|
273
|
+
# * lat : VArray representing latitude if found; nil if not found.
|
274
|
+
# By default (out_in_radian==false), its units are converted into
|
275
|
+
# "degrees_north" if not; If out_in_radian==true, converion is made
|
276
|
+
# into "radian".
|
277
|
+
# * lon : Interger to show that longitude is the lon-th dim if found;
|
278
|
+
# nil if not found.
|
279
|
+
# * lat : Interger to show that latitude is the lat-th dim iffound;
|
280
|
+
# nil if not found.
|
281
|
+
def get_lon_lat_coord(out_in_radian=false)
|
282
|
+
unrad = Units["radian"]
|
283
|
+
|
284
|
+
#< find longitude >
|
285
|
+
unlon = Units["degrees_east"]
|
286
|
+
reg_additional = /east/
|
287
|
+
lon = dimlon = nil
|
288
|
+
for dim in 0...rank
|
289
|
+
crd = coord(dim)
|
290
|
+
uncrd = crd.units
|
291
|
+
if uncrd == unlon && reg_additional =~ uncrd.to_s
|
292
|
+
dimlon = dim
|
293
|
+
lon = crd
|
294
|
+
break
|
295
|
+
elsif ( ( /longitude/i =~ crd.long_name ||
|
296
|
+
/^lon/i =~ crd.name ||
|
297
|
+
(nm=crd.get_att("standard_name") && /longitude/i =~ nm ) &&
|
298
|
+
(uncrd =~ unlon) ) )
|
299
|
+
dimlon = dim
|
300
|
+
lon = crd
|
301
|
+
break
|
302
|
+
end
|
303
|
+
end
|
304
|
+
if lon
|
305
|
+
if out_in_radian
|
306
|
+
lon = lon.convert_units(unrad)
|
307
|
+
else
|
308
|
+
lon = lon.convert_units(unlon)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
#< find latitude >
|
313
|
+
unlat = Units["degrees_north"]
|
314
|
+
reg_additional = /north/
|
315
|
+
lat = dimlat = nil
|
316
|
+
for dim in 0...rank
|
317
|
+
next if dim == dimlon
|
318
|
+
crd = coord(dim)
|
319
|
+
uncrd = crd.units
|
320
|
+
if uncrd == unlat && reg_additional =~ uncrd.to_s
|
321
|
+
dimlat = dim
|
322
|
+
lat = crd
|
323
|
+
break
|
324
|
+
elsif ( ( /latitude/i =~ crd.long_name ||
|
325
|
+
/^lat/i =~ crd.name ||
|
326
|
+
(nm=crd.get_att("standard_name") && /latitude/i =~ nm ) &&
|
327
|
+
(uncrd =~ unlat) ) )
|
328
|
+
dimlat = dim
|
329
|
+
lat = crd
|
330
|
+
break
|
331
|
+
end
|
332
|
+
end
|
333
|
+
if lat
|
334
|
+
if out_in_radian
|
335
|
+
lat = lat.convert_units(unrad)
|
336
|
+
else
|
337
|
+
lat = lat.convert_units(unlon)
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
[lon, lat, dimlon, dimlat]
|
342
|
+
end
|
343
|
+
|
141
344
|
end
|
345
|
+
=end
|
346
|
+
|
142
347
|
end
|
143
348
|
|
144
349
|
################################################
|
@@ -179,4 +384,9 @@ if $0 == __FILE__
|
|
179
384
|
GGraph::tone div[false,iz],true,"max"=>0.5e-5,"min"=>-0.5e-5,"int"=>0.5e-6
|
180
385
|
GGraph::color_bar
|
181
386
|
DCL.grcls
|
387
|
+
|
388
|
+
print "\n\n*** test lon/lat coords ***\n"
|
389
|
+
p GAnalysis::Planet.find_lon_lat_dims(u)
|
390
|
+
#u.get_lon_lat_coord.each{|x| p x}
|
391
|
+
#u.get_lon_lat_coord(true).each{|x| p x}
|
182
392
|
end
|