gphys 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +7414 -0
  3. data/LICENSE.txt +1 -1
  4. data/Rakefile +0 -2
  5. data/doc/derivative/math-doc/document/images.log +385 -0
  6. data/doc/ep_flux/math-doc/document/images.log +1375 -0
  7. data/doc/ganalysis/doc/NumRu.html +203 -0
  8. data/doc/ganalysis/doc/NumRu/GAnalysis.html +931 -0
  9. data/doc/ganalysis/doc/NumRu/GAnalysis/BetaPlane.html +574 -0
  10. data/doc/ganalysis/doc/NumRu/GAnalysis/Fitting.html +576 -0
  11. data/doc/ganalysis/doc/NumRu/GAnalysis/LogP.html +425 -0
  12. data/doc/ganalysis/doc/NumRu/GAnalysis/Met.html +2021 -0
  13. data/doc/ganalysis/doc/NumRu/GAnalysis/MetZ.html +524 -0
  14. data/doc/ganalysis/doc/NumRu/GAnalysis/Planet.html +1047 -0
  15. data/doc/ganalysis/doc/NumRu/GAnalysis/QG.html +794 -0
  16. data/doc/ganalysis/doc/NumRu/GAnalysis/QG/Uninitialized.html +215 -0
  17. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_common.html +603 -0
  18. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere.html +760 -0
  19. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_common.html +251 -0
  20. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_div.html +424 -0
  21. data/doc/ganalysis/doc/NumRu/GAnalysis/SigmaCoord.html +321 -0
  22. data/doc/ganalysis/doc/NumRu/GGraph.html +334 -0
  23. data/doc/ganalysis/doc/NumRu/GPhys.html +579 -0
  24. data/doc/ganalysis/doc/Object.html +210 -0
  25. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/beta_plane_rb.html +60 -0
  26. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/covariance_rb.html +56 -0
  27. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/eof_rb.html +64 -0
  28. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/fitting_rb.html +54 -0
  29. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/histogram_rb.html +58 -0
  30. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/log_p_rb.html +60 -0
  31. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_rb.html +60 -0
  32. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_z_rb.html +58 -0
  33. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/planet_rb.html +58 -0
  34. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/qg_rb.html +64 -0
  35. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/sigma_coord_rb.html +56 -0
  36. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis_rb.html +98 -0
  37. data/doc/ganalysis/doc/created.rid +13 -0
  38. data/doc/ganalysis/doc/images/brick.png +0 -0
  39. data/doc/ganalysis/doc/images/brick_link.png +0 -0
  40. data/doc/ganalysis/doc/images/bug.png +0 -0
  41. data/doc/ganalysis/doc/images/bullet_black.png +0 -0
  42. data/doc/ganalysis/doc/images/bullet_toggle_minus.png +0 -0
  43. data/doc/ganalysis/doc/images/bullet_toggle_plus.png +0 -0
  44. data/doc/ganalysis/doc/images/date.png +0 -0
  45. data/doc/ganalysis/doc/images/find.png +0 -0
  46. data/doc/ganalysis/doc/images/loadingAnimation.gif +0 -0
  47. data/doc/ganalysis/doc/images/macFFBgHack.png +0 -0
  48. data/doc/ganalysis/doc/images/package.png +0 -0
  49. data/doc/ganalysis/doc/images/page_green.png +0 -0
  50. data/doc/ganalysis/doc/images/page_white_text.png +0 -0
  51. data/doc/ganalysis/doc/images/page_white_width.png +0 -0
  52. data/doc/ganalysis/doc/images/plugin.png +0 -0
  53. data/doc/ganalysis/doc/images/ruby.png +0 -0
  54. data/doc/ganalysis/doc/images/tag_green.png +0 -0
  55. data/doc/ganalysis/doc/images/wrench.png +0 -0
  56. data/doc/ganalysis/doc/images/wrench_orange.png +0 -0
  57. data/doc/ganalysis/doc/images/zoom.png +0 -0
  58. data/doc/ganalysis/doc/index.html +383 -0
  59. data/doc/ganalysis/doc/js/darkfish.js +118 -0
  60. data/doc/ganalysis/doc/js/jquery.js +32 -0
  61. data/doc/ganalysis/doc/js/quicksearch.js +114 -0
  62. data/doc/ganalysis/doc/js/thickbox-compressed.js +10 -0
  63. data/doc/ganalysis/doc/rdoc.css +763 -0
  64. data/ext/numru/gphys/ext_init.c +1 -0
  65. data/ext/numru/gphys/quad_mesh_sample.c +478 -0
  66. data/gphys.gemspec +2 -2
  67. data/lib/numru/dclext.rb +394 -14
  68. data/lib/numru/derivative.rb +6 -0
  69. data/lib/numru/ganalysis/qg.rb +6 -4
  70. data/lib/numru/ggraph.rb +41 -8
  71. data/lib/numru/gphys/gphys.rb +62 -14
  72. data/lib/numru/gphys/gphys_io.rb +4 -4
  73. data/lib/numru/gphys/version.rb +2 -2
  74. metadata +84 -79
  75. data/.gitignore +0 -14
  76. data/TODO_ep_flux +0 -6
  77. data/gphys-bigmem.gemspec +0 -44
  78. data/install.rb +0 -130
  79. data/sample/cira86_to_nc.rb +0 -122
  80. data/sample/druby_cli1.rb +0 -23
  81. data/sample/druby_cli2.rb +0 -28
  82. data/sample/druby_serv1.rb +0 -30
  83. data/sample/druby_serv2.rb +0 -51
  84. data/sample/ep_flux/demo_NCEP_1.rb +0 -48
  85. data/sample/ep_flux/demo_NCEP_2.rb +0 -57
  86. data/sample/ep_flux/demo_NCEP_3.rb +0 -81
  87. data/sample/ggraph_latlon_labelling_dr002690.rb +0 -159
  88. data/sample/ggraph_mapfit-axes_dr002687.rb +0 -131
  89. data/sample/map_projection.rb +0 -121
  90. data/sample/ncep_theta_coord.rb +0 -79
  91. data/test_old/eof_slp.rb +0 -28
  92. data/test_old/mltbit.dat +0 -0
  93. data/test_old/test_ep_flux.rb +0 -533
  94. data/test_old/test_multibitIO.rb +0 -19
