mytardis experimentΒΆ

usage: mytardis experiment [-h] {list,get,create,update} ...
Sub-commands:
list

Display a list of experiment records.

usage: mytardis experiment list
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]
    [--filter FILTER]

  EXAMPLE

  $ mytardis experiment list

  Model: Experiment
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/experiment/?format=json
  Total Count: 4
  Limit: 20
  Offset: 0

  +----+-------------------+-----------------------------------+
  | ID |    Institution    |               Title               |
  +====+===================+===================================+
  | 20 | Monash University | James Exp 001                     |
  +----+-------------------+-----------------------------------+
  | 13 | Monash University | A's Test Instrument - Test User1  |
  +----+-------------------+-----------------------------------+
  | 22 | Monash University | James Test Exp 003                |
  +----+-------------------+-----------------------------------+
  | 14 | Monash University | A's Test Instrument - Test User2  |
  +----+-------------------+-----------------------------------+
Options:
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
--filter Filter on these fields, e.g. “title=Exp Title”.
get

Display a single experiment record.

usage: mytardis experiment get [-h] [--json] experiment_id

  EXAMPLE

  $ mytardis experiment get 20

  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 20                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | James Exp 001     |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  +------------+------------------------+------------------------+------------+
  | Dataset ID |     Experiment(s)      |      Description       | Instrument |
  +============+========================+========================+============+
  |         34 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
  |         33 | /api/v1/experiment/20/ | James Test Dataset 003 | None       |
  +------------+------------------------+------------------------+------------+
  |         32 | /api/v1/experiment/20/ | James Test Dataset 002 | None       |
  +------------+------------------------+------------------------+------------+
  |         31 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
Positional arguments:
experiment_id The experiment ID.
Options:
--json=False Display results in JSON format.
create

Create an experiment record.

usage: mytardis experiment create
    [--description DESCRIPTION] [--institution INSTITUTION] [--params PARAMS] title

  EXAMPLE

  First let's look up an experiment schema we can use to add some
  metadata to the new experiment record.

  $ mytardis schema list

  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | ID |           Name            |                         Namespace                         |       Type        | Subtype | Immutable | Hidden |
  +====+===========================+===========================================================+===================+=========+===========+========+
   ...  ...                         ...                                                         ...                 ...       ...         ...
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | 12 | Sample Experiment Schema  | https://mytardis.org/schemas/sample-experiment-schema     | Experiment schema |         | False     | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+

  "mytardis schema get <schema_id>" displays the parameters
  associated with this schema:

  $ mytardis schema get 12
  +--------------+-------------------------------------------------------+
  | Schema field |                         Value                         |
  +==============+=======================================================+
  | ID           | 12                                                    |
  +--------------+-------------------------------------------------------+
  | Name         | Sample Experiment Schema                              |
  +--------------+-------------------------------------------------------+
  | Namespace    | https://mytardis.org/schemas/sample-experiment-schema |
  +--------------+-------------------------------------------------------+
  | Type         | Experiment schema                                     |
  +--------------+-------------------------------------------------------+
  | Subtype      |                                                       |
  +--------------+-------------------------------------------------------+
  | Immutable    | False                                                 |
  +--------------+-------------------------------------------------------+
  | Hidden       | False                                                 |
  +--------------+-------------------------------------------------------+

  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+
  | ParameterName ID |       Full Name       |         Name          | Data Type | Units | Immutable | Is Searchable | Order | Choices | Comparison Type |
  +==================+=======================+=======================+===========+=======+===========+===============+=======+=========+=================+
  |               33 | Sample Parameter Name | sample_parameter_name | String    |       | False     | False         | 9999  |         | Exact value     |
  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+

  Now that we know the schema's namespace, the parameter name(s) and
  their data type(s), we can create some experiment metadata.

  Below we use cat to create the metadata file, but you can use
  any text editor.

  $ cat << EOF > params.json
  [
      {
          "schema": "https://mytardis.org/schemas/sample-experiment-schema",
          "parameters": [
              {
                  "name": "sample_parameter_name",
                  "value": "Sample Parameter Value"
              }
          ]
      }
  ]
  EOF

  Now we create the experiment record, using the metadata file
  we just created:

  $ mytardis experiment create --params params.json "Exp With Params"
  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 28                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | Exp With Params   |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  +------------------------+--------------------------+-----------------------+------------------------+-----------------+----------------+---------+
  | ExperimentParameter ID |          Schema          |    Parameter Name     |      String Value      | Numerical Value | Datetime Value | Link ID |
  +========================+==========================+=======================+========================+=================+================+=========+
  |                     35 | Sample Experiment Schema | Sample Parameter Name | Sample Parameter Value |                 |                |         |
  +------------------------+--------------------------+-----------------------+------------------------+-----------------+----------------+---------+

  Experiment created successfully.
Positional arguments:
title The experiment title to create.
Options:
--description A description of the experiment.
--institution The institution of the experiment.
--params A JSON file containing experiment parameters.
update

Update an experiment record.

usage: mytardis experiment update
    [--title TITLE] [--description DESCRIPTION] experiment_id

  EXAMPLE
  $ mytardis experiment update --title "Renamed Exp" 20
  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 20                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | Renamed Exp       |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  Experiment updated successfully.
Positional arguments:
experiment_id The ID of the experiment to update.
Options:
--title The new title of the experiment.
--description The new description of the experiment.