Skip to content

Commit

Permalink
Updating Docs for commit d593cf3 made on 2024-09-18T13:09:01+00:00 fr…
Browse files Browse the repository at this point in the history
…om refs/heads/main by slarosa
  • Loading branch information
slarosa committed Sep 18, 2024
0 parents commit f165652
Show file tree
Hide file tree
Showing 649 changed files with 139,122 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub Pages Cache
Nothing to see here. The contents of this branch are essentially a cache that's not intended to be viewed on github.com.
If you're looking to update our documentation, check the relevant development branch's 'docs/' dir.
4 changes: 4 additions & 0 deletions en/main/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 89cee837b0976258984cb53dbc57f17c
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added en/main/.doctrees/api.doctree
Binary file not shown.
Binary file added en/main/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file added en/main/.doctrees/examples/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/main/.doctrees/examples/plot_bt_era5.doctree
Binary file not shown.
Binary file not shown.
Binary file added en/main/.doctrees/examples/plot_bt_igra2.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/main/.doctrees/generated/pyrtlib.utils.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/main/.doctrees/index.doctree
Binary file not shown.
Binary file added en/main/.doctrees/installation.doctree
Binary file not shown.
259 changes: 259 additions & 0 deletions en/main/.doctrees/nbsphinx/notebook/Pressure_Broadening_effect.ipynb

Large diffs are not rendered by default.

252 changes: 252 additions & 0 deletions en/main/.doctrees/nbsphinx/notebook/first_run.ipynb

Large diffs are not rendered by default.

908 changes: 908 additions & 0 deletions en/main/.doctrees/nbsphinx/notebook/tutorial.ipynb

Large diffs are not rendered by default.

376 changes: 376 additions & 0 deletions en/main/.doctrees/nbsphinx/notebook/uncertainty.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added en/main/.doctrees/notebook/first_run.doctree
Binary file not shown.
Binary file added en/main/.doctrees/notebook/index.doctree
Binary file not shown.
Binary file added en/main/.doctrees/notebook/tutorial.doctree
Binary file not shown.
Binary file added en/main/.doctrees/notebook/uncertainty.doctree
Binary file not shown.
Binary file added en/main/.doctrees/references.doctree
Binary file not shown.
Binary file added en/main/.doctrees/sg_execution_times.doctree
Binary file not shown.
Empty file added en/main/.nojekyll
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""
Performing Upwelling Brightness Temperature calculation using IGRA2 Upper Air Observations (with Extrapolation).
================================================================================================================
"""

# %%
# This example shows how to use the
# :py:class:`pyrtlib.tb_spectrum.TbCloudRTE` method to calculate brightness temperature from satellite (upwelling) using
# observations from IGRA2 Upper Air Archive and comparison of BT with the extrapoletd profile.

import numpy as np
from datetime import datetime

import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 15})

from pyrtlib.tb_spectrum import TbCloudRTE
from pyrtlib.climatology import ProfileExtrapolation
from pyrtlib.utils import dewpoint2rh, to_kelvin
from pyrtlib.absorption_model import H2OAbsModel
from pyrtlib.apiwebservices import IGRAUpperAir

date = datetime(2020, 6, 1, 12)
station = 'SPM00008221'
df_igra2, header = IGRAUpperAir.request_data(date, station)

df_igra2 = df_igra2[df_igra2.pressure.notna() &
df_igra2.temperature.notna() &
df_igra2.dewpoint.notna() &
df_igra2.height.notna()]

z, p, t = df_igra2.height.values / 1000, df_igra2.pressure.values, to_kelvin(df_igra2.temperature.values)

rh = dewpoint2rh(df_igra2.dewpoint, df_igra2.temperature).values

mdl = 'R21SD'
frq = np.arange(20, 201, 1)
nf = len(frq)

rte = TbCloudRTE(z, p, t, rh, frq)
rte.init_absmdl('R20')
H2OAbsModel.model = 'R21SD'
H2OAbsModel.set_ll()
df = rte.execute()
df = df.set_index(frq)

# %%
# Extrapolation of profile
ex = ProfileExtrapolation()
zz, pp, tt, rhh = ex.profile_extrapolation(header.latitude.values[0], 6, z, (p, t, rh))

rte = TbCloudRTE(zz, pp, tt, rhh, frq)
rte.init_absmdl('R20')
H2OAbsModel.model = 'R21SD'
H2OAbsModel.set_ll()
dff = rte.execute()
dff = dff.set_index(frq)

#%%
# Plotting
fig, ax = plt.subplots(1, 1, figsize=(12, 8))
plt.suptitle("{}, {}, {} - {}".format(header.site_id.values[0], header.latitude.values[0], header.longitude.values[0], header.date.values[0]), y=0.96)
plt.title("IGRA2 UpperAir Radiosonde Archive", fontsize=10, ha='center')
ax.set_xlabel('Frequency [GHz]')
ax.set_ylabel('${T_B}$ [K]')
df.tbtotal.plot(ax=ax, linewidth=2, label='{} - {}'.format(header.site_id.values[0], mdl))
dff.tbtotal.plot(ax=ax, linewidth=2, label='Extrap {} - {}'.format(header.site_id.values[0], mdl))
ax.grid(True, 'both')
ax.legend()
plt.show()

#%%
# Difference BT

df['delta'] = dff.tbtotal - df.tbtotal
df.delta.plot(linewidth=2, xlabel='Frequency [GHz]', ylabel='$\Delta T_B$ [K]', grid=True, figsize=(12, 8))
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Generic Example\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This example shows how to use calculate the upwelling brigthness temperature by using R16 and R03 absorption model\nand then plotting them difference.\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n\nplt.rcParams.update({'font.size': 15})\nimport matplotlib.ticker as ticker\nfrom matplotlib.ticker import ScalarFormatter\nimport numpy as np"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Import pyrtlib package\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from pyrtlib.climatology import AtmosphericProfiles as atmp\nfrom pyrtlib.tb_spectrum import TbCloudRTE\nfrom pyrtlib.utils import ppmv2gkg, mr2rh"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"atm = ['Tropical',\n 'Midlatitude Summer',\n 'Midlatitude Winter',\n 'Subarctic Summer',\n 'Subarctic Winter',\n 'U.S. Standard']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load standard atmosphere (low res at lower levels, only 1 level within 1 km) and define which absorption model will be used.\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"z, p, d, t, md = atmp.gl_atm(atmp.TROPICAL)\ngkg = ppmv2gkg(md[:, atmp.H2O], atmp.H2O)\nrh = mr2rh(p, t, gkg)[0] / 100\n\nmdl = 'R16'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Performing upwelling brightness temperature calculation\n\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Default calculatoin consideres no cloud\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ang = np.array([90.])\nfrq = np.arange(20, 201, 1)\nnf = len(frq)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Setup matplotlib plot\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(12,8))\nax.set_xlabel('Frequency [GHz]')\nax.set_ylabel('${T_B}$ [K]')\n\nrte = TbCloudRTE(z, p, t, rh, frq, ang)\nrte.init_absmdl(mdl)\ndf = rte.execute()\n\ndf = df.set_index(frq)\ndf.tbtotal.plot(ax=ax, linewidth=1, label='{} - {}'.format(atm[atmp.TROPICAL], mdl))\n\nax.legend()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Print dataframe\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Performing calculation for R03 absorption model\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"mdl = 'R03'\nrte.init_absmdl(mdl)\ndf_r03 = rte.execute()\ndf_r03 = df_r03.set_index(frq)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add brigthness temperature values as new column\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df['delta'] = df.tbtotal - df_r03.tbtotal"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Difference between R16 and R03 brightness temperature\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(12,8))\nax.set_xlabel('Frequency [GHz]')\nax.set_ylabel('$\\Delta {T_B}$ [K]')\ndf.delta.plot(ax=ax, figsize=(12,8), label='$\\Delta {T_B}$ (R16-R03)')\nax.legend()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Performing downwelling brightness temperature calculation\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(12,8))\nax.set_xlabel('Frequency [GHz]')\nax.set_ylabel('${T_B}$ [K]')\n\nrte.satellite = False\ndf_from_ground = rte.execute()\n\ndf_from_ground = df_from_ground.set_index(frq)\ndf_from_ground.tbtotal.plot(ax=ax, linewidth=1, label='{} - {}'.format(atm[atmp.TROPICAL], mdl))\nax.legend()\nplt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df_from_ground"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Performing Downwelling Brightness Temperature calculation in cloudy condition.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This example shows how to use the\n:py:class:`pyrtlib.tb_spectrum.TbCloudRTE` method to calculate brightness temperature from ground (downwelling) in cloudy condition\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nfrom matplotlib.ticker import FixedLocator, FormatStrFormatter\nplt.rcParams.update({'font.size': 15})\nimport numpy as np\nnp.seterr('raise')\n\nfrom pyrtlib.climatology import AtmosphericProfiles as atmp\nfrom pyrtlib.tb_spectrum import TbCloudRTE\nfrom pyrtlib.utils import ppmv2gkg, mr2rh\n\natm = ['Tropical',\n 'Midlatitude Summer',\n 'Midlatitude Winter',\n 'Subarctic Summer',\n 'Subarctic Winter',\n 'U.S. Standard']\n\nfig, ax = plt.subplots(1, 1, figsize=(12, 8))\n\nz, p, d, t, md = atmp.gl_atm(atmp.MIDLATITUDE_SUMMER)\ngkg = ppmv2gkg(md[:, atmp.H2O], atmp.H2O)\nrh = mr2rh(p, t, gkg)[0] / 100\n\nmdl = 'R19SD'\n\nang = np.array([90.])\nfrq = np.arange(20, 61, 1)\nnf = len(frq)\n\ndenliq = np.zeros(z.shape)\ndenice = np.zeros(z.shape)\ncldh = np.empty((2, 2))\n\nfor i in [False, True]:\n if not i:\n text_plot = 'clear-sky'\n else:\n # build a cloud\n ib = 1\n it = 3\n denliq[ib:it + 1] = 10 * np.ones((it - ib + 1))\n cldh[:, 0] = np.array([z[ib], z[it]])\n ib = 29\n it = 31\n denice[ib:it + 1] = 0.1 * np.ones((it - ib + 1))\n cldh[:, 1] = np.array([z[ib], z[it]])\n text_plot = 'cloudy'\n\n ax.set_xlabel('Frequency (GHz)')\n ax.set_ylabel('BT (K)')\n\n rte = TbCloudRTE(z, p, t, rh, frq, ang)\n rte.satellite = False\n rte.cloudy = i\n rte.init_cloudy(cldh, denice, denliq)\n rte.init_absmdl(mdl)\n df = rte.execute()\n\n df = df.set_index(frq)\n df.tbtotal.plot(x=frq, ax=ax, linewidth=1,\n label='{} - {} ({})'.format(atm[atmp.MIDLATITUDE_SUMMER], mdl, text_plot))\n\nax.grid(True, 'both')\nax.legend()\nplt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading

0 comments on commit f165652

Please sign in to comment.