PyOPIA 2.13.0__tar.gz → 2.14.0__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.13.0 → pyopia-2.14.0}/PKG-INFO +1 -1
- pyopia-2.14.0/pyopia/__init__.py +1 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/cf_metadata.json +49 -1
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/exampledata.py +33 -6
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/io.py +3 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/process.py +7 -1
- pyopia-2.13.0/pyopia/__init__.py +0 -1
- {pyopia-2.13.0 → pyopia-2.14.0}/.gitignore +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/LICENSE +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/README.md +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/auxillarydata.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/background.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/classify.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/cli.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/dataexport/__init__.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/dataexport/ecotaxa.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/instrument/__init__.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/instrument/common.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/instrument/holo.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/instrument/silcam.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/instrument/uvp.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/metadata.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/pipeline.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/plotting.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/simulator/__init__.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/simulator/silcam.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/statistics.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/__init__.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/test_auxillarydata.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/test_classify.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/test_io.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/test_notebooks.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyopia/tests/test_pipeline.py +0 -0
- {pyopia-2.13.0 → pyopia-2.14.0}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.14.0"
|
|
@@ -62,4 +62,52 @@
|
|
|
62
62
|
"standard_name": "timestamp",
|
|
63
63
|
"long_name": "Timestamp of particle observation",
|
|
64
64
|
"calculation_method": "Recorded during particle observation",
|
|
65
|
-
"pyopia_process_level": 0}
|
|
65
|
+
"pyopia_process_level": 0},
|
|
66
|
+
"filename": {
|
|
67
|
+
"standard_name": "filename",
|
|
68
|
+
"long_name": "Filename of the raw image",
|
|
69
|
+
"units": "",
|
|
70
|
+
"calculation_method": "Recorded during image loading",
|
|
71
|
+
"pyopia_process_level": 0},
|
|
72
|
+
"particle_count": {
|
|
73
|
+
"standard_name": "particle_count",
|
|
74
|
+
"long_name": "Number of particles detected in the image",
|
|
75
|
+
"units": "1",
|
|
76
|
+
"calculation_method": "Count of particles from segmentation",
|
|
77
|
+
"pyopia_process_level": 1},
|
|
78
|
+
"saturation": {
|
|
79
|
+
"standard_name": "image_saturation",
|
|
80
|
+
"long_name": "Percentage saturation of the image",
|
|
81
|
+
"units": "percent",
|
|
82
|
+
"calculation_method": "Computed as the percentage of the image covered by particles relative to the maximum acceptable coverage",
|
|
83
|
+
"pyopia_process_level": 1},
|
|
84
|
+
"d50": {
|
|
85
|
+
"standard_name": "median_particle_diameter",
|
|
86
|
+
"long_name": "Median particle diameter (D50) from volume distribution",
|
|
87
|
+
"units": "micrometers",
|
|
88
|
+
"calculation_method": "Calculated from volume-based particle size distribution",
|
|
89
|
+
"pyopia_process_level": 2},
|
|
90
|
+
"nc": {
|
|
91
|
+
"standard_name": "number_concentration",
|
|
92
|
+
"long_name": "Number concentration of particles",
|
|
93
|
+
"units": "L^-1",
|
|
94
|
+
"calculation_method": "Calculated from particle count and sample volume",
|
|
95
|
+
"pyopia_process_level": 2},
|
|
96
|
+
"vc": {
|
|
97
|
+
"standard_name": "volume_concentration",
|
|
98
|
+
"long_name": "Volume concentration of particles",
|
|
99
|
+
"units": "uL L^-1",
|
|
100
|
+
"calculation_method": "Calculated from particle volumes and sample volume",
|
|
101
|
+
"pyopia_process_level": 2},
|
|
102
|
+
"sample_volume": {
|
|
103
|
+
"standard_name": "sample_volume",
|
|
104
|
+
"long_name": "Volume of water sampled",
|
|
105
|
+
"units": "L",
|
|
106
|
+
"calculation_method": "Calculated from image area, pixel size, and path length",
|
|
107
|
+
"pyopia_process_level": 2},
|
|
108
|
+
"junge": {
|
|
109
|
+
"standard_name": "junge_parameter",
|
|
110
|
+
"long_name": "Junge parameter (slope of particle size number distribution)",
|
|
111
|
+
"units": "1",
|
|
112
|
+
"calculation_method": "Fitted slope of particle size number distribution between 150-350 µm",
|
|
113
|
+
"pyopia_process_level": 2}}
|
|
@@ -10,14 +10,18 @@ logger = logging.getLogger()
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def get_classifier_database_from_pysilcam_blob(download_directory="./"):
|
|
13
|
-
"""Downloads
|
|
14
|
-
|
|
15
|
-
only works for known filenames that are on this blob
|
|
13
|
+
"""Downloads and unzips the silcam_database of labelled example images from pysilcam.blob
|
|
14
|
+
into the working dir. if it doesn't already exist
|
|
16
15
|
|
|
17
16
|
Parameters
|
|
18
17
|
----------
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
download_directory : string
|
|
19
|
+
directory to download and unzip the silcam_database.zip into. Defaults to "./"
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
string
|
|
24
|
+
download_directory, the directory that the silcam_database.zip was downloaded and unzipped into
|
|
21
25
|
|
|
22
26
|
"""
|
|
23
27
|
if os.path.exists(os.path.join(download_directory)):
|
|
@@ -47,6 +51,13 @@ def get_file_from_pysilcam_blob(filename, download_directory="./"):
|
|
|
47
51
|
----------
|
|
48
52
|
filename : string
|
|
49
53
|
known filename on the blob
|
|
54
|
+
download_directory : string
|
|
55
|
+
directory to download the file into. Defaults to "./"
|
|
56
|
+
|
|
57
|
+
Returns
|
|
58
|
+
-------
|
|
59
|
+
string
|
|
60
|
+
filename of the downloaded file
|
|
50
61
|
|
|
51
62
|
"""
|
|
52
63
|
if os.path.exists(os.path.join(download_directory, filename)):
|
|
@@ -59,10 +70,16 @@ def get_file_from_pysilcam_blob(filename, download_directory="./"):
|
|
|
59
70
|
def get_example_silc_image(download_directory="./"):
|
|
60
71
|
"""calls `get_file_from_pysilcam_blob` for a silcam iamge
|
|
61
72
|
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
download_directory : string
|
|
76
|
+
directory to download the file into. Defaults to "./"
|
|
77
|
+
|
|
62
78
|
Returns
|
|
63
79
|
-------
|
|
64
80
|
string
|
|
65
|
-
filename
|
|
81
|
+
filename of the downloaded silcam image
|
|
82
|
+
|
|
66
83
|
"""
|
|
67
84
|
filename = "D20181101T142731.838206.silc"
|
|
68
85
|
if os.path.isfile(filename):
|
|
@@ -78,6 +95,11 @@ def get_example_model(download_directory="./"):
|
|
|
78
95
|
Download from the pysilcam blob storage into the working dir.
|
|
79
96
|
If the file exists, skip the download.
|
|
80
97
|
|
|
98
|
+
Parameters
|
|
99
|
+
----------
|
|
100
|
+
download_directory : string
|
|
101
|
+
directory to download the file into. Defaults to "./"
|
|
102
|
+
|
|
81
103
|
Returns
|
|
82
104
|
-------
|
|
83
105
|
string
|
|
@@ -97,6 +119,11 @@ def get_example_model(download_directory="./"):
|
|
|
97
119
|
def get_example_hologram_and_background(download_directory="./"):
|
|
98
120
|
"""calls `get_file_from_pysilcam_blob` for a raw hologram, and its associated background image.
|
|
99
121
|
|
|
122
|
+
Parameters
|
|
123
|
+
----------
|
|
124
|
+
download_directory : string
|
|
125
|
+
directory to download the file into. Defaults to "./"
|
|
126
|
+
|
|
100
127
|
Returns
|
|
101
128
|
-------
|
|
102
129
|
string
|
|
@@ -128,6 +128,9 @@ def write_stats(
|
|
|
128
128
|
# Add auxillary data to ximage_stats
|
|
129
129
|
ximage_stats = auxillary_data.add_auxillary_data_to_xstats(ximage_stats)
|
|
130
130
|
|
|
131
|
+
# Add CF-compliant attributes
|
|
132
|
+
ximage_stats = add_cf_attributes(ximage_stats)
|
|
133
|
+
|
|
131
134
|
encoding_imagestats = setup_xstats_encoding(ximage_stats)
|
|
132
135
|
ximage_stats.to_netcdf(
|
|
133
136
|
datafilename + "-STATS.nc",
|
|
@@ -639,7 +639,13 @@ class CalculateImageStats():
|
|
|
639
639
|
|
|
640
640
|
path_length = getattr(data['settings']['general'], 'path_length', 40)
|
|
641
641
|
if path_length is not None:
|
|
642
|
-
|
|
642
|
+
# Get image dimensions from the corrected image
|
|
643
|
+
image = data.get('imraw')
|
|
644
|
+
if image is not None:
|
|
645
|
+
imy, imx = image.shape[:2]
|
|
646
|
+
else:
|
|
647
|
+
imx, imy = 2048, 2448 # fallback defaults
|
|
648
|
+
nc_vc = pyopia.statistics.nc_vc_from_stats(data['stats'], pixel_size, path_length, imx=imx, imy=imy)
|
|
643
649
|
for k, v in zip(['nc', 'vc', 'sample_volume', 'junge'], nc_vc):
|
|
644
650
|
data['image_stats'].loc[data['timestamp'], k] = v
|
|
645
651
|
|
pyopia-2.13.0/pyopia/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.13.0"
|
|
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
|
|
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
|