data/gphys.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = NumRu::GPhys::VERSION
9
9
  spec.authors = ["Takeshi Horinouchi", "Ryo Mizuta",\
10
10
  "Daisuke Tsukahara", "Seiya Nishizawa", "Shin-ichi Takehiro"]
11
- spec.email = ["horinout@ees.hokudai.ac.jp"]
11
+ spec.email = ["horinout@gfd-dennou.org"]
12
12
 
13
13
  #if spec.respond_to?(:metadata)
14
14
  # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.homepage = 'http://www.gfd-dennou.org/arch/ruby/products/gphys/'
20
20
  spec.licenses = ["BSD-2-Clause"]
21
21
 
22
- spec.files = `git ls-files -z`.split("\x0")
22
+ spec.files = Dir['{bin/*,ext/**/*[cb],lib/**/*.rb,doc/**/*,test/*.rb,testdata/*[a-z]}'].sort + %w(ChangeLog .ChangeLog.until201303 Gemfile LICENSE.txt README Rakefile gphys.gemspec)
23
23
  spec.bindir = "bin"
24
24
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["ext","lib"]
data/lib/numru/dclext.rb CHANGED
@@ -889,11 +889,16 @@ module NumRu
889
889
 
890
890
  #<<< uepack >>>
891
891
 
892
+ # options:
893
+ # 'min' Numeric minimum tone level
894
+ # 'max' Numeric maximum tone level
895
+ # 'nlev' Integer number of levels
896
+ # 'interval' Numeric tone-level interval
897
+ # 'inf_max' true/false to set (or not) the maximum tone level to infty
898
+ # 'inf_min' true/false to set (or not) the minimum tone level to infty
899
+ # 'lbound' true/false Same as uepack param LBOUND but default is false
900
+ #
892
901
  def ue_set_linear_levs(v, options=nil)
893
- # 'min' nil minimum tone level (Numeric)
894
- # 'max' nil maximum tone level (Numeric)
895
- # 'nlev' nil number of levels (Integer)
896
- # 'interval' nil tone-level interval (Numeric)
897
902
  options = @@empty_hash if !options
