Skip to content

Commit 89601b7

Browse files
authored
Merge pull request #774 from slayoo/ice_products
adding dry option to ParticleVolumeVersusRadiusLogarithmSpectrum
2 parents da7e3b3 + f76da8e commit 89601b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PySDM/products/size_spectral/particle_volume_versus_radius_logarithm_spectrum.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99

1010
class ParticleVolumeVersusRadiusLogarithmSpectrum(SpectrumMomentProduct):
11-
def __init__(self, radius_bins_edges, name=None, unit='dimensionless'):
11+
def __init__(self, radius_bins_edges, name=None, unit='dimensionless', dry=False):
1212
super().__init__(name=name, unit=unit, attr_unit='m')
1313
self.radius_bins_edges = radius_bins_edges
1414
self.moment_0 = None
1515
self.moments = None
16+
self.attr = ('dry ' if dry else '') + 'volume'
1617

1718
def register(self, builder):
1819
builder.request_attribute('volume')
@@ -26,7 +27,7 @@ def register(self, builder):
2627

2728
def _impl(self, **kwargs):
2829
vals = np.empty([self.particulator.mesh.n_cell, len(self.attr_bins_edges) - 1])
29-
self._recalculate_spectrum_moment(attr='volume', rank=1, filter_attr='volume')
30+
self._recalculate_spectrum_moment(attr=self.attr, rank=1, filter_attr=self.attr)
3031

3132
for i in range(vals.shape[1]):
3233
self._download_spectrum_moment_to_buffer(rank=1, bin_number=i)

0 commit comments

Comments
 (0)