{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Run Synsat on ICON Data for ABI" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here, we will \n", "- load ICON test data (limited area simulation, stored in separate files, from IFCES2 project)\n", "- run Synsat on ICON for ABI and\n", "- finally store the Synsats into a netcdf file\n", "\n", "The workflow is similar to [04-Run-Synsat-on-ICON-Data-for-SEVIRI.ipynb](04-Run-Synsat-on-ICON-Data-for-SEVIRI.ipynb).\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup Env and Load Libraries " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [] }, "outputs": [], "source": [ "import os, sys\n", "os.environ['RTTOV_PYTHON_WRAPPER'] = '/work/bb1262/tools/rttov/rttov-v13.2/wrapper'\n", "\n", "import warnings\n", "warnings.filterwarnings(\"ignore\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [] }, "outputs": [], "source": [ "import synsatipy\n", "\n", "from synsatipy.synsat import SynSat\n", "\n", "import synsatipy.synsat_example_data as synsat_example_data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Steps towards Synsat " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step I: Initialize Synsat class" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] set cloud / aerosol file to /work/bb1262/tools/rttov/rttov-v13.2/rtcoef_rttov13/cldaer_visir/sccldcoef_goes_16_abi.dat\n", "... [synsat] load coefficient file /work/bb1262/tools/rttov/rttov-v13.2/rtcoef_rttov13/rttov13pred54L/rtcoef_goes_16_abi_o3.dat\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Load successful >>>>> inst_id : 1, nchannels : 10.\n", " 2025/05/07 14:31:03 Load coefficients:\n", " 2025/05/07 14:31:03 /work/bb1262/tools/rttov/rttov-v13.2/rtcoef_rttov13/rttov13pred54L/rtcoef_goes_16_abi_o3.dat\n", " 2025/05/07 14:31:03 /work/bb1262/tools/rttov/rttov-v13.2/rtcoef_rttov13/cldaer_visir/sccldcoef_goes_16_abi.dat\n" ] } ], "source": [ "s = SynSat( synsat_instrument = 'ABI' )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step II: Load Example Data " ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] read data from file /work/bb1376/data/icon/atlantic-cases/paulette/ifces2-atlanXL-20200907-exp021/POSTPROC//3d_full_base_DOM01_ML_20200912T000000Z_regrid7km.nc\n" ] } ], "source": [ "iconname = synsat_example_data.get_example_data( 'icon01' )\n", "s.load( iconname, isel = {'lon': slice(0,None,4), 'lat': slice(0,None, 4)} )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step III: Setup Run Options and Start Execution " ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "tags": [] }, "outputs": [], "source": [ "s._options.Nthreads=4\n", "s._options.NprofsPerCall = 2000" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 0/27 chunk with {'profile': slice(0, 2000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:08 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 1/27 chunk with {'profile': slice(2000, 4000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:13 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 2/27 chunk with {'profile': slice(4000, 6000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:17 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 3/27 chunk with {'profile': slice(6000, 8000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:22 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 4/27 chunk with {'profile': slice(8000, 10000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:27 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 5/27 chunk with {'profile': slice(10000, 12000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:31 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 6/27 chunk with {'profile': slice(12000, 14000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:35 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 7/27 chunk with {'profile': slice(14000, 16000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:40 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 8/27 chunk with {'profile': slice(16000, 18000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:44 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 9/27 chunk with {'profile': slice(18000, 20000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:49 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 10/27 chunk with {'profile': slice(20000, 22000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:53 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n", " 2025/05/07 14:31:53 rttov_check_reg_limits.F90\n", " Input water vapour profile exceeds upper coef limit (profile number = 489)\n", " 2025/05/07 14:31:53 Limit = 20.3040\n", " 2025/05/07 14:31:53 p (hPa) = 97.1505\n", " 2025/05/07 14:31:53 Value = 20.7966\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 11/27 chunk with {'profile': slice(22000, 24000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:31:57 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 12/27 chunk with {'profile': slice(24000, 26000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:02 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 13/27 chunk with {'profile': slice(26000, 28000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:06 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 14/27 chunk with {'profile': slice(28000, 30000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:11 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 15/27 chunk with {'profile': slice(30000, 32000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:15 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 16/27 chunk with {'profile': slice(32000, 34000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:20 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 17/27 chunk with {'profile': slice(34000, 36000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:24 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 18/27 chunk with {'profile': slice(36000, 38000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:28 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 19/27 chunk with {'profile': slice(38000, 40000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:32 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 20/27 chunk with {'profile': slice(40000, 42000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:36 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 21/27 chunk with {'profile': slice(42000, 44000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:41 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 22/27 chunk with {'profile': slice(44000, 46000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:45 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 23/27 chunk with {'profile': slice(46000, 48000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:49 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 24/27 chunk with {'profile': slice(48000, 50000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:54 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 25/27 chunk with {'profile': slice(50000, 52000, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:32:58 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... [synsat] running 26/27 chunk with {'profile': slice(52000, None, None)}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "IR emissivity atlas loaded successfully\n", "Atlas deallocated.\n", " 2025/05/07 14:33:02 Running RTTOV using nthreads = 4 and nprofs_per_call = 2000\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 2min 35s, sys: 1min 32s, total: 4min 7s\n", "Wall time: 1min 58s\n" ] } ], "source": [ "%%time\n", "\n", "s.run( chunked = True )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step IV: Extract the Output" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "tags": [] }, "outputs": [], "source": [ "icon_synsat = s.extract_output()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Size: 4MB\n", "Dimensions: (time: 1, lon: 274, lat: 192)\n", "Coordinates:\n", " * time (time) datetime64[ns] 8B 2020-09-12\n", " * lon (lon) float32 1kB -85.0 -84.74 -84.49 ... -15.62 -15.37 -15.11\n", " * lat (lat) float32 768B 0.0 0.24 0.48 0.72 ... 45.12 45.36 45.6 45.84\n", "Data variables:\n", " bt039 (time, lon, lat) float64 421kB 304.0 303.6 307.0 ... 286.8 287.4\n", " bt062 (time, lon, lat) float64 421kB 240.1 240.0 240.0 ... 224.7 224.7\n", " bt069 (time, lon, lat) float64 421kB 249.5 249.4 249.3 ... 235.2 233.6\n", " bt073 (time, lon, lat) float64 421kB 260.1 260.0 260.0 ... 245.8 244.1\n", " bt084 (time, lon, lat) float64 421kB 288.2 288.4 287.6 ... 280.1 280.6\n", " bt096 (time, lon, lat) float64 421kB 263.1 263.3 262.6 ... 237.8 238.0\n", " bt103 (time, lon, lat) float64 421kB 290.6 290.9 289.9 ... 284.1 284.6\n", " bt112 (time, lon, lat) float64 421kB 290.0 290.3 289.5 ... 284.3 285.0\n", " bt123 (time, lon, lat) float64 421kB 287.7 287.8 287.3 ... 281.4 282.2\n", " bt133 (time, lon, lat) float64 421kB 275.0 275.0 274.8 ... 257.9 258.3\n", "Attributes:\n", " author: Fabian Senf\n", " contact: senf@tropos.de\n", " institution: Leibniz Institute for Tropospheric Research\n", " creation_time: 2025-05-07 14:33:03.622154\n", " synsat_version: 0.1\n", " synsat_githash: 0df3af024bb4d51374707470fc7c2dacc5df4f96\n", " license: CC-BY SA 3.0\n", " _local_software_path: /home/b/b380352/proj/2022-01_RTTOV-Synsat/synsatip...\n", " input_filename: /work/bb1376/data/icon/atlantic-cases/paulette/ifc...\n" ] } ], "source": [ "print( icon_synsat )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step V: Store Data " ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "... store synsat at ./Data/abi_synsat_icon_example_data.nc\n" ] } ], "source": [ "outdir = './Data'\n", "\n", "if not os.path.isdir( outdir ):\n", " os.makedirs( outdir )\n", "outfile = f'{outdir}/abi_synsat_icon_example_data.nc'\n", "\n", "print(f'... store synsat at {outfile}')\n", "icon_synsat.to_netcdf(outfile)\n" ] } ], "metadata": { "kernelspec": { "display_name": "SynSatiPy (Python 3.10)", "language": "python", "name": "python3-synsatipy" }, "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.10" } }, "nbformat": 4, "nbformat_minor": 4 }