timeki's picture
talk_to_ipcc (#29)
711bc31 verified
from climateqa.engine.talk_to_data.ui_config import PRECIPITATION_COLORSCALE, TEMPERATURE_COLORSCALE
DRIAS_TABLES = [
"total_winter_precipitation",
"total_summer_precipitation",
"total_annual_precipitation",
"total_remarkable_daily_precipitation",
"frequency_of_remarkable_daily_precipitation",
"extreme_precipitation_intensity",
"mean_winter_temperature",
"mean_summer_temperature",
"mean_annual_temperature",
"number_of_tropical_nights",
"maximum_summer_temperature",
"number_of_days_with_tx_above_30",
"number_of_days_with_tx_above_35",
"number_of_days_with_a_dry_ground",
]
DRIAS_INDICATOR_COLUMNS_PER_TABLE = {
"total_winter_precipitation": "total_winter_precipitation",
"total_summer_precipitation": "total_summer_precipitation",
"total_annual_precipitation": "total_annual_precipitation",
"total_remarkable_daily_precipitation": "total_remarkable_daily_precipitation",
"frequency_of_remarkable_daily_precipitation": "frequency_of_remarkable_daily_precipitation",
"extreme_precipitation_intensity": "extreme_precipitation_intensity",
"mean_winter_temperature": "mean_winter_temperature",
"mean_summer_temperature": "mean_summer_temperature",
"mean_annual_temperature": "mean_annual_temperature",
"number_of_tropical_nights": "number_tropical_nights",
"maximum_summer_temperature": "maximum_summer_temperature",
"number_of_days_with_tx_above_30": "number_of_days_with_tx_above_30",
"number_of_days_with_tx_above_35": "number_of_days_with_tx_above_35",
"number_of_days_with_a_dry_ground": "number_of_days_with_dry_ground"
}
DRIAS_MODELS = [
'ALL',
'RegCM4-6_MPI-ESM-LR',
'RACMO22E_EC-EARTH',
'RegCM4-6_HadGEM2-ES',
'HadREM3-GA7_EC-EARTH',
'HadREM3-GA7_CNRM-CM5',
'REMO2015_NorESM1-M',
'SMHI-RCA4_EC-EARTH',
'WRF381P_NorESM1-M',
'ALADIN63_CNRM-CM5',
'CCLM4-8-17_MPI-ESM-LR',
'HIRHAM5_IPSL-CM5A-MR',
'HadREM3-GA7_HadGEM2-ES',
'SMHI-RCA4_IPSL-CM5A-MR',
'HIRHAM5_NorESM1-M',
'REMO2009_MPI-ESM-LR',
'CCLM4-8-17_HadGEM2-ES'
]
# Mapping between indicator columns and their units
DRIAS_INDICATOR_TO_UNIT = {
"total_winter_precipitation": "mm",
"total_summer_precipitation": "mm",
"total_annual_precipitation": "mm",
"total_remarkable_daily_precipitation": "mm",
"frequency_of_remarkable_daily_precipitation": "days",
"extreme_precipitation_intensity": "mm",
"mean_winter_temperature": "°C",
"mean_summer_temperature": "°C",
"mean_annual_temperature": "°C",
"number_tropical_nights": "days",
"maximum_summer_temperature": "°C",
"number_of_days_with_tx_above_30": "days",
"number_of_days_with_tx_above_35": "days",
"number_of_days_with_dry_ground": "days"
}
DRIAS_PLOT_PARAMETERS = [
'year',
'location'
]
DRIAS_INDICATOR_TO_COLORSCALE = {
"total_winter_precipitation": PRECIPITATION_COLORSCALE,
"total_summer_precipitation": PRECIPITATION_COLORSCALE,
"total_annual_precipitation": PRECIPITATION_COLORSCALE,
"total_remarkable_daily_precipitation": PRECIPITATION_COLORSCALE,
"frequency_of_remarkable_daily_precipitation": PRECIPITATION_COLORSCALE,
"extreme_precipitation_intensity": PRECIPITATION_COLORSCALE,
"mean_winter_temperature":TEMPERATURE_COLORSCALE,
"mean_summer_temperature":TEMPERATURE_COLORSCALE,
"mean_annual_temperature":TEMPERATURE_COLORSCALE,
"number_tropical_nights": TEMPERATURE_COLORSCALE,
"maximum_summer_temperature":TEMPERATURE_COLORSCALE,
"number_of_days_with_tx_above_30": TEMPERATURE_COLORSCALE,
"number_of_days_with_tx_above_35": TEMPERATURE_COLORSCALE,
"number_of_days_with_dry_ground": TEMPERATURE_COLORSCALE
}
DRIAS_UI_TEXT = """
Hi, I'm **Talk to Drias**, designed to answer your questions using [**DRIAS - TRACC 2023**](https://www.drias-climat.fr/accompagnement/sections/401) data.
I'll answer by displaying a list of SQL queries, graphs and data most relevant to your question.
You can ask me anything about these climate indicators: **temperature**, **precipitation** or **drought**.
You can specify **location** and/or **year**.
You can choose from a list of climate models. By default, we take the **average of each model**.
For example, you can ask:
- What will the temperature be like in Paris?
- What will be the total rainfall in France in 2030?
- How frequent will extreme events be in Lyon?
**Example of indicators in the data**:
- Mean temperature (annual, winter, summer)
- Total precipitation (annual, winter, summer)
- Number of days with remarkable precipitations, with dry ground, with temperature above 30°C
⚠️ **Limitations**:
- You can't ask anything that isn't related to **DRIAS - TRACC 2023** data.
- You can only ask about **locations in France**.
- If you specify a year, there may be **no data for that year for some models**.
- You **cannot compare two models**.
🛈 **Information**
Please note that we **log your questions for meta-analysis purposes**, so avoid sharing any sensitive or personal information.
"""