Class: CodeRunner::Gs2::OldNetcdfSmartReader
- Inherits:
-
NetcdfSmartReader
- Object
- NetcdfSmartReader
- CodeRunner::Gs2::OldNetcdfSmartReader
- Defined in:
- lib/gs2crmod/read_netcdf.rb
Overview
class NetcdfSmartReader
Instance Method Summary collapse
- #axiskit(variable, options) ⇒ Object
- #check_no_r(non_flat_dims) ⇒ Object
- #dimension_variable_name(n) ⇒ Object
Methods inherited from NetcdfSmartReader
#dim_end, #dim_start, #dimensions, #ends, #graphkit, #initialize, #read_variable, #starts
Constructor Details
This class inherits a constructor from CodeRunner::Gs2::NetcdfSmartReader
Instance Method Details
#axiskit(variable, options) ⇒ Object
150 151 152 |
# File 'lib/gs2crmod/read_netcdf.rb', line 150 def axiskit(variable, ) GraphKit::AxisKit.autocreate(data: read_variable(variable, ), title: variable) end |
#check_no_r(non_flat_dims) ⇒ Object
147 148 149 |
# File 'lib/gs2crmod/read_netcdf.rb', line 147 def check_no_r(non_flat_dims) raise "Please specify the ri index for real or imaginary" if non_flat_dims.include? @file.dim('ri') end |
#dimension_variable_name(n) ⇒ Object
139 140 141 142 143 144 145 146 |
# File 'lib/gs2crmod/read_netcdf.rb', line 139 def dimension_variable_name(n) if (dimnames = @file.dims.map{|dim| dim.name}).include? n #p ['dimnames', dimnames, n] n else raise "Unknown dimension #{r}: dimensions are: #{dimnames}" end end |