diff --git a/aprofiles/detection/clouds.py b/aprofiles/detection/clouds.py index e61e453..b49f595 100644 --- a/aprofiles/detection/clouds.py +++ b/aprofiles/detection/clouds.py @@ -41,11 +41,7 @@ def detect_clouds(profiles, time_avg=1., zmin=0., thr_noise=5., thr_clouds=4., m profiles.plot(show_clouds=True, vmin=1e-2, vmax=1e1, log=True) ``` - .. figure:: ../../examples/images/clouds.png - :scale: 50 % - :alt: clouds detection - - Clouds detection. + ![Clouds detection](../../assets/images/clouds.png) """ def _detect_clouds_from_rcs(data, zmin, thr_noise, thr_clouds, min_snr): diff --git a/aprofiles/detection/foc.py b/aprofiles/detection/foc.py index d45bd27..219e648 100644 --- a/aprofiles/detection/foc.py +++ b/aprofiles/detection/foc.py @@ -56,11 +56,7 @@ def detect_foc(profiles, method="cloud_base", var="attenuated_backscatter_0", z_ profiles.plot(show_foc=True, zmax=6000., vmin=1e-2, vmax=1e1, log=True) ``` - .. figure:: ../../examples/images/foc.png - :scale: 50 % - :alt: foc detection - - Fog or condensation (foc) detection. + ![Fog or condensation (foc) detection](../../assets/images/foc.png) """ if method == "cloud_base": diff --git a/aprofiles/detection/pbl.py b/aprofiles/detection/pbl.py index 55a1e50..10c5280 100644 --- a/aprofiles/detection/pbl.py +++ b/aprofiles/detection/pbl.py @@ -49,11 +49,7 @@ def detect_pbl( profiles.plot(show_pbl=True, zmax=6000., vmin=1e-2, vmax=1e1, log=True) ``` - .. figure:: ../../examples/images/pbl.png - :scale: 50 % - :alt: clouds detection - - Planetary Boundary Layer Height detection. + ![Planetary Boundary Layer Height detection](../../assets/images/pbl.png) """ from scipy.ndimage.filters import uniform_filter1d diff --git a/aprofiles/plot/image.py b/aprofiles/plot/image.py index a02183d..f2bae3f 100644 --- a/aprofiles/plot/image.py +++ b/aprofiles/plot/image.py @@ -150,7 +150,7 @@ def plot( # attenuated backscatter image profiles.plot(vmin=1e-2, vmax=1e1, log=True) ``` - ![Image of attenuated backscatter profiles](assets/images/attenuated_backscatter.png){: style="width: 50%;" } + ![Image of attenuated backscatter profiles](../../assets/images/attenuated_backscatter.png) """ # calculates max value from data diff --git a/aprofiles/plot/profile.py b/aprofiles/plot/profile.py index bd1b4d0..e194395 100644 --- a/aprofiles/plot/profile.py +++ b/aprofiles/plot/profile.py @@ -132,7 +132,8 @@ def plot( show_fig=True, save_fig=None ): - """Plot single profile of selected variable from :class:`aprofiles.profiles.ProfilesData` object. + """ + Plot single profile of selected variable from (aprofiles.profiles.ProfilesData): object. Args: da (xarray.DataArray): DataArray. @@ -164,11 +165,7 @@ def plot( profiles.plot(datetime=datetime, vmin=-1, vmax=10, zmax=12000, show_clouds=True, show_pbl=True) ``` - .. figure:: ../../docs/assets/images/Profile-Oslo-20210909T212005.png - :scale: 80 % - :alt: profile - - Single profile of attenuated backscatter. + ![Single profile of attenuated backscatter](../../assets/images/Profile-Oslo-20210909T212005.png){: style="width: 60%;" } """ if datetime is None: diff --git a/aprofiles/plot/timeseries.py b/aprofiles/plot/timeseries.py index d2bcd8a..7e8c89b 100644 --- a/aprofiles/plot/timeseries.py +++ b/aprofiles/plot/timeseries.py @@ -10,7 +10,8 @@ def plot(da, var="aod", show_fig=True, save_fig=None, **kwargs): - """Plot time series of selected variable from :class:`aprofiles.profiles.ProfilesData` object. + """ + Plot time series of selected variable from (aprofiles.profiles.ProfilesData): object. Args: da (xarray.DataArray): DataArray @@ -31,11 +32,7 @@ def plot(da, var="aod", show_fig=True, save_fig=None, **kwargs): profiles.plot(var="pbl" ymin=0., ymax=3000., min_snr=2.) ``` - .. figure:: ../../docs/assets/images/time_series.png - :scale: 50 % - :alt: time series - - Time series of Planetary Boundary Layer height. + ![Time series of Planetary Boundary Layer height](../../assets/images/time_series.png) """ def __init__(self): diff --git a/aprofiles/profiles.py b/aprofiles/profiles.py index 455ca94..a64f982 100644 --- a/aprofiles/profiles.py +++ b/aprofiles/profiles.py @@ -111,11 +111,7 @@ def snr(self, var="attenuated_backscatter_0", step=4, verbose=False): profiles.plot(var='snr',vmin=0, vmax=3, cmap='Greys_r') ``` - .. figure:: ../../docs/assets/images/snr.png - :scale: 50 % - :alt: snr - - Signal to Noise Ratio. + ![Signal to Noise Ratio](../../assets/images/snr.png) """ def _1D_snr(array, step): @@ -174,17 +170,8 @@ def gaussian_filter( 0.50 ``` - .. figure:: ../../docs/assets/images/attenuated_backscatter.png - :scale: 50 % - :alt: before filtering - - Before gaussian filtering. - - .. figure:: ../../docs/assets/images/gaussian_filter.png - :scale: 50 % - :alt: after gaussian filtering - - After gaussian filtering (sigma=0.5). + ![Before gaussian filtering](../../assets/images/attenuated_backscatter.png) + ![After gaussian filtering (sigma=0.5)](../../assets/images/gaussian_filter.png) """ import copy @@ -271,17 +258,8 @@ def extrapolate_below( 150 ``` - .. figure:: ../../docs/assets/images/lowest.png - :scale: 50 % - :alt: before extrapolation - - Before extrapolation. - - .. figure:: ../../docs/assets/images/lowest_extrap.png - :scale: 50 % - :alt: after desaturation - - After extrapolation. + ![Before extrapolation](../../assets/images/lowest.png) + ![After extrapolation](../../assets/images/lowest_extrap.png) """ # get index of z @@ -381,17 +359,8 @@ def desaturate_below(self, var="attenuated_backscatter_0", z=4000.0, inplace=Fal True ``` - .. figure:: ../../docs/assets/images/saturated.png - :scale: 50 % - :alt: before desaturation - - Before desaturation. - - .. figure:: ../../docs/assets/images/desaturated.png - :scale: 50 % - :alt: after desaturation - - After desaturation. + ![Before desaturation](../../assets/images/saturated.png) + ![After desaturation](../../assets/images/desaturated.png) """ imax = self._get_index_from_altitude_AGL(z) diff --git a/aprofiles/retrieval/extinction.py b/aprofiles/retrieval/extinction.py index ed37e2b..57ebe27 100644 --- a/aprofiles/retrieval/extinction.py +++ b/aprofiles/retrieval/extinction.py @@ -200,11 +200,7 @@ def inversion( profiles.plot(var='extinction', zmax=6000, vmin=0, vmax=5e-2) ``` - .. figure:: ../../docs/assets/images/backward.png - :scale: 50 % - :alt: clouds detection - - Extinction profiles retrieved with the backward method. + ![Extinction profiles retrieved with the backward method](../../assets/images/backward.png) Forward inversion ```python @@ -214,11 +210,7 @@ def inversion( profiles.plot(var='extinction', zmax=6000, vmin=0, vmax=5e-2) ``` - .. figure:: ../../docs/assets/images/forward.png - :scale: 50 % - :alt: clouds detection - - Extinction profiles retrieved with the forward method. + ![Extinction profiles retrieved with the forward method](../../assets/images/forward.png) """ # we work on profiles averaged in time to reduce the noise diff --git a/aprofiles/retrieval/mass_conc.py b/aprofiles/retrieval/mass_conc.py index 60d8fc1..3145191 100644 --- a/aprofiles/retrieval/mass_conc.py +++ b/aprofiles/retrieval/mass_conc.py @@ -44,12 +44,7 @@ def concentration_profiles(profiles, method): profiles.plot(var='mass_concentration:urban', zmax=6000, vmin=0, vmax=100) ``` - .. figure:: ../../docs/assets/images/mass_conc-urban.png - :scale: 50 % - :alt: mass concentration - - Mass concentration profiles in the case of urban particles. - + ![Mass concentration profiles in the case of urban particles](../../assets/images/mass_conc-urban.png) """ # read aer_properties.json files diff --git a/aprofiles/simulation/ext2back.py b/aprofiles/simulation/ext2back.py index 61fd771..22af5d4 100644 --- a/aprofiles/simulation/ext2back.py +++ b/aprofiles/simulation/ext2back.py @@ -35,11 +35,7 @@ class ExtinctionToAttenuatedBackscatter: sim_profiles.plot('extinction_model') ``` - .. figure:: ../../docs/assets/images/simulation_step-model.png - :scale: 80 % - :alt: simlation step model - - Simulation of aerosol extinction using a step model. + ![Simulation of aerosol extinction using a step model](../../assets/images/simulation_step-model.png) """ # get the right reading class def __init__(self, model, wavelength, lidar_ratio, noise): diff --git a/aprofiles/size_distribution.py b/aprofiles/size_distribution.py index 67b8505..25b2453 100644 --- a/aprofiles/size_distribution.py +++ b/aprofiles/size_distribution.py @@ -102,12 +102,7 @@ def plot(self, show_fig=True): sd.plot() ``` - .. figure:: ../../docs/assets/images/urban_sd.png - :scale: 80 % - :alt: urban size distribution - - Size distributions for urban particles. - + ![Size distributions for urban particles](../../assets/images/urban_sd.png) """ fig, ax = plt.subplots(1, 1, figsize=(6, 6)) diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index 120029d..4615410 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -30,4 +30,11 @@ a.download { a.download::before { content: "⇩ "; /* Adding a download icon before the text */ } - \ No newline at end of file + + .md-header-nav__icon .vprofiles { + background-image: url('../assets/images/vprofiles-bold.ico'); + background-size: cover; + width: 24px; + height: 24px; + display: inline-block; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 468cb85..4d2a306 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,6 +12,8 @@ theme: features: - navigation.instant - navigation.tracking + - navigation.sections + #- navigation.expand # Automatically expands sections palette: - media: "(prefers-color-scheme: light)" scheme: default @@ -38,8 +40,13 @@ theme: # To set logos for different color schemes, use: extra: - logo_default: assets/images/A-Profiles-white.png - logo_slate: assets/images/A-Profiles.png + social: + - icon: fontawesome/solid/globe + link: https://vprofiles.met.no + name: V-Profiles + # Optional: Support for dark/light mode with custom logos + logo_light: assets/images/A-Profiles-white.png # Logo for light mode + logo_dark: assets/images/A-Profiles.png # Logo for dark mode # Repository information (replaces the 'icon_links' feature in Sphinx) repo_name: "AugustinMortier/A-Profiles" @@ -93,7 +100,7 @@ extra_css: extra_javascript: - assets/js/custom.js -extra_files: - - aprofiles/cli/aprocess.py - - aprofiles/cli/utils/workflow.py +#extra_files: +# - aprofiles/cli/aprocess.py +# - aprofiles/cli/utils/workflow.py