'Add data to a specified field.
Args:
field: a string parameter used to speficy a related field to be accessed.
field_data: a numpy array of [N, ...] representing the data associated
with the field.
Raises:
ValueError: if the field is already exist or the dimension of the field
data does not matches the number of boxes.'

def add_field(self, field, field_data):

    if self.has_field(field):
        raise ValueError((('Field    ' + field) + 'already    exists'))
    if ((len(field_data.shape) < 1) or (field_data.shape[0] != self.num_boxes())):
        raise ValueError('Invalid    dimensions    for    field    data')
    self.data[field] = field_data