898
903
  raise TypeError, "options must be a Hash" if !options.is_a?(Hash)
899
904
  min = options['min']
@@ -901,13 +906,77 @@ module NumRu
901
906
  nlev = options['nlev']
902
907
  interval = options['interval']
903
908
  dx = interval || (nlev ? -nlev : 0)
904
- if min || max
905
- min ||= v.min
906
- max ||= v.max
907
- DCL.uegtla(min, max, dx)
909
+ inf_min = options['inf_min']
910
+ inf_min = false if inf_min.nil?
911
+ inf_min = nil if inf_min && !min # for in-place substitution
912
+ inf_max = options['inf_max']
913
+ inf_max = false if inf_max.nil?
914
+ inf_max = nil if inf_max && !max # for in-place substitution
915
+ lbound = options['lbound']
916
+ min ||= v.min
917
+ max ||= v.max
918
+ levels = ue_linear_levels(min, max, dx, lbound, inf_min, inf_max)
919
+ ue_set_tone_auto(levels)
920
+ end
921
+
922
+ # Same as level setting in uegtla but supporting extension to infinity
923
+ #
924
+ # * inf_min false: no extension, true: extend to -infty, nil: same
925
+ # but for min is replaced by -infty, rather than extending
926
+ #
927
+ # * inf_max false: no extension, true: extend to +infty, nil: same
928
+ # but for max is replaced by +infty, rather than extending
929
+ def ue_linear_levels(min, max, dx, lbound=false, inf_min=false, inf_max=false)
930
+ if dx > 0
931
+ dz = dx.to_f
908
932
  else
909
- v = v.reshape(v.length,1) if v.rank==1
910
- DCL.uegtlb(v, dx)
933
+ nlev = ( dx==0 ? DCL.ueiget('nlev') : [dx.abs.round, 1].max )
934
+ dz = DCL.rgnge( (max-min)/nlev.to_f )
935
+ end
936
+
937
+ zmin = DCL.irle(min/dz)*dz
938
+ zmax = DCL.irge(max/dz)*dz
939
+ n = ((zmax-zmin)/dz).round
940
+
941
+ levels = Array.new
942
+ for i in 0..n
943
+ x = ((zmin+i*dz)/dz).round * dz
944
+ levels.push(x)
945
+ end
946
+ if lbound
947
+ levels[0] = [ levels[0], min ].max
948
+ levels[-1] = [ levels[-1], max ].min
949
+ end
950
+
951
+ rmiss = DCL.glpget("rmiss")
952
+ if inf_min
953
+ levels.unshift(rmiss) # extension
954
+ elsif inf_min.nil?
955
+ levels[0] = rmiss # in-place substitusion
956
+ end
957
+ if inf_max
958
+ levels.push(rmiss) # extension
959
+ elsif inf_max.nil?
960
+ levels[-1] = rmiss # in-place substitusion
961
+ end
962
+
963
+ levels
964
+ end
965
+
966
+ # similar to uegtla/uegtlb but for levels are given
967
+ def ue_set_tone_auto(levels)
968
+ DCL.ueitlv
969
+ nlev = levels.length-1
970
+ itpat = DCL.ueiget('ITPAT')
971
+ iclr1 = DCL.ueiget('ICOLOR1')
972
+ iclr2 = DCL.ueiget('ICOLOR2')
973
+ (0...nlev).each do |i|
974
+ if nlev==1
975
+ ipat = (iclr2-iclr1)/2*1000+itpat
976
+ else
977
+ ipat = ((iclr2-iclr1)/(nlev-1.0)*i+iclr1).round*1000 + itpat
978
+ end
979
+ DCL.uestlv(levels[i], levels[i+1],ipat)
911
980
  end
912
981
  end
913
982
 
@@ -955,6 +1024,250 @@ module NumRu
955
1024
  nil
956
1025
  end
957
1026
 
