firelab / viirs_ba

Python code for burned area estimation using VIIRS scenes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple_confirm_burns bottleneck

bnordgren opened this issue · comments

Bryce,
The Simple confirm burn seems to be a bottle neck. This speed things up when the database was smaller, but now seems to be slowing things down. Earlier I had mentioned taking this out, but that that would result in growth off thresholded cells. I think we can get around that by adding a requirement that to the threshold_2_fire_events function that the source must be ActiveFire (and removing the confirmed = true requirement).
An updated version of the function is below. I did some quick testing and this speed things up significantly. I’m still verifying that it works the same, but it seems to.

You will need to comment out the bit that runs simple confirm burn (~539-543):
# # simple confirm threshold burns
# print "\nPerform simple confirm burned area"
# date_4db = datetime.datetime.strftime(H5Date, "%Y-%m-%d %H:%M:%S")
# execute_simple_confirm_burns(date_4db, TemporalProximity, SpatialProximity)
# #vacuum_analyze("threhold_burned")

Also note that there is a typo in the following function, see highlighted bit should be “Start threshold_2_events”:
def execute_threshold_2_events(collectionDate, interval, distance):
print "Start simple confirm burn", get_time()
query_text = "SELECT VIIRS_threshold_2_fireevents('{0}', '{1}', {2});".format(collectionDate, interval, distance)
execute_query(query_text)

Code on the brute_force branch now has these changes.