Skip to content

thigs0/Heatwaves

Repository files navigation

Description of code and your functions

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.

To run the code

./extremos.sh netcdf/tmax.nc 1990 90 15 [netcdf/pr.nc] [netcdf/tmin.nc]

the params inside [] are option that need only if the calculus need The paramns are:

  1. it's the daily maximum temperature netcdf file complete, like (1961-2024)
  2. it's the year that start the calculation of index
  3. it's the percentil that is used in temperature relative calculations
  4. it's number of days that are used like window calculation
  5. it's the daily precipitation netcdf file, like (1961-2024)
  6. it's the daily minimum temperature netcdf file complete, like (1961-2024)

The images are saved ar directory "imagens" and the data are saved in directory "dados"

./dados

  1. Heatwave.csv is the file with annual heatwaves
  2. Heatwaves_days.csv is the file with the maximum continum period of heatwave
  3. Heatwaves_complete.csv is the file that say the dayly period of heatwaves. 0 don't have heatwave, 1 have heatwaves next 3 days
  4. season.csv if the file with daily heatwave, but separete by season, colum:1 of Nov-Fev, colum:2 of Mar-Mai, colum:3 of Jun-Ago, colum:4 of Set-Nov
  5. season_heatwave.csv is the heatwaves separate by season, colum:1 of Nov-Fev, colum:2 of Mar-Mai, colum:3 of Jun-Ago, colum:4 of Set-Nov
  6. kendall.csv is the file with heatwaves values for mann-Kendall test and linear regression
  7. input.csv is the file with all data from campinas in txt format the facilite the update

./netcdf

#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

./intern

  1. spy.py use the precipitaion to calculate the spi index

  2. HeatWave.py calculate the heatwave by year, season and extention considering World Meteorogical Organization definition of Heatwave

  3. tmaxtmin_heatwave.py calculate the heatwave by year, season and extention considering World Meteorogical Organization definition of Heatwave using min temperature

  4. geirinhas.py calculate the index based at gueirinhas metodology

  5. linear.py calculate the linear regresion and Mann-Kendall test for heatwaves

  6. linear_season.py calculate linear regression and Mann-Kendall test for season heatwaves and continum heatwaves

  7. plot_spi.py create the graph of spi in html

  8. plot_linear_tmaxtmin_heatwave.py create the graph of heatwave of tmaxtmin heatwaves

  9. anomaly.py create the graph of temperature anomaly of each heatwave

  10. cumulative_heat.py calculate the anomaly of temperature for each heatwave

  11. txttonetcdf.py open the file in ./dados/input.csv, that can be updated with excel and after to convert to netcdf

  12. heatwave3ormore open the file in ./intern/heatwave3ormore.py, that create the heatwave files considering heatwaves when has 3 hotdays using maximum temperature

Reference

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)

Example

The Heatwaves graph is:

Definitions Heatwaves by year Heatwaves by season
3 days with hot days using tmax 1 1
3 days with hot days using tmax and tmin 2 2
3 days or more with hot days using tmax 4 4
3 days or more with hot days using tmax and tmin 5 5

About

Calculate heatwaves with bash and python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published