Exemple #1
0
X, Z = core.prepare_data(coords, z_values, {"rcs_1":rcs_1, "rcs_2":rcs_2})
labels = core.apply_algo(X, 3)
blh = utils.blh_from_labels(labels, Z)

blhs_over_profile(z_values, rcs_1, blh, labels=labels)

plt.figure()
plt.hist(rcs_1, 35)
plt.title("Histogram of a single profile of RCS")
plt.show(block=False)

# Test of blhs_over_data
# ------------------------
print("\n --------------- Test of blhs_over_data")
testFile = paths.file_defaultlidardata()
blh = core.blh_estimation(testFile)
t_values, z_values, rcss = utils.extract_data(testFile)
rcs_1 = rcss["rcs_1"]
rcs_2 = rcss["rcs_2"]

blhs_over_data(t_values, z_values, rcs_1, blh)

# Test of scatterplot_blhs
# ------------------------
print("\n --------------- Test of scatterplot_blhs")
outputFile = paths.file_defaultoutput()
t_values, z_values, dat = utils.extract_data(
    outputFile, to_extract=["blh_kabl", "pbl"]
)
blh_new = dat["blh_kabl"]
blh_mnf  = dat["pbl"]
Exemple #2
0
import datetime as dt
import pytz
import sys
import time
import netCDF4 as nc

lidarFile = paths.file_defaultcl31data()

t_values, z_values, rcss = utils.extract_data(lidarFile,
                                              max_height=4620,
                                              to_extract=["rcs_0"])
rcs_0 = rcss["rcs_0"]

# Estimation with KABL
# ----------------------
params = utils.get_default_params()
params["n_clusters"] = 3
params["predictors"] = {"day": ["rcs_0"], "night": ["rcs_0"]}
params["n_profiles"] = 1
params["init"] = "advanced"

blh_kabl = core.blh_estimation(lidarFile, storeInNetcdf=False, params=params)

# Plot
# ------
graphics.storeImages = False

graphics.blhs_over_data(t_values, z_values, rcs_0, [blh_kabl], ['KABL'])

input("\n Press Enter to exit (close down all figures)\n")