Skip to content

Commit

Permalink
example arrays release 0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gbeckers committed Sep 20, 2023
1 parent bf45bc1 commit 2b9bc1f
Show file tree
Hide file tree
Showing 169 changed files with 792 additions and 235 deletions.
2 changes: 1 addition & 1 deletion darr/readcodearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def readcodescilab_complex(numtype, shape, endianness,
filepath=filepath, varname=varname)
dimstr = ",:" * ndim
ct += f'{varname} = complex(squeeze({varname}(1{dimstr})),squeeze' \
f'({varname}(2{dimstr})));'
f'({varname}(2{dimstr})));\n'
return ct


Expand Down
8 changes: 8 additions & 0 deletions examplearrays/arrays/array_complex128_1D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ fileid <- file("arrayvalues.bin", "rb")
a <- readBin(con=fileid, what=complex(), n=7, size=16, signed=TRUE, endian="little")
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(14, "dl", fileid);
a = matrix(a, [2, 7]);
mclose(fileid);
a = complex(squeeze(a(1,:)),squeeze(a(2,:)));

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "complex128",
"shape": [
7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
12 changes: 10 additions & 2 deletions examplearrays/arrays/array_complex128_2D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for reading the numeric data

Note that the array is 2-dimensional and stored with a row-major memory
layout. In column-major languages (see Note below), the code provided here
will lead to an array that has its dimensions inversed (2, 8) with respect to
will lead to an array that has its dimensions reversed (2, 8) with respect to
the format description above (8, 2).

Python with Darr:
Expand All @@ -53,6 +53,14 @@ a <- readBin(con=fileid, what=complex(), n=16, size=16, signed=TRUE, endian="lit
a <- array(data=a, dim=c(2, 8), dimnames=NULL)
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(32, "dl", fileid);
a = matrix(a, [2, 2, 8]);
mclose(fileid);
a = complex(squeeze(a(1,:,:)),squeeze(a(2,:,:)));

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down Expand Up @@ -94,4 +102,4 @@ major memory layout. To keep things efficient, the code examples above do not
change the memory layout when reading the array in a different language. This
means that in column-major languages, the dimension axes will be *reversed*.
Row-major languages are: Python and Mathematica. Columns-major languages are:
Julia, Matlab/Octave, R, Maple, and IDL/GDL.
Julia, Scilab, Matlab/Octave, R, Maple, and IDL/GDL.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "complex128",
"shape": [
8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
8 changes: 8 additions & 0 deletions examplearrays/arrays/array_complex64_1D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ Python with Numpy (memmap):
import numpy as np
a = np.memmap('arrayvalues.bin', dtype='<c8', shape=(7,), order='C')

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(14, "fl", fileid);
a = matrix(a, [2, 7]);
mclose(fileid);
a = complex(squeeze(a(1,:)),squeeze(a(2,:)));

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "complex64",
"shape": [
7
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_complex64_1D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
12 changes: 10 additions & 2 deletions examplearrays/arrays/array_complex64_2D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for reading the numeric data

Note that the array is 2-dimensional and stored with a row-major memory
layout. In column-major languages (see Note below), the code provided here
will lead to an array that has its dimensions inversed (2, 8) with respect to
will lead to an array that has its dimensions reversed (2, 8) with respect to
the format description above (8, 2).

Python with Darr:
Expand All @@ -46,6 +46,14 @@ Python with Numpy (memmap):
import numpy as np
a = np.memmap('arrayvalues.bin', dtype='<c8', shape=(8, 2), order='C')

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(32, "fl", fileid);
a = matrix(a, [2, 2, 8]);
mclose(fileid);
a = complex(squeeze(a(1,:,:)),squeeze(a(2,:,:)));

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down Expand Up @@ -87,4 +95,4 @@ major memory layout. To keep things efficient, the code examples above do not
change the memory layout when reading the array in a different language. This
means that in column-major languages, the dimension axes will be *reversed*.
Row-major languages are: Python and Mathematica. Columns-major languages are:
Julia, Matlab/Octave, R, Maple, and IDL/GDL.
Julia, Scilab, Matlab/Octave, R, Maple, and IDL/GDL.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "complex64",
"shape": [
8,
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_complex64_2D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float16",
"shape": [
7
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float16_1D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
4 changes: 2 additions & 2 deletions examplearrays/arrays/array_float16_2D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for reading the numeric data

Note that the array is 2-dimensional and stored with a row-major memory
layout. In column-major languages (see Note below), the code provided here
will lead to an array that has its dimensions inversed (2, 8) with respect to
will lead to an array that has its dimensions reversed (2, 8) with respect to
the format description above (8, 2).

Python with Darr:
Expand Down Expand Up @@ -76,4 +76,4 @@ major memory layout. To keep things efficient, the code examples above do not
change the memory layout when reading the array in a different language. This
means that in column-major languages, the dimension axes will be *reversed*.
Row-major languages are: Python and Mathematica. Columns-major languages are:
Julia, Matlab/Octave, R, Maple, and IDL/GDL.
Julia, Scilab, Matlab/Octave, R, Maple, and IDL/GDL.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float16",
"shape": [
8,
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float16_2D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
6 changes: 6 additions & 0 deletions examplearrays/arrays/array_float32_1D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ fileid <- file("arrayvalues.bin", "rb")
a <- readBin(con=fileid, what=numeric(), n=7, size=4, signed=TRUE, endian="little")
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(7, "fl", fileid);
mclose(fileid);

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float32",
"shape": [
7
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float32_1D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
11 changes: 9 additions & 2 deletions examplearrays/arrays/array_float32_2D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for reading the numeric data

Note that the array is 2-dimensional and stored with a row-major memory
layout. In column-major languages (see Note below), the code provided here
will lead to an array that has its dimensions inversed (2, 8) with respect to
will lead to an array that has its dimensions reversed (2, 8) with respect to
the format description above (8, 2).

Python with Darr:
Expand All @@ -53,6 +53,13 @@ a <- readBin(con=fileid, what=numeric(), n=16, size=4, signed=TRUE, endian="litt
a <- array(data=a, dim=c(2, 8), dimnames=NULL)
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(16, "fl", fileid);
a = matrix(a, [2, 8]);
mclose(fileid);

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down Expand Up @@ -97,4 +104,4 @@ major memory layout. To keep things efficient, the code examples above do not
change the memory layout when reading the array in a different language. This
means that in column-major languages, the dimension axes will be *reversed*.
Row-major languages are: Python and Mathematica. Columns-major languages are:
Julia, Matlab/Octave, R, Maple, and IDL/GDL.
Julia, Scilab, Matlab/Octave, R, Maple, and IDL/GDL.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float32",
"shape": [
8,
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float32_2D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
6 changes: 6 additions & 0 deletions examplearrays/arrays/array_float64_1D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ fileid <- file("arrayvalues.bin", "rb")
a <- readBin(con=fileid, what=numeric(), n=7, size=8, signed=TRUE, endian="little")
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(7, "dl", fileid);
mclose(fileid);

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float64",
"shape": [
7
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float64_1D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
11 changes: 9 additions & 2 deletions examplearrays/arrays/array_float64_2D.darr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for reading the numeric data

Note that the array is 2-dimensional and stored with a row-major memory
layout. In column-major languages (see Note below), the code provided here
will lead to an array that has its dimensions inversed (2, 8) with respect to
will lead to an array that has its dimensions reversed (2, 8) with respect to
the format description above (8, 2).

Python with Darr:
Expand All @@ -53,6 +53,13 @@ a <- readBin(con=fileid, what=numeric(), n=16, size=8, signed=TRUE, endian="litt
a <- array(data=a, dim=c(2, 8), dimnames=NULL)
close(fileid)

Scilab:
-------
fileid = mopen("arrayvalues.bin", "rb");
a = mget(16, "dl", fileid);
a = matrix(a, [2, 8]);
mclose(fileid);

Matlab/Octave:
--------------
fileid = fopen('arrayvalues.bin');
Expand Down Expand Up @@ -97,4 +104,4 @@ major memory layout. To keep things efficient, the code examples above do not
change the memory layout when reading the array in a different language. This
means that in column-major languages, the dimension axes will be *reversed*.
Row-major languages are: Python and Mathematica. Columns-major languages are:
Julia, Matlab/Octave, R, Maple, and IDL/GDL.
Julia, Scilab, Matlab/Octave, R, Maple, and IDL/GDL.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrayorder": "C",
"byteorder": "little",
"darrobject": "Array",
"darrversion": "0.5.1",
"darrversion": "0.5.5+0.gbf45bc1.dirty",
"numtype": "float64",
"shape": [
8,
Expand Down
2 changes: 1 addition & 1 deletion examplearrays/arrays/array_float64_2D.darr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
9
],
"comments": "This example array has metadata, which is stored in a separate JSON file. Metadata in Darr is a dictionary that can contain anything that is JSON serializable.",
"datetime": "20220516084023",
"datetime": "20230920144041",
"samplingrate": 25000.0
}
Loading

0 comments on commit 2b9bc1f

Please sign in to comment.