cloudnetpy 1.65.4__py3-none-any.whl → 1.65.6__py3-none-any.whl
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.
- cloudnetpy/instruments/hatpro.py +1 -1
- cloudnetpy/plotting/plotting.py +46 -32
- cloudnetpy/version.py +1 -1
- {cloudnetpy-1.65.4.dist-info → cloudnetpy-1.65.6.dist-info}/METADATA +1 -1
- {cloudnetpy-1.65.4.dist-info → cloudnetpy-1.65.6.dist-info}/RECORD +8 -8
- {cloudnetpy-1.65.4.dist-info → cloudnetpy-1.65.6.dist-info}/WHEEL +1 -1
- {cloudnetpy-1.65.4.dist-info → cloudnetpy-1.65.6.dist-info}/LICENSE +0 -0
- {cloudnetpy-1.65.4.dist-info → cloudnetpy-1.65.6.dist-info}/top_level.txt +0 -0
cloudnetpy/instruments/hatpro.py
CHANGED
cloudnetpy/plotting/plotting.py
CHANGED
@@ -550,7 +550,7 @@ class Plot2D(Plot):
|
|
550
550
|
|
551
551
|
|
552
552
|
class Plot1D(Plot):
|
553
|
-
def plot(self, figure_data: FigureData) -> None:
|
553
|
+
def plot(self, figure_data: FigureData, hacky_freq_ind: int | None = None) -> None:
|
554
554
|
units = self._convert_units()
|
555
555
|
self._mark_gaps(figure_data)
|
556
556
|
self._ax.plot(
|
@@ -561,7 +561,7 @@ class Plot1D(Plot):
|
|
561
561
|
zorder=_get_zorder("data"),
|
562
562
|
)
|
563
563
|
if self._plot_meta.moving_average:
|
564
|
-
self._plot_moving_average(figure_data)
|
564
|
+
self._plot_moving_average(figure_data, hacky_freq_ind)
|
565
565
|
if self._plot_meta.zero_line:
|
566
566
|
self._ax.axhline(0, color="black", alpha=0.5, label="_nolegend_")
|
567
567
|
self._fill_between_data_gaps(figure_data)
|
@@ -594,7 +594,7 @@ class Plot1D(Plot):
|
|
594
594
|
self._plot_flag_data(figure_data.time[flags], self._data_orig[flags])
|
595
595
|
self._add_legend()
|
596
596
|
self._show_frequency(figure_data, freq_ind)
|
597
|
-
self.plot(figure_data)
|
597
|
+
self.plot(figure_data, freq_ind)
|
598
598
|
|
599
599
|
def _show_frequency(self, figure_data: FigureData, freq_ind: int) -> None:
|
600
600
|
if self.sub_plot.variable.name == "tb":
|
@@ -675,32 +675,47 @@ class Plot1D(Plot):
|
|
675
675
|
|
676
676
|
return default_options
|
677
677
|
|
678
|
-
def _plot_moving_average(
|
678
|
+
def _plot_moving_average(
|
679
|
+
self, figure_data: FigureData, hacky_freq_ind: int | None = None
|
680
|
+
) -> None:
|
679
681
|
time = figure_data.time.copy()
|
680
682
|
data = self._data_orig.copy()
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
sma
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
)
|
683
|
+
flags = self._read_flagged_data(figure_data)
|
684
|
+
if hacky_freq_ind is not None:
|
685
|
+
flags = flags[:, hacky_freq_ind]
|
686
|
+
is_invalid = ma.getmaskarray(data)
|
687
|
+
if np.any(flags):
|
688
|
+
is_invalid |= flags
|
689
|
+
|
690
|
+
is_wind_direction = self.sub_plot.variable.name == "wind_direction"
|
691
|
+
if is_wind_direction:
|
692
|
+
data = np.stack([figure_data.file["wind_speed"], data])
|
693
|
+
|
694
|
+
block_ind = np.where(np.diff(is_invalid))[0] + 1
|
695
|
+
valid_time_blocks = np.split(time, block_ind)[is_invalid[0] :: 2]
|
696
|
+
valid_data_blocks = np.split(data, block_ind)[is_invalid[0] :: 2]
|
697
|
+
|
698
|
+
for time1, data1 in zip(valid_time_blocks, valid_data_blocks, strict=False):
|
699
|
+
if is_wind_direction:
|
700
|
+
sma = self._calculate_average_wind_direction(
|
701
|
+
data1[0], data1[1], time1, window=15
|
702
|
+
)
|
703
|
+
else:
|
704
|
+
sma = self._calculate_moving_average(data1, time1, window=5)
|
705
|
+
gap_time = _get_max_gap_in_minutes(figure_data)
|
706
|
+
gaps = self._find_time_gap_indices(time1, max_gap_min=gap_time) + 1
|
707
|
+
|
708
|
+
for time2, data2 in zip(
|
709
|
+
np.split(time1, gaps), np.split(sma, gaps), strict=False
|
710
|
+
):
|
711
|
+
self._ax.plot(
|
712
|
+
time2,
|
713
|
+
data2,
|
714
|
+
color="slateblue",
|
715
|
+
lw=2,
|
716
|
+
label="_nolegend_",
|
717
|
+
zorder=_get_zorder("mean_curve"),
|
718
|
+
)
|
704
719
|
|
705
720
|
@staticmethod
|
706
721
|
def _get_line_width(time: ndarray) -> float:
|
@@ -736,12 +751,11 @@ class Plot1D(Plot):
|
|
736
751
|
window_size = int(window / 60 / time_delta_hours)
|
737
752
|
if window_size < 1:
|
738
753
|
window_size = 1
|
739
|
-
if
|
754
|
+
if window_size % 2 == 0:
|
740
755
|
window_size += 1
|
741
|
-
weights = np.repeat(1
|
742
|
-
|
743
|
-
|
744
|
-
return np.pad(sma, (edge, edge - 1), mode="constant", constant_values=np.nan)
|
756
|
+
weights = np.repeat(1 / window_size, window_size)
|
757
|
+
padded_data = np.pad(data, window_size // 2, mode="edge")
|
758
|
+
return np.convolve(padded_data, weights, "valid")
|
745
759
|
|
746
760
|
@classmethod
|
747
761
|
def _calculate_average_wind_direction(
|
cloudnetpy/version.py
CHANGED
@@ -8,7 +8,7 @@ cloudnetpy/metadata.py,sha256=v_VDo2vbdTxB0zIsfP69IcrwSKiRlLpsGdq6JPI4CoA,5306
|
|
8
8
|
cloudnetpy/output.py,sha256=YkCaxVkG_Mt2hng_IVnhygHteV4UMKzKALkeFZwFJL8,14822
|
9
9
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
cloudnetpy/utils.py,sha256=JV0Fawnme1HoZgoiidV3eIzsn6vx0AEjBNmI1CcrBsA,28517
|
11
|
-
cloudnetpy/version.py,sha256=
|
11
|
+
cloudnetpy/version.py,sha256=D0-EyiXBu9MXvLB8CBjoUmC5Mf_4q4qDE5OXEFZZe_4,72
|
12
12
|
cloudnetpy/categorize/__init__.py,sha256=gP5q3Vis1y9u9OWgA_idlbjfWXYN_S0IBSWdwBhL_uU,69
|
13
13
|
cloudnetpy/categorize/atmos.py,sha256=vavMC_WQQyGH14eL4vAzKLKDDZt8tBrMYimztYHOjH8,12639
|
14
14
|
cloudnetpy/categorize/atmos_utils.py,sha256=ns5ydiEN34Ng6mJiOBpxKBVDU2NXj6W3Q5IUynmNRYI,3586
|
@@ -34,7 +34,7 @@ cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoG
|
|
34
34
|
cloudnetpy/instruments/cloudnet_instrument.py,sha256=RG5HJxGM6p0F-IGyr85fvOizcMmgx48OeD_XeIsrgSU,3367
|
35
35
|
cloudnetpy/instruments/copernicus.py,sha256=nmgqGOjVQFngj7BNbpcuCwA-W3yksvBbqn__iq7MyDk,6469
|
36
36
|
cloudnetpy/instruments/galileo.py,sha256=yQBedd7dmDnwuWi1MtXOsg4-RyRx0uRAXumCY4YuH9k,4686
|
37
|
-
cloudnetpy/instruments/hatpro.py,sha256=
|
37
|
+
cloudnetpy/instruments/hatpro.py,sha256=DzCWzTJxTc5BSOgoeyM8RjYkSXX6NDi3QXgKRp0uxlI,8759
|
38
38
|
cloudnetpy/instruments/instruments.py,sha256=jG5TYnZ8bdCZXnI303ZsaJBEdSKaIjKMbkGtnq6kQX0,3261
|
39
39
|
cloudnetpy/instruments/lufft.py,sha256=ugXF6pssHAAz1Y_hqPdpKuluAjxxHSR88xBmQuS6RlI,3705
|
40
40
|
cloudnetpy/instruments/mira.py,sha256=EyzEBTpWfDlgaspZVuIfaP4l73GYSVnSzEzBZc0lZNg,9333
|
@@ -94,7 +94,7 @@ cloudnetpy/model_evaluation/tests/unit/test_statistical_methods.py,sha256=Ra3r4V
|
|
94
94
|
cloudnetpy/model_evaluation/tests/unit/test_tools.py,sha256=Ia_VrLdV2NstX5gbx_3AZTOAlrgLAy_xFZ8fHYVX0xI,3817
|
95
95
|
cloudnetpy/plotting/__init__.py,sha256=lg9Smn4BI0dVBgnDLC3JVJ4GmwoSnO-qoSd4ApvwV6Y,107
|
96
96
|
cloudnetpy/plotting/plot_meta.py,sha256=JHrr-4A9fhqdi_tQFe6mR4Fdry3hkI-lmmVu5Ny2vco,15979
|
97
|
-
cloudnetpy/plotting/plotting.py,sha256=
|
97
|
+
cloudnetpy/plotting/plotting.py,sha256=JIgia-Hujsa2ot4JMoBLzEdH7YWzmlGuKSLvvQ9tl0U,34253
|
98
98
|
cloudnetpy/products/__init__.py,sha256=2hRb5HG9hNrxH1if5laJkLeFeaZCd5W1q3hh4ewsX0E,273
|
99
99
|
cloudnetpy/products/classification.py,sha256=bNG8W1CMgGoUBpXopQjYAW3F-uEJGyojXb4A5jmErHo,7921
|
100
100
|
cloudnetpy/products/der.py,sha256=1LDBbnbUg8feMUTGWJq3bObBhEcZ_Ee17MB1x0GwRdo,12669
|
@@ -108,8 +108,8 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
|
|
108
108
|
cloudnetpy/products/mwr_tools.py,sha256=tN_sPDS3BdpFJfa5a2mnc3eCMoi7syjVJMaTt962hmo,5004
|
109
109
|
cloudnetpy/products/product_tools.py,sha256=VNw2diJj30POz68-3qNVkJP7r9AUspT_d1Fp0BbeIx8,10414
|
110
110
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
111
|
-
cloudnetpy-1.65.
|
112
|
-
cloudnetpy-1.65.
|
113
|
-
cloudnetpy-1.65.
|
114
|
-
cloudnetpy-1.65.
|
115
|
-
cloudnetpy-1.65.
|
111
|
+
cloudnetpy-1.65.6.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
112
|
+
cloudnetpy-1.65.6.dist-info/METADATA,sha256=igbDKmd8AkrBWmqc5ftMQLgu6UFQtzeTr6lPZUVBw1c,5784
|
113
|
+
cloudnetpy-1.65.6.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
114
|
+
cloudnetpy-1.65.6.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
115
|
+
cloudnetpy-1.65.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|