1027
+ # ICOLOR in uicrgb.f:
1028
+ Default_RGB_1D = [ DCL.isgrgb(255,0,255), DCL.isgrgb(0,0,255),
1029
+ DCL.isgrgb(0,255,255), DCL.isgrgb(0,255,0),
1030
+ DCL.isgrgb(255,255,0), DCL.isgrgb(255,0,0),
1031
+ DCL.isgrgb(255,0,255) ]
1032
+
1033
+ @@ui_shade_1_options = Misc::KeywordOptAutoHelp.new(
1034
+ ['min', nil, 'Numeric => specifies the value corresponding to the RGB map lower end (default: minimum data value). Note that the same color is used below this value.'],
1035
+ ['max', nil, 'Numeric => specifies the value corresponding to the RGB map upper end (default: maximum data value). Note that the same color is used above this value.'],
1036
+ ['rgb', nil, '(Array/NArray) Specifies the color mapping. Example: [ DCL.isgrgb(0,0,0), DCL.isgrgb(255,255,255) ] for gray scale'],
1037
+ ['place_rgb', nil, '(Array/NArray having the same length as the "rgb" value) Additional information needed only when you want to make the RGB map spaced unequally. Will be normalized, so the range does not matter. Example: "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(50,50,150), DCL.isgrgb(255,255,255) ], "place_rgb"=>[0,2,3] to set the intervals 2:1 among the 3 RGB values']
1038
+ )
1039
+
1040
+ def shade_1_option_keys
1041
+ @@ui_shade_1_options.keys
1042
+ end
1043
+
1044
+ def set_ui_shade_1_options(options)
1045
+ @@ui_shade_1_options.set(options)
1046
+ end
1047
+
1048
+ @@next_ui_shade_1_options = nil
1049
+ def next_ui_shade_1_options(options)
1050
+ if options.is_a?(Hash)
1051
+ @@next_ui_shade_1_options = options
1052
+ else
1053
+ raise TypeError,"Hash expected"
1054
+ end
1055
+ nil
1056
+ end
1057
+
1058
+ @@ui_shade_1_called = false # for ui_color_bar_1
1059
+
1060
+ # A wrapper of UIPDAT supporting options.
1061
+ def ui_shade_1(z, options=nil)
1062
+ if @@next_ui_shade_1_options
1063
+ options = ( options ? @@next_ui_shade_1_options.update(options) :
1064
+ @@next_ui_shade_1_options )
1065
+ @@next_ui_shade_1_options = nil
1066
+ end
1067
+ opt = @@ui_shade_1_options.interpret(options)
1068
+ @@ui_shade_1_called = true
1069
+ @@ui_shade_1_min_given = !opt["min"].nil?
1070
+ @@ui_shade_1_max_given = !opt["max"].nil?
1071
+ @@ui_shade_1_min = min = opt["min"] || z.min
1072
+ @@ui_shade_1_max = max = opt["max"] || z.max
1073
+ @@ui_shade_1_rgbs = rgbs = ( opt["rgb"] || Default_RGB_1D )
1074
+ nrgbs = rgbs.length
1075
+ @@ui_shade_1_levs = levs = opt["place_rgb"] || NArray.float(nrgbs).indgen!
1076
+ raise("Length missmatch: 'rgb' & 'place_rgb'") if levs.length != nrgbs
1077
+ DCL.uiscsq(levs,rgbs)
1078
+ DCL.uiscrg(min,max)
1079
+ DCL.uipdat(z)
1080
+ end
1081
+
1082
+ @@ui_color_bar_1_options = Misc::KeywordOptAutoHelp.new(
1083
+ ["voff", nil, "how far is the bar from the viewport in the V coordinate"],
1084
+ ["vcent",nil, "center position of the bar in the V coordinate (VX or VY)"],
1085
+ ["vlength", 0.3, "bar length in the V coordinate"],
1086
+ ["vwidth", 0.02, "bar width in the V coordinate"],
1087
+ ["inffact", 1.9, "factor to change the length of triangle on the side for infinity (relative to 'vwidth')"],
1088
+ ["landscape", false, "if true, horizonlly long (along x axes)"],
1089
+ ["portrait", true, "if true, vertically long (along y axes)"],
1090
+ ["top", false, "place the bar at the top (effective if landscape)"],
1091
+ ["left", false, "place the bar in the left (effective if portrait)"],
1092
+ ["units", nil, "units of the axis of the color bar"],
1093
+ ["units_voff", 0.0, "offset value for units from the default position in the V coordinate (only for 'units' != nil)"],
1094
+ ["title", nil, "title of the color bar"],
1095
+ ["title_voff", 0.0, "offset value for title from the default position in the V coordinate (only for 'title' != nil)"],
1096
+ ["tickintv", 1, "0,1,2,3,.. to specify how frequently the dividing tick lines are drawn (0: no tick lines, 1: every time, 2: ever other:,...)"],
1097
+ ["charfact", 0.9, "factor to change the label/units/title character size (relative to 'rsizel1')"],
1098
+ ["index", nil, "index of tick lines and bar frame"],
1099
+ ["charindex", nil, "index of labels, units, and title"],
1100
+ ["chval_fmt", nil, "string to specify the DCL.chval format for labeling"]
1101
+ )
1102
+
1103
+ def ui_color_bar_1(options=nil)
1104
+
1105
+ raise("ui_shade_1 has not been called") if !@@ui_shade_1_called
1106
+
1107
+ # < set parameters >
1108
+
1109
+ opt = @@ui_color_bar_1_options.interpret(options) # to be replaced
1110
+
1111
+ landscape = opt["landscape"] || !opt["portrait"]
1112
+ portrait = !landscape
1113
+
1114
+ max = @@ui_shade_1_max
1115
+ min = @@ui_shade_1_min
1116
+
1117
+ # < calc position >
1118
+
1119
+ vwidth = opt["vwidth"]
1120
+ vlength = opt["vlength"]
1121
+
1122
+ vx1, vx2, vy1, vy2 = DCL.sgqvpt
1123
+
1124
+ if portrait
1125
+ if !opt["left"] # right
1126
+ voff = opt["voff"] ||
1127
+ DCL.uzrget('roffyr') + DCL.uzrget('pad1')*DCL::uzrget("rsizec2")
1128
+ vxmin = vx2 + voff
1129
+ vxmax = vx2 + voff + vwidth
1130
+ axside = "r"
1131
+ else # left
1132
+ voff = opt["voff"] ? -opt["voff"] : \
1133
+ DCL.uzrget('roffyl') - DCL.uzrget('pad1')*DCL::uzrget("rsizec2")
1134
+ vxmax = vx1 + voff
1135
+ vxmin = vx1 + voff - vwidth
1136
+ axside = "l"
1137
+ end
1138
+ vymin =( opt["vcent"] ? opt["vcent"]-vlength/2 : vy1 )
1139
+ vymax =( opt["vcent"] ? opt["vcent"]+vlength/2 : vy1+vlength )
1140
+ else ## landscape ##
1141
+ vxmin = (opt["vcent"] || ((vx1 + vx2) / 2)) - vlength / 2
1142
+ vxmax = (opt["vcent"] || ((vx1 + vx2) / 2)) + vlength / 2
1143
+ if opt["top"] # top
1144
+ voff = opt["voff"] ||
1145
+ DCL.uzrget('roffxt') + DCL.uzrget('pad1')*DCL::uzrget("rsizec2")
1146
+ vymin = vy2 + voff
1147
+ vymax = vy2 + voff + vwidth
1148
+ axside = "t"
1149
+ else # bottom
1150
+ voff = opt["voff"] ? -opt["voff"] : \
1151
+ DCL.uzrget('roffxb') - DCL.uzrget('pad1')*DCL::uzrget("rsizec2")
1152
+ vymax = vy1 + voff
1153
+ vymin = vy1 + voff - vwidth
1154
+ axside = "b"
1155
+ end
1156
+ end
1157
+
1158
+ # apply optional parameters for axes and labels
1159
+ index = opt["index"] || DCL::uziget("indext2")
1160
+ index = 1 if index <= 0
1161
+ charindex = opt["charindex"] || DCL::uziget("indexl1")
1162
+ charindex = 1 if charindex <= 0
1163
+ charfact = opt["charfact"]
1164
+ charfact = 1 if charfact < 0
1165
+ rsizel1 = charfact * DCL::uzrget("rsizel1")
1166
+
1167
+ axparam_bk =
1168
+ DCLExt.uz_set_params(
1169
+ "indext1" => index,
1170
+ "indext2" => index,
1171
+ "indexl1" => charindex,
1172
+ "rsizel1" => rsizel1,
1173
+ "rsizet1" => vwidth*0.25,
1174
+ "rsizet2" => vwidth*0.4,
1175
+ 'labelyl' => axside=="l",
1176
+ 'labelyr' => axside=="r",
1177
+ 'labelxb' => axside=="b",
1178
+ 'labelxt' => axside=="t",
1179
+ 'icentyr' => ((voff > 0) ? -1.0 : 1.0)
1180
+ )
1181
+
1182
+ if portrait
1183
+ cbwindow = [0.0, 1.0, min, max]
1184
+ else
1185
+ cbwindow = [min, max, 0.0, 1.0]
1186
+ end
1187
+
1188
+ DCL.grfig
1189
+ DCL.grsvpt(vxmin,vxmax,vymin,vymax)
1190
+ DCL.grswnd(*cbwindow)
1191
+ DCL.grstrn(1)
1192
+ DCL.grstrf
1193
+
1194
+ if portrait
1195
+ z = NArray.to_na( [ [min,min], [max,max] ] )
1196
+ else
1197
+ z = NArray.to_na( [ [min,max], [min,max] ] )
1198
+ end
1199
+ #DCL.uiscsq(@@ui_shade_1_rgbs, @@ui_shade_1_levs)
1200
+ #DCL.uiscrg(min,max)
1201
+
1202
+ DCL.uwsgxb(cbwindow[0], cbwindow[1], 2)
1203
+ DCL.uwsgyb(cbwindow[2], cbwindow[3], 2)
1204
+
1205
+ DCL.uipdat(z)
1206
+
1207
+ fmt = opt['chval_fmt']
1208
+
1209
+ inf0 = @@ui_shade_1_min_given
1210
+ inf1 = @@ui_shade_1_max_given
1211
+
1212
+ if portrait
1213
+
1214
+ # draw frame, tick lines, and labels
1215
+ if fmt
1216
+ cfmt_bk = DCL::uyqfmt
1217
+ DCL::uysfmt(fmt)
1218
+ end
1219
+
1220
+ DCL::usyaxs(axside)
1221
+ if axside=="l"
1222
+ DCL.sglnzv(vxmax,vymin,vxmax,vymax,3)
1223
+ else
1224
+ DCL.sglnzv(vxmin,vymin,vxmin,vymax,3)
1225
+ end
1226
+
1227
+ DCL::uxaxdv("b",1,index) if !inf0
1228
+ DCL::uxaxdv("t",1,index) if !inf1
1229
+
1230
+ DCL::uysfmt(cfmt_bk) if fmt
1231
+
1232
+ else ## landscape ##
1233
+
1234
+ # draw frame, tick lines, and labels
1235
+ if fmt
1236
+ cfmt_bk = DCL::uxqfmt
1237
+ DCL::uxsfmt(fmt)
1238
+ end
1239
+
1240
+ DCL::usxaxs(axside)
1241
+ if axside=="b"
1242
+ DCL.sglnzv(vxmin,vymax,vxmax,vymax,3)
1243
+ else
1244
+ DCL.sglnzv(vxmin,vymin,vxmax,vymin,3)
1245
+ end
1246
+
1247
+ DCL::uyaxdv("l",1,index) if !inf0
1248
+ DCL::uyaxdv("r",1,index) if !inf1
1249
+
1250
+ DCL::uxsfmt(cfmt_bk) if fmt
1251
+ end
1252
+
1253
+ DCLExt.color_bar_title_units(vxmin, vxmax, vymin, vymax, portrait, voff,
1254
+ opt['title'], opt['units'], opt['title_voff'], opt['units_voff'])
1255
+
1256
+ inffact = opt["inffact"]
1257
+ if inf0
1258
+ DCLExt.color_bar_draw_infinity_full(vxmin, vxmax, vymin, vymax, vwidth,
1259
+ portrait, inffact, -1, @@ui_shade_1_rgbs[0], index)
1260
+ end
1261
+ if inf1
1262
+ DCLExt.color_bar_draw_infinity_full(vxmin, vxmax, vymin, vymax, vwidth,
1263
+ portrait, inffact, 1, @@ui_shade_1_rgbs[-1], index)
1264
+ end
1265
+
1266
+ DCLExt.uz_set_params(axparam_bk)
1267
+ DCL.uwsgxz(false)
1268
+ DCL.uwsgyz(false)
1269
+ end
1270
+
958
1271
  ############################################################
