calculating total # of consecutive dry and wet days using NASA's TRMM daily precipitation data
조회 수: 2 (최근 30일)
이전 댓글 표시
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
Jess Lovering
2019년 8월 22일
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.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!