calculating total # of consecutive dry and wet days using NASA's TRMM daily precipitation data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone.
I have 21 years (1998-2018) of daily precipitation data (individual nc4 files, each with lon, lat, precip and time variables).
I need to find the total # of events of consecutive dry/wet days per month during the summer season for each year in the US (June,July,August), if at all possible. For example: June 1998, July 1998, August 1998, June 1999, July 1999, August 1999, ... June 2018, July 2018, August 2018.
Wet days are precip > 1mm and dry days is precip < 0.1 mm. Unfortunately, I couldn't attach a file because it is not supported.
I am brand new to this, and unfortunately, my advisor only uses fortran and can't guide me with this task.
Your help is greatly appreciated.
2 Commenti
Jess Lovering
il 22 Ago 2019
Without seeing the data and how you read in the file, it is a bit difficult to give precise advice, but I would start would these steps and looking into the help for these functions:
Read in the data, convert the time data into a datetime format using the datetime() command:
precip_date = datetime(inputvariable);
You can trim down all of your data to only the summer months using the month() and find() functions:
summer_indices = find(month(precip_date)==6|month(precip_date)==7|month(precip_date)==8)
summer_dates = precip_date(summer_indices);
summer_precip = precip(summer_indices);
Make a varible to classify the data as wet or dry, then assign a value of 1 or 0 to determine if it is a wet or dry day from the precipitation value with something similar to this:
day_class = zeros(1,length(precip); day_class(precip>1) = 1;
Use the diff(day_class) function to see where the values change from wet to dry (-1 or 1 when it changes and zero when it is constant). Hopefully this will at least give you a starting point of where to look in the help.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Weather and Atmospheric Science in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!