2D arrays are based on the Java class P1D. As before, one can fill such arrays using the method “add(x,y)”. It is one of the most advanced containers since data can contain up to 8 errors: 1st level (usually statistical) and 2nd level (usually systematical). The dimension of this array can grow and shrink. If you need to keep only 2 values, X and Y, set the dimension of this object to 2 (which is anyway the default). But the dimension can also be up to 10, with 8 additional values necessary to set errors on X and Y.
This is also a high-performance container, which is faster than Jython list or java list. For example, you will need 2 Python list to keep X and Y. Instead, use a single P1D.
The dimensions of this array are below. Use setDimension(dimension) to initialize the container
|X,Y, errY-, errY+ (symmetric)||3|
|X,Y, errY-, errY+||4|
|X,Y,errX-, errX+, errY-, errY+||6|
|X,Y,errX-, errX+, errY-, errY+ + errXsys-, errXsys+, errYsys-, errYsys+||10|
Here are errY means a 1st level error (usually statistical), while errYsys means second-level errors (usually systematical).
The main advantage in using P1D in its ability to handle various operations together with error propagations.
The example below shows how to build such arrays using the Python syntax. We fill an array with 10 sequential numbers from 0 to 9 and then we convert it into a string (for printing). Finally, we evaluate a complete statistical summary using the “getStat” method: