PyOPIA 2.5.1__tar.gz → 2.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyopia-2.5.1 → pyopia-2.5.2}/PKG-INFO +1 -1
- pyopia-2.5.2/pyopia/__init__.py +1 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/instrument/holo.py +1 -1
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/instrument/silcam.py +9 -3
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/instrument/uvp.py +1 -1
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/io.py +55 -5
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/tests/test_pipeline.py +2 -2
- pyopia-2.5.1/pyopia/__init__.py +0 -1
- {pyopia-2.5.1 → pyopia-2.5.2}/LICENSE +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/README.md +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/background.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/classify.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/cli.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/exampledata.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/instrument/__init__.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/instrument/common.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/pipeline.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/plotting.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/process.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/simulator/__init__.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/simulator/silcam.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/statistics.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/tests/__init__.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/tests/test_classify.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyopia/tests/test_notebooks.py +0 -0
- {pyopia-2.5.1 → pyopia-2.5.2}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.5.2'
|
|
@@ -681,7 +681,7 @@ def generate_config(raw_files: str, model_path: str, outfolder: str, output_pref
|
|
|
681
681
|
'pipeline_class': 'pyopia.instrument.holo.MergeStats',
|
|
682
682
|
},
|
|
683
683
|
'output': {
|
|
684
|
-
'pipeline_class': 'pyopia.io.
|
|
684
|
+
'pipeline_class': 'pyopia.io.StatsToDisc',
|
|
685
685
|
'output_datafile': os.path.join(outfolder, output_prefix)
|
|
686
686
|
}
|
|
687
687
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
'''
|
|
2
2
|
Module containing SilCam specific tools to enable compatability with the :mod:`pyopia.pipeline`
|
|
3
|
+
|
|
4
|
+
See:
|
|
5
|
+
Davies, E. J., Brandvik, P. J., Leirvik, F., & Nepstad, R. (2017). The use of wide-band transmittance imaging to size and
|
|
6
|
+
classify suspended particulate matter in seawater. Marine Pollution Bulletin,
|
|
7
|
+
115(1–2). https://doi.org/10.1016/j.marpolbul.2016.11.063
|
|
3
8
|
'''
|
|
4
9
|
|
|
5
10
|
import os
|
|
@@ -14,11 +19,12 @@ def timestamp_from_filename(filename):
|
|
|
14
19
|
|
|
15
20
|
Parameters
|
|
16
21
|
----------
|
|
17
|
-
|
|
22
|
+
filename (string): silcam filename (.silc)
|
|
18
23
|
|
|
19
24
|
Returns
|
|
20
25
|
-------
|
|
21
|
-
|
|
26
|
+
timestamp: timestamp
|
|
27
|
+
timestamp from pandas.to_datetime()
|
|
22
28
|
'''
|
|
23
29
|
|
|
24
30
|
# get the timestamp of the image (in this case from the filename)
|
|
@@ -332,7 +338,7 @@ def generate_config(raw_files: str, model_path: str, outfolder: str, output_pref
|
|
|
332
338
|
'roi_source': 'imref'
|
|
333
339
|
},
|
|
334
340
|
'output': {
|
|
335
|
-
'pipeline_class': 'pyopia.io.
|
|
341
|
+
'pipeline_class': 'pyopia.io.StatsToDisc',
|
|
336
342
|
'output_datafile': os.path.join(outfolder, output_prefix)
|
|
337
343
|
}
|
|
338
344
|
}
|
|
@@ -117,7 +117,7 @@ def generate_config(raw_files: str, model_path: str, outfolder: str, output_pref
|
|
|
117
117
|
'roi_source': 'imraw'
|
|
118
118
|
},
|
|
119
119
|
'output': {
|
|
120
|
-
'pipeline_class': 'pyopia.io.
|
|
120
|
+
'pipeline_class': 'pyopia.io.StatsToDisc',
|
|
121
121
|
'output_datafile': os.path.join(outfolder, output_prefix)
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -229,7 +229,7 @@ def combine_stats_netcdf_files(path_to_data, prefix='*'):
|
|
|
229
229
|
|
|
230
230
|
def merge_and_save_mfdataset(path_to_data, prefix='*'):
|
|
231
231
|
'''Combine a multi-file directory of STATS.nc files into a single '-STATS.nc' file
|
|
232
|
-
that can then be loaded with
|
|
232
|
+
that can then be loaded with :func:`pyopia.io.load_stats`
|
|
233
233
|
|
|
234
234
|
Parameters
|
|
235
235
|
----------
|
|
@@ -321,8 +321,6 @@ def show_h5_meta(h5file):
|
|
|
321
321
|
class StatsToDisc():
|
|
322
322
|
'''PyOpia pipline-compatible class for calling write_stats() that created NetCDF files.
|
|
323
323
|
|
|
324
|
-
Replaces the old StatsH5 class
|
|
325
|
-
|
|
326
324
|
Parameters
|
|
327
325
|
----------
|
|
328
326
|
output_datafile : str
|
|
@@ -377,10 +375,62 @@ class StatsToDisc():
|
|
|
377
375
|
return data
|
|
378
376
|
|
|
379
377
|
|
|
380
|
-
|
|
378
|
+
def load_toml(toml_file):
|
|
379
|
+
'''Load a TOML settings file from file
|
|
381
380
|
|
|
381
|
+
Parameters
|
|
382
|
+
----------
|
|
383
|
+
toml_file : str
|
|
384
|
+
TOML filename
|
|
382
385
|
|
|
383
|
-
|
|
386
|
+
Returns
|
|
387
|
+
-------
|
|
388
|
+
settings : dict
|
|
389
|
+
TOML settings
|
|
390
|
+
'''
|
|
384
391
|
with open(toml_file, 'r') as f:
|
|
385
392
|
settings = toml.load(f)
|
|
386
393
|
return settings
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
def StatsH5():
|
|
397
|
+
'''.. deprecated:: 2.4.8
|
|
398
|
+
:class:`pyopia.io.StatsH5` will be removed in version 3.0.0, it is replaced by
|
|
399
|
+
:class:`pyopia.io.StatsToDisc`.
|
|
400
|
+
|
|
401
|
+
PyOpia pipline-compatible class for calling write_stats() that creates h5 files.
|
|
402
|
+
|
|
403
|
+
Parameters
|
|
404
|
+
----------
|
|
405
|
+
output_datafile : str
|
|
406
|
+
prefix path for output nc file
|
|
407
|
+
dataformat : str
|
|
408
|
+
either 'nc' or 'h5
|
|
409
|
+
export_name_len : int
|
|
410
|
+
max number of chars allowed for col 'export name'. Defaults to 40
|
|
411
|
+
append : bool
|
|
412
|
+
Append all processed data into one nc file.
|
|
413
|
+
Defaults to True.
|
|
414
|
+
If False, then one nc file will be generated per raw image,
|
|
415
|
+
which can be loaded using :func:`pyopia.io.combine_stats_netcdf_files`
|
|
416
|
+
This is useful for larger datasets, where appending causes substantial slowdown
|
|
417
|
+
as the dataset gets larger.
|
|
418
|
+
|
|
419
|
+
Returns
|
|
420
|
+
-------
|
|
421
|
+
data : :class:`pyopia.pipeline.Data`
|
|
422
|
+
data from the pipeline
|
|
423
|
+
|
|
424
|
+
Example
|
|
425
|
+
-------
|
|
426
|
+
Example config for pipeline useage:
|
|
427
|
+
|
|
428
|
+
.. code-block:: toml
|
|
429
|
+
|
|
430
|
+
[steps.output]
|
|
431
|
+
pipeline_class = 'pyopia.io.StatsH5'
|
|
432
|
+
output_datafile = './test' # prefix path for output nc file
|
|
433
|
+
append = true
|
|
434
|
+
'''
|
|
435
|
+
logger.warning('StatsH5 will be removed in version 3.0.0, it is replaced by pyopia.io.StatsToDisc')
|
|
436
|
+
return StatsToDisc()
|
|
@@ -93,7 +93,7 @@ def test_holo_pipeline():
|
|
|
93
93
|
'pipeline_class': 'pyopia.instrument.holo.MergeStats',
|
|
94
94
|
},
|
|
95
95
|
'output': {
|
|
96
|
-
'pipeline_class': 'pyopia.io.
|
|
96
|
+
'pipeline_class': 'pyopia.io.StatsToDisc',
|
|
97
97
|
'output_datafile': datafile_prefix
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -164,7 +164,7 @@ def test_silcam_pipeline():
|
|
|
164
164
|
'roi_source': 'im_minimum'
|
|
165
165
|
},
|
|
166
166
|
'output': {
|
|
167
|
-
'pipeline_class': 'pyopia.io.
|
|
167
|
+
'pipeline_class': 'pyopia.io.StatsToDisc',
|
|
168
168
|
'output_datafile': datafile_prefix
|
|
169
169
|
}
|
|
170
170
|
}
|
pyopia-2.5.1/pyopia/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.5.1'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|