oph_get_subarray2

Description

Behaviour

It extracts a subset of a measure array. If size-i params are defined, then the array is considered multidimensional with i implicit dimensions, each of size-i. The subset cannot be applied on multiple dimensions.

Parameters

  • input measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • output measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • measure: input measure.
  • subset: enumeration of comma-separated elementary filters (1 series of filters for each dimension):
    • start_index: select a single value, specified by its index.
    • start_index:stop_index: select elements from start_index to stop_index.
    • start_index:stride:stop_index: select elements from start_index to stop_index with a step of stride. Indexes are integers from 1 to the dimension size and it can be used “end” to specify the index of the last element.
  • size: size of the dimensions on which subsetting is done.

Return type

Binary-array.

Examples

Extract the first 4 odd elements, elements from 30 to 33 and element 60.

oph_get_subarray2('OPH_DOUBLE','OPH_DOUBLE',measure,'1:2:8,30:33,60')

Operation type

Simple.

Arguments

Argument name Type Mandatory Values Default Min/Max-value Min/Max-times
input measure type “oph_type” “yes” “‘oph_double’|’oph_float’ |’oph_int’|’oph_long’|’oph_short’|’oph_byte’”     “1” / “1”
output measure type “oph_type” “yes” “‘oph_double’|’oph_float’ |’oph_int’|’oph_long’|’oph_short’|’oph_byte’”     “1” / “1”
measure “binary-array” “yes”       “1” / “1”
subset “string” “yes”       “1” / “1”
size “long-long” “no”   “0”   “0” /