Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: ms.concatenate - Function Up: ms - Tool Previous: ms.getdata - Function


ms.putdata - Function



Package general
Module ms
Tool ms


Write new values into the measurement set


Synopsis
putdata(items)


Arguments

items in Record with items and their new values
    Allowed: Record
    Default: no default


Returns
Boolean



Description
This function allows you to write values from Glish variables back into the measurement set table. The main difference between this and direct access of the table, using the table tool, is that this function writes data to the selected measurement set.

Unlike the getdata function you can only put items that correspond to actual table columns. You cannot change the data shape either so that the number of correlations, channels and rows (or intereferometers/time slots) must match the values in the selected measurement set. If the values were obtained using the getdata function with ifraxis argument set to T, then,any default values added to fill in missing intereferometer/timeslots pairs will be ignored when writing the modified values back using this function.

The measurement set has to be opened for read/write access to be able to use this function.

You need to call selectinit before calling this function. If you haven't then selectinit will be called for you with default arguments.

Items prefixed with either; corrected, model, residual or obs_residual and the imaging_weight item are not available unless your measurement set has been processed either with the imager or calibrator tools.



Example
      include 'ms.g'
      myms := ms("3C273XC1.ms", readonly=F)
      myms.selectinit(datadescid=1)
      rec := myms.getdata("weight data")
      rec.weight[,] := 1;
      include 'statistics.g'
      rec.corrected_data -:= mean(rec.corrected_data);
      myms.putdata(rec);
This example selects all the data from the measurement set where the value in the DATA_DESC_ID column is zero. This corresponds to a particular spectral window and polarization setup. Note that the measurement set was opened for writing as well as reading. The fourth line reads all the weights and the corrected data into the Glish variable rec. The weights are set to one. The more obscure syntax is used as typing rec.weight:= 1 will not preserve the shape of the weight array. The corrected data then has its mean subtracted from it. The mean function is defined in statistics.g. Finally the data is written back into the measurement set table.



next up previous contents index
Next: ms.concatenate - Function Up: ms - Tool Previous: ms.getdata - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01