Inspect gridding¶
In [1]:
Copied!
import pandas as pd
from ghg_forcing_for_cmip import CONFIG, plotting
import pandas as pd
from ghg_forcing_for_cmip import CONFIG, plotting
/home/docs/checkouts/readthedocs.org/user_builds/ghg-forcing-for-cmip/envs/latest/lib/python3.11/site-packages/pydantic_settings/main.py:426: UserWarning: Config key `pyproject_toml_table_header` is set in model_config but will be ignored because no PyprojectTomlConfigSettingsSource source is configured. To use this config key, add a PyprojectTomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook. self._settings_warn_unused_config_keys(sources, self.model_config) /home/docs/checkouts/readthedocs.org/user_builds/ghg-forcing-for-cmip/envs/latest/lib/python3.11/site-packages/pydantic_settings/main.py:426: UserWarning: Config key `toml_file` is set in model_config but will be ignored because no TomlConfigSettingsSource source is configured. To use this config key, add a TomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook. self._settings_warn_unused_config_keys(sources, self.model_config)
In [2]:
Copied!
# load raw data set
df_ch4 = pd.read_csv("data/downloads/ch4/ch4_gb_raw.csv")
df_ch4_eo = pd.read_csv("data/downloads/ch4/ch4_eo_raw.csv")
df_co2 = pd.read_csv("data/downloads/co2/co2_gb_raw.csv")
df_co2_eo = pd.read_csv("data/downloads/co2/co2_eo_raw.csv")
# load raw data set
df_ch4 = pd.read_csv("data/downloads/ch4/ch4_gb_raw.csv")
df_ch4_eo = pd.read_csv("data/downloads/ch4/ch4_eo_raw.csv")
df_co2 = pd.read_csv("data/downloads/co2/co2_gb_raw.csv")
df_co2_eo = pd.read_csv("data/downloads/co2/co2_eo_raw.csv")
Inspect gridding and coverage for ground-based data¶
In [3]:
Copied!
# plot subset of entire grid
# shows raw data points and grid-average value
plotting.plot_gridsizes(df_ch4, CONFIG.GRID_CELL_SIZE, True)
# plot subset of entire grid
# shows raw data points and grid-average value
plotting.plot_gridsizes(df_ch4, CONFIG.GRID_CELL_SIZE, True)
Out[3]:
(<Figure size 640x480 with 2 Axes>,
<Axes: title={'center': '5 x 5 grid size'}, xlabel='longitude', ylabel='latitude'>)
In [4]:
Copied!
# plot entire grid
# shows only grid-average values
plotting.plot_gridsizes(df_ch4, CONFIG.GRID_CELL_SIZE, False)
# plot entire grid
# shows only grid-average values
plotting.plot_gridsizes(df_ch4, CONFIG.GRID_CELL_SIZE, False)
Out[4]:
(<Figure size 640x480 with 2 Axes>,
<Axes: title={'center': '5 x 5 grid size'}, xlabel='longitude', ylabel='latitude'>)
In [5]:
Copied!
# plot subset of entire grid
# shows raw data points and grid-average value
plotting.plot_gridsizes(df_co2, CONFIG.GRID_CELL_SIZE, True)
# plot subset of entire grid
# shows raw data points and grid-average value
plotting.plot_gridsizes(df_co2, CONFIG.GRID_CELL_SIZE, True)
Out[5]:
(<Figure size 640x480 with 2 Axes>,
<Axes: title={'center': '5 x 5 grid size'}, xlabel='longitude', ylabel='latitude'>)
In [6]:
Copied!
# plot entire grid
# shows only grid-average values
plotting.plot_gridsizes(df_co2, CONFIG.GRID_CELL_SIZE, False)
# plot entire grid
# shows only grid-average values
plotting.plot_gridsizes(df_co2, CONFIG.GRID_CELL_SIZE, False)
Out[6]:
(<Figure size 640x480 with 2 Axes>,
<Axes: title={'center': '5 x 5 grid size'}, xlabel='longitude', ylabel='latitude'>)