DS-SELECT(1)

NAME
ds-select - Select and subset variables.

SYNOPSIS
ds select [var...] [sel] input output [options]

DESCRIPTION
select can also be used to convert between different file formats (ds select input output).

ARGUMENTS

var Variable name.

sel Selector as dim: idx pairs, where dim is a dimension name and idx is an index or a list of indexes as { i... }.

input
    Input file.

output
    Output file.

options
    See help for ds for global options. Note that with this command options can only be supplied before the command name or at the end of the command line.

EXAMPLES
Write data to dataset.nc.

    $ ds set { time none time { 1 2 3 } long_name: time units: s } { temperature none time { 16. 18. 21. } long_name: temperature units: celsius } title: "Temperature data" none dataset.nc

List variables in dataset.nc.

    $ ds dataset.nc
    temperature
    time

Select variable temperature from dataset.nc and write to temperature.nc.

    $ ds select temperature dataset.nc temperature.nc

List variables in temperature.nc.

    $ ds temperature.nc
    temperature

Subset by time index 0 and write to 0.nc.

    $ ds select time: 0 dataset.nc 0.nc

Print variables time and temperature in 0.nc.

    $ ds cat time temperature 0.nc
    time temperature
    1 16.000000

Convert dataset.nc to JSON.

    $ ds select dataset.nc dataset.json
    $ cat dataset.json
    {"time": [1, 2, 3], "temperature": [16.0, 18.0, 21.0], ".": {".": {"title": "Temperature data"}, "time": {"long_name": "time", "units": "s", ".dims": ["time"], ".size": [3]}, "temperature": {"long_name": "temperature", "units": "celsius ".dims": ["time"], ".size": [3]}}}