|
11 | 11 | y = cf.read('$PWD') # Raises Exception |
12 | 12 | except Exception: |
13 | 13 | pass |
14 | | -y = cf.read('$PWD', file_type='netCDF') |
| 14 | +y = cf.read('$PWD', dataset_type='netCDF') |
15 | 15 | len(y) |
16 | 16 | x = cf.read('file.nc') |
17 | 17 | x |
|
765 | 765 | import netCDF4 |
766 | 766 | nc = netCDF4.Dataset('file.nc', 'r') |
767 | 767 | v = nc.variables['ta'] |
768 | | -netcdf_array = cf.NetCDF4Array(filename='file.nc', address='ta', |
| 768 | +netcdf_array = cf.XnetcdfArray(filename='file.nc', address='ta', |
769 | 769 | dtype=v.dtype, shape=v.shape) |
770 | 770 | data_disk = cf.Data(netcdf_array) |
771 | 771 | numpy_array = v[...] |
|
828 | 828 | cf.read('append-example-file.nc') |
829 | 829 | h = cf.example_field(0) |
830 | 830 | h |
831 | | -cf.write(h, 'append-example-file.nc', mode='a') |
| 831 | +cf.write(h, 'append-example-file.nc', mode='a', backend='netCDF4') |
832 | 832 | cf.read('append-example-file.nc') |
833 | 833 | f = cf.read('q_file.nc')[0] |
834 | 834 | q.equals(f) |
|
1059 | 1059 | list_variable |
1060 | 1060 | print(list_variable.array) |
1061 | 1061 | cf.write(P, 'P_gathered.nc') |
| 1062 | +f = cf.read('subsampled.nc')[0] |
| 1063 | +print(f) |
| 1064 | +lon = f.construct('longitude') |
| 1065 | +lon |
| 1066 | +lon.data.source() |
| 1067 | +print(lon.array) |
| 1068 | +lon.data.source().source() |
| 1069 | +print(lon.data.source().source().array) |
| 1070 | +g = f[0, 6, :] |
| 1071 | +print(g) |
| 1072 | +print(g.construct('longitude').array) |
| 1073 | +lon = f.construct('longitude') |
| 1074 | +d = lon.data.source() |
| 1075 | +d.get_tie_point_indices() |
| 1076 | +d.get_computational_precision() |
| 1077 | +q, t = cf.read('file.nc') |
| 1078 | +t.set_quantize_on_write(algorithm='bitgroom', quantization_nsd=1) |
| 1079 | +cf.write(t, 'quantized.nc', backend='netCDF4') |
| 1080 | +quantized = cf.read('quantized.nc')[0] |
| 1081 | +c = quantized.get_quantization() |
| 1082 | +c |
| 1083 | +c.parameters() |
| 1084 | +t[0, 0, 0].array |
| 1085 | +quantized[0, 0, 0].array |
1062 | 1086 | pp = cf.read('umfile.pp') |
1063 | 1087 | pp |
1064 | 1088 | print(pp[0]) |
|
0 commit comments