The code may priorize make all necessary calculations in Python and CDO . For python you will need pandas, numpy, scipy, xarray and alive-progress All conected by BASH and running in Linux systems.
==LINUX FIRST==
pip install pandas numpy scipy xarray alive-progress pyspark
./heatwave.sh netcdf/tmax.nc 1990 95 15 [netcdf/pr.nc] [netcdf/tmin.nc] [netcdf/percenttmax.nc] [netcdf/percenttmin.nc]All data need be with tmin name to minimum temperature values, tmax name to maximum temperature, lat to latitude values, lon to longitude values and time to datatime values the params inside [] are option that need only if the calculus need If you don't have the file, pass some else. If is'not necessary, will not be loaded
- If the time values are in Kelvin, convert automatically to Celsius
- If coordenates names are latitude or longitude, change to lat and lon
- If maximum temperature named like mn2t, change to tmax
- If minimum temperature named like tas, change to tmin
- If time variable named like valid_time, change to time
Output: The output is a named 'heatwave_opt*set.nc' and * is the option of heatwave calculations
The paramns are:
- it's the daily maximum temperature netcdf file complete, like (1961-2024)
- it's the year that start the calculation of index
- it's the percentil that is used in temperature relative calculations
- it's number of days that are used like window calculation
- it's the daily precipitation netcdf file, like (1961-2024)
- it's the daily minimum temperature netcdf file complete, like (1961-2024)
- it's the historic netcdf to construct tmax percent
- it's the historic netcdf to construct tmin percent
./intern/intensity.py- heatwave_opt$set.nc is the file where $ is the option of heatwave, with heatwave data
- historical_(min|max).nc is the file with old raw data that calculate heatwave index
- percent(min|max).nc is the file with climatological model to each variable
#1. tmax.nc is the tmax temperatura for one latitude and longitude #1. tmin.nc is the tmin temperatura for one latitude and longitude #1. pr.nc is the precipitation for one latitude and longitude
-
spy.py use the precipitaion to calculate the spi index
-
heatwave_opt1set.py calculate the heatwave by year, season and extention considering World Meteorogical Organization definition of Heatwave
-
heatwave_opt1set.py calculate the heatwave by year, season and extention considering World Meteorogical Organization definition of Heatwave using min temperature
-
heatwave_opt4set..py open the file in ./intern/heatwave3ormore.py, that create the heatwave files considering heatwaves when has 3 hotdays using maximum temperature
-
geirinhas.py calculate the index based at gueirinhas metodology
-
plot_spi.py create the graph of spi in html
-
plot_linear_tmaxtmin_heatwave.py create the graph of heatwave of tmaxtmin heatwaves
-
anomaly.py create the graph of temperature anomaly of each heatwave
-
intensity.py Calculate the Intensity over heatwaves
Support
- txttonetcdf.py open the file in ./dados/input.csv, that can be updated with excel and after to convert to netcdf
- Expand reference.py change the file expanding the latitude and longitude
- parquet2netcdf.py This function make the txt file chenge to netcdf
- support.py have all important functions
- preload_pr.py Load files and change configuration of precipitation data to avoid errors
- preload_tmax.py Load files and change configuration of maximum temperature data to avoid errors
- preload_tmin.py Load files and change configuration of minimum temperature data to avoid errors
Geirinhas, João & Russo, Ana & Libonati, Renata & Sousa, Pedro & Miralles, Diego & Trigo, Ricardo. (2021). Recent increasing frequency of compound summer drought and heatwaves in Southeast Brazil. Environmental Research Letters. 16. 10.1088/1748-9326/abe0eb.
United Nations Office for Disaster Rist Reduction, Accessed 3 mar 2024
Xavier, A. C., Scanlon, B. R., King, C. W., & Alves, A. I. (2022). New improved Brazilian daily weather gridded data (1961–2020) . International Journal of Climatology, 42(16), 8390– 8404. https://doi.org/10.1002/joc.7731
Intense Heat Wave
John R. Nairn 1,* and Robert J. B. Fawcett. (2013). The Excess Heat Factor: A Metric for Heatwave Intensity and Its Use in Classifying Heatwave Severity . International Journal of Environmental Research and Public Health (IJERPH)