Class: NCATTED_SET_VARIABLE_DESCRIPTION_cmd

Inherits:
InplaceCommand show all
Includes:
NCO_warning_filter
Defined in:
lib/file_command.rb

Instance Method Summary collapse

Methods included from NCO_warning_filter

#command_success?

Methods inherited from InplaceCommand

#cmd_txt, #inplace?

Methods inherited from FileCommand

#run

Constructor Details

#initialize(var_name, description) ⇒ NCATTED_SET_VARIABLE_DESCRIPTION_cmd

Returns a new instance of NCATTED_SET_VARIABLE_DESCRIPTION_cmd.

[View source]

251
252
253
# File 'lib/file_command.rb', line 251

def initialize(var_name, description)
  @var_name, @description = var_name, description
end

Instance Method Details

#cmd_txt_inplace(file) ⇒ Object

[View source]

255
256
257
258
259
260
# File 'lib/file_command.rb', line 255

def cmd_txt_inplace(file)
  # there seems to be an error when setting chars with ncatted:
  # a single quote ' always results in a \' in the netcdf. the same effect as putting a \' in the first place
  # so we currently can not put all variable descriptions correctly, as some contain single quotes
  %Q(#{SYSTEM_COMMANDS::NCATTED} --create_ram -h -a description,#{@var_name},o,c,"#{@description}" #{file})
end