959
1272
  # RELATIVELY INDEPENDENT OF DCL SUBLIBRARIES
960
1273
  ############################################################
@@ -1639,6 +1952,9 @@ module NumRu
1639
1952
  if lmiss
1640
1953
  fx = NArrayMiss.to_nam(fx, fx.ne(rmiss)) if fx.is_a?(NArray)
1641
1954
  fy = NArrayMiss.to_nam(fy, fy.ne(rmiss)) if fy.is_a?(NArray)
1955
+ mask = fx.get_mask & fy.get_mask
1956
+ fx = fx.mask(mask)
1957
+ fy = fy.mask(mask)
1642
1958
  end
1643
1959
 
1644
1960
  #< DCL scales >
@@ -1965,6 +2281,18 @@ module NumRu
1965
2281
  DCL.sgplzv(v3[0], v3[1], 1, index)
1966
2282
  end
1967
2283
 
2284
+ def color_bar_draw_infinity_full(vxmin, vxmax, vymin, vymax, vwidth, portrait, inffact, sign, icolor, index)
2285
+ sign = (sign > 0) ? 1 : -1
2286
+ win = [vxmin, vxmax, vymin, vymax]
2287
+ win = win[2..3] + win[0..1] if portrait
2288
+ base = ((sign < 0) ? win[0] : win[1])
2289
+ v3 = [[base, base + vwidth * inffact * sign, base],
2290
+ [win[2], (win[2] + win[3]) / 2, win[3]]]
2291
+ v3 = [v3[1], v3[0]] if portrait
2292
+ DCL.sgtnxv(v3[0], v3[1], 455, icolor)
2293
+ DCL.sgplzv(v3[0], v3[1], 1, index)
2294
+ end
2295
+
1968
2296
  def color_bar_title_units(vxmin, vxmax, vymin, vymax, portrait, voff, title, units, title_voff, units_voff)
