Class: WrfLibrary::Entity::GridPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/wrf_library/entity/grid_point.rb

Overview

Simple data class that abstracts a grid point with grid indices and the corresponding geographical data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p_x, p_y, c_x, c_y) ⇒ GridPoint

initialization

Parameters:

  • p_x (Integer)

    x-coordinate of the grid point

  • p_y (Integer)

    y-coordinate of the grid point

  • c_x (Float)

    x-coordinate of the geographical coordinate

  • c_y (Float)

    y-coordinate of the geographical coordinate



19
20
21
22
# File 'lib/wrf_library/entity/grid_point.rb', line 19

def initialize(p_x, p_y, c_x, c_y)
  @grid_point = Coordinate.new(p_x, p_y)
  @grid_coordinates = Coordinate.new(c_x, c_y)
end

Instance Attribute Details

#grid_coordinatesCoordinate (readonly)

Returns the tupel representing the geographical coordinates.

Returns:

  • (Coordinate)

    the tupel representing the geographical coordinates



12
13
14
# File 'lib/wrf_library/entity/grid_point.rb', line 12

def grid_coordinates
  @grid_coordinates
end

#grid_pointCoordinate (readonly)

Returns the tupel representing the grid point in the grid.

Returns:

  • (Coordinate)

    the tupel representing the grid point in the grid



10
11
12
# File 'lib/wrf_library/entity/grid_point.rb', line 10

def grid_point
  @grid_point
end