-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,593 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
examples/recipes/AtmosphericFlux/atmospheric_flux.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "42082fbc", | ||
"metadata": {}, | ||
"source": [ | ||
"# Atmospheric flux operator" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a3eae4ea-0aca-4502-9043-54e2ca6fcab9", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pyarts\n", | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "952fa30f-9620-493b-9a69-7ea46d0ae9b7", | ||
"metadata": {}, | ||
"source": [ | ||
"## Initialize the operator\n", | ||
"\n", | ||
"See [AtmosphericFlux](pyarts.recipe.rst#pyarts.recipe.AtmosphericFlux)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b1943594-5e27-4c9c-831c-c575bbc08c6c", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fop = pyarts.recipe.AtmosphericFlux()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "df821a5e-11df-4000-a66f-b19ce8a431d1", | ||
"metadata": {}, | ||
"source": [ | ||
"## Get the atmosphere (optional)\n", | ||
"The atmosphere is the full atmospheric field of ARTS as a dictionary,\n", | ||
"which is likely more than you wish to change. You may change only part\n", | ||
"of the atmosphere by simply creating a dictionary that only contains the\n", | ||
"fields that you want to change." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "79c18bda-7f10-42cb-87b0-ba636cef37f9", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"atm = fop.get_atmosphere()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "da679d8d-8eef-4437-b299-7c85487df39a", | ||
"metadata": {}, | ||
"source": [ | ||
"## Get the profile flux for the given `atm`\n", | ||
"Passing `atm` is optional, if not passed the operator will use the current atmosphere,\n", | ||
"which is the atmosphere that was set with the last call to `__call__`, or the constructor\n", | ||
"default if no call to `__call__` has been made." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ebf13038-90c1-44dc-93ad-63d4d3da105b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"solar, thermal, altitude = fop(atmospheric_profile=atm)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "25eafbd8", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plot" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b998604b-98aa-4f46-bf78-288d65ffb78e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.figure(1, figsize=(8, 6))\n", | ||
"plt.clf()\n", | ||
"plt.subplot(121)\n", | ||
"plt.plot(solar.up, altitude/1e3)\n", | ||
"plt.plot(solar.down, altitude/1e3)\n", | ||
"plt.legend([\"up\", \"down\"])\n", | ||
"plt.ylabel(\"Altitude [km]\")\n", | ||
"plt.xlabel(\"Flux [W / m$^2$]\")\n", | ||
"plt.title(\"Solar flux\")\n", | ||
"\n", | ||
"plt.subplot(122)\n", | ||
"plt.plot(thermal.up, altitude/1e3)\n", | ||
"plt.plot(thermal.down, altitude/1e3)\n", | ||
"plt.legend([\"up\", \"down\"])\n", | ||
"plt.ylabel(\"Altitude [km]\")\n", | ||
"plt.xlabel(\"Flux [W / m$^2$]\")\n", | ||
"plt.title(\"Thermal flux\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.12.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.