1969
2297
  rsizel1 = DCL::uzrget('rsizel1')
1970
2298
  charindex = DCL::uziget('indexl1')
@@ -2510,6 +2838,7 @@ module NumRu
2510
2838
  nil
2511
2839
  end
2512
2840
 
2841
+
2513
2842
  # Annotates line/mark type and index (and size if mark).
2514
2843
  # By default it is shown in the right margin of the viewport.
2515
2844
  #
@@ -2702,6 +3031,56 @@ if $0 == __FILE__
2702
3031
  DCL.glpset('lmiss',true)
2703
3032
 
2704
3033
  DCL.sldiv("y",2,2)
3034
+
3035
+ DCL.grfrm
3036
+ DCL.grstrn(1)
3037
+ DCL.grsvpt(0.1,0.8,0.2,0.9)
3038
+ DCL.grswnd(xdeg[0],xdeg[-1],ydeg[0],ydeg[-1])
3039
+ DCL.grstrf
3040
+ DCLExt.ui_shade_1(u) # full color shading
3041
+ DCL.usdaxs
3042
+ DCLExt.ui_color_bar_1 "landscape"=>true,
3043
+ "title"=>"color map", "units"=>"(any)", "voff"=>0.1
3044
+
3045
+ DCL.grfrm
3046
+ DCL.grstrn(1)
3047
+ DCL.grsvpt(0.1,0.8,0.2,0.9)
3048
+ DCL.grswnd(xdeg[0],xdeg[-1],ydeg[0],ydeg[-1])
3049
+ DCL.grstrf
3050
+ DCLExt.ui_shade_1(u, "max"=>u.max*0.7,"min"=>u.min*0.7)
3051
+ DCL.usdaxs
3052
+ DCLExt.ui_color_bar_1 "title"=>"color map", "units"=>"(any)", "voff"=>0.07
3053
+
3054
+ DCL.grfrm
3055
+ DCL.grstrn(1)
3056
+ DCL.grsvpt(0.1,0.8,0.2,0.9)
3057
+ DCL.grswnd(xdeg[0],xdeg[-1],ydeg[0],ydeg[-1])
3058
+ DCL.grstrf
3059
+ DCLExt.ui_shade_1(u, "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(105,71,140),
3060
+ DCL.isgrgb(255,255,255) ],
3061
+ "place_rgb"=>[0.0, 0.33, 1.0],
3062
+ "min"=>u.min, "max"=>u.max )
3063
+ DCL.usdaxs
3064
+ DCLExt.ui_color_bar_1 "landscape"=>true
3065
+
3066
+ DCL.grfrm
3067
+ DCL.grstrn(1)
3068
+ DCL.grsvpt(0.1,0.8,0.2,0.9)
3069
+ DCL.grswnd(xdeg[0],xdeg[-1],ydeg[0],ydeg[-1])
3070
+ DCL.grstrf
3071
+ DCLExt.ui_shade_1(u,
3072
+ # "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(150,0,0),
3073
+ # DCL.isgrgb(230,140,60), DCL.isgrgb(255,255,255) ]
3074
+ # "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(87,50,120),
3075
+ # DCL.isgrgb(172,135,205), DCL.isgrgb(255,255,255) ]
3076
+ "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(61,31,139),
3077
+ DCL.isgrgb(149,119,225), DCL.isgrgb(255,255,255) ]
3078
+ # "rgb"=>[ DCL.isgrgb(0,0,0), DCL.isgrgb(40,40,130),
3079
+ # DCL.isgrgb(125,125,215), DCL.isgrgb(255,255,255) ]
3080
+ )
3081
+ DCL.usdaxs
3082
+ DCLExt.ui_color_bar_1 "landscape"=>true
3083
+
2705
3084
  DCL.grfrm
2706
3085
  DCL.grstrn(1)
2707
3086
  DCL.grsvpt(0.1,0.9,0.1,0.9)
@@ -2743,9 +3122,11 @@ if $0 == __FILE__
2743
3122
  unit_vect_info[3] = 0.0
2744
3123
  DCLExt.unit_vect( *unit_vect_info )
2745
3124
 
2746
- =begin
2747
3125
  DCL.sgpset('lclip',true)
2748
3126
 
3127
+ #v = NArrayMiss.to_nam(v)
3128
+ #v.invalidation(2..6,-5..-2)
3129
+
2749
3130
  for itr in [10,12]
2750
3131
  DCL.grfrm
2751
3132
  DCL.grstrn(itr)
@@ -2797,7 +3178,7 @@ if $0 == __FILE__
2797
3178
  vfratio, flenmax =
2798
3179
  DCLExt.flow_vect_anyproj(u, v,
2799
3180
  xdeg, ydeg,
2800
- 1.0,1,1,true,nil,0.3)
3181
+ 0.1,1,1,true,nil,0.3)
2801
3182
  #DCLExt.flow_vect_anyproj(u[true,ny/2..-1], v[true,ny/2..-1],
2802
3183
  # xdeg, ydeg[ny/2..-1])
2803
3184
  DCLExt.unit_vect_single(vfratio, flenmax)
@@ -2844,7 +3225,7 @@ if $0 == __FILE__
2844
3225
  date_to = DateTime.parse('2000-02-01 5:00')
2845
3226
  any_offst = 10
2846
3227
 
2847
- 3.times do
3228
+ 4.times do
2848
3229
  DCL.grfrm
2849
3230
  DCL.grswnd(0.0, date_to-date_from, any_offst, date_to-date_from+any_offst)
2850
3231
  DCL.grsvpt(0.2, 0.8, 0.2, 0.8)
@@ -2856,7 +3237,6 @@ if $0 == __FILE__
2856
3237
  DCLExt.date_ax(date_from, date_to, "yax"=>true)
2857
3238
  date_to = date_to >> 15*12
2858
3239
  end
2859
- =end
2860
3240
 
2861
3241
  DCL.grcls
2862
3242