Open CollinWoo opened 3 years ago
@10aDing to test the profiler and get back to us!
@bpbond I'm not completely sure about how profiling works, but I ran a profile for SMOStif for 12 seconds and it seems that the majority of the time was taken up by the call to the extractSMOS function. The extractSMOS calculation lasts for about 8 seconds in total:
Okay. Is the GitHub code fully updated for me to pull?
The moisture branch should be up to date. I think I fixed the issue with the nonexistent column error as well.
@10aDing
Your SMOStifnames
function currently takes a vector of dates and constructs filenames from them. It does so for every individual date, even though we know there's going to be lots of overlap:
Browse[2]> length(datevec)
[1] 86479
Browse[2]> length(unique(datevec))
[1] 355
In other words, for the hirano example there are 86,479 dates...but only 355 unique dates. 99.6% of the work you're doing here is completely unnecessary. Do you understand this?
I will open a PR to improve this.
The code I wrote to extract the moisture from multiple files (SMOStif) takes about three minutes to run with the large dataset of 100,000 timestamps. Finding a way to reduce this runtime would be desirable. The code is pasted below: