Skip to content

CBPF

AeroViz.plot.meteorology.CBPF

Attributes

__all__ module-attribute

__all__ = ['CBPF']

Classes

Color

Unit

Functions
load_jsonfile classmethod
load_jsonfile()

讀取 JSON 檔中數據并將其變成屬性

update_jsonfile classmethod
update_jsonfile(key, value)

更新JSON檔

del_jsonfile classmethod
del_jsonfile(key)

更新JSON檔

Functions

set_figure

set_figure(func=None, *, figsize: tuple | None = None, fs: int | None = None, fw: str = None, autolayout: bool = True)

combine_legends

combine_legends(axes_list: list[Axes]) -> tuple[list, list]

auto_label_pct

auto_label_pct(pct, symbol: bool = True, include_pct: bool = False, ignore: Literal['inner', 'outer'] = 'inner', value: float = 2)

linear_regression_base

linear_regression_base(x_array: ndarray, y_array: ndarray, columns: str | list[str] | None = None, positive: bool = True, fit_intercept: bool = True)

improve_density_estimation

improve_density_estimation(df, WS, WD, val, resolution=100, bandwidth=None)

改進的密度估計函數,使用KDE方法來產生更平滑的分布

Parameters:

df : DataFrame 包含風速風向數據的DataFrame WS : str 風速列名 WD : str 風向列名 val : str 要分析的變量列名 resolution : int 網格解析度 bandwidth : float or tuple KDE的頻寬參數,如果為None則自動選擇

smooth_and_clean

smooth_and_clean(Z, smooth_radius=2, min_density=1)

平滑並清理密度圖,去除孤立點

Parameters:

Z : ndarray 密度估計結果 smooth_radius : int 平滑半徑 min_density : float 最小密度閾值

is_within_circle

is_within_circle(center_row, center_col, row, col, radius)

remove_lonely_point

remove_lonely_point(filtered_histogram, radius=4, magic_num=13)

fill_nan_with_mean

fill_nan_with_mean(filtered_histogram, radius=4, magic_num=13)

CBPF

CBPF(df: DataFrame, WS: Series | str, WD: Series | str, val: Series | str | None = None, percentile: list | float | int | None = None, max_ws: float | None = 5, resolution: int = 50, sigma: float | tuple = 2, rlabel_pos: float = 30, bottom_text: str | bool | None = None, **kwargs) -> tuple[Figure, Axes]