Command line scripts.

banet_viirs750_download[source]

banet_viirs750_download(region:"Region name", tstart:"Start of serach window yyyy-mm-dd HH:MM:SS", tend:"End of search windo yyyy-mm-dd HH:MM:SS", path_save:"Path to save the outputs of the request", regions_path:"Path for region json files")

Example:

#!/bin/bash -l 
region="PI"
tstart="2017-10-27 00:00:00"
tend="2017-10-27 23:59:59"
path_save="/srv/banet/data/rawdata"
regions_path="/srv/banet/data/regions"
banet_viirs750_download $region "$tstart" "$tend" $path_save $regions_path

banet_create_dataset[source]

banet_create_dataset(region:"Region name", viirs_path:"Input path for VIIRS raw data", fires_path:"Input path for Active Fires csv", save_path:"Path to save outputs", regions_path:"Path where region defenition files are stored", mcd64_path:"Input path for MCD64 raw data"=None, cci51_path:"Input path for FireCCI51 raw data"=None, bands:"List of bands to use as inputs for VIIRS raw data"=['Reflectance_M5', 'Reflectance_M7', 'Reflectance_M10', 'Radiance_M12', 'Radiance_M15', 'SolarZenithAngle', 'SatelliteZenithAngle'], year:"Set to process a single year instead of all available"=None)

Examples:

#!/bin/bash -l
region=PI
viirs_path=/srv/banet/data/rawdata
mcd64_path=/srv/mcd64
cci51_path=/srv/BA_validation/data/FireCCI51
save_path=/srv/banet/data/procdata
fires_path=/srv/banet/data/hotspots
regions_path=/srv/banet/data/regions

# Create dataset only for VIIRS
banet_create_dataset $region $viirs_path $fires_path $save_path \
                     $regions_path --year=2017

# Create dataset for VIIRS and MCD64A1C6
banet_create_dataset $region $viirs_path $fires_path $save_path \
                     $regions_path --mcd64_path $mcd64_path --year=2017

# Create dataset for VIIRS, MCD64A1C6 and FireCCI51 data.
banet_create_dataset $region $viirs_path $fires_path $save_path \
                     $regions_path --mcd64_path $mcd64_path \
                     --cci51_path $cci51_path --year=2017

banet_dataset2tiles[source]

banet_dataset2tiles(region:"Region name", input_path:"Input path for dataset", output_path:"Output path for tiles dataset", size:"Tiles size"=128, step:"Step size of moving window to create tiles"=100, year:"Set to process a single year instead of all available"=None)

Examples:

#!/bin/bash -l
input_path=/srv/banet/data/procdata
output_path=/srv/banet/data/tiles/train
region=PI

banet_dataset2tiles $region $input_path $output_path

banet_predict_monthly[source]

banet_predict_monthly(region:"Region name", input_path:"Input path for dataset", output_path:"Output path for tiles dataset", year:"Set to process a single year instead of all available", weight_files:"List of pth weight files"=['/home/mnpinto/.banet/models/banetv0.20-val2017-fold0.pth', '/home/mnpinto/.banet/models/banetv0.20-val2017-fold1.pth', '/home/mnpinto/.banet/models/banetv0.20-val2017-fold2.pth'])

Example:

#!/bin/bash -l
input_path=/srv/banet/data/procdata
output_path=/srv/banet/data/monthly
region=PI
year=2017

banet_predict_monthly $region $input_path $output_path $year

banet_predict_times[source]

banet_predict_times(region:"Region name", tstart:"Start of serach window yyyy-mm-dd HH:MM:SS", tend:"End of search windo yyyy-mm-dd HH:MM:SS", input_path:"Input path for dataset", output_path:"Output path for tiles dataset", regions_path:"Path for region json files", product:"Name of product (default VIIRS750)"='VIIRS750', output:"Name of file to save results"='data', weight_files:"List of pth weight files"=['/home/mnpinto/.banet/models/banetv0.20-val2017-fold0.pth', '/home/mnpinto/.banet/models/banetv0.20-val2017-fold1.pth', '/home/mnpinto/.banet/models/banetv0.20-val2017-fold2.pth'])

Example:

#!/bin/bash -l
region="PI"
tstart="2017-10-27 00:00:00"
tend="2017-10-27 23:59:59"
input_path="/srv/banet/data/procdata"
output_path="/srv/banet/data/monthly"
regions_path="/srv/banet/data/regions"

banet_predict_times $region "$tstart" "$tend" $input_path $output_path $regions_path

banet_train_model[source]

banet_train_model(val_year:"Validation year", r_fold:"Fold name", input_path:"Input path for tiles dataset", output_path:"Path to save the model weights", n_epochs:"Number of epochs to train"=8, lr:"Learning rate"=0.01, nburned:"Minimum number of burned pixels to define a sequence"=10, n_episodes_train:"Number of episodes per train epoch"=2000, n_episodes_valid:"Number of episodes for validation"=100, sequence_len:"Number of time-steps in sequence"=64, n_sequences:"Number of sequences per batch"=1, pretrained_weights:"Path to a weights file"=None)

Example:

#!/bin/bash -l
val_year=2018
fold_name=99
input_path=/srv/banet/data/tiles/train
output_path=/srv/banet/data/models

banet_train_model $val_year $fold_name $input_path $output_path

banet_nrt_run[source]

banet_nrt_run(region:"Region name", left:"Left limit of the bounding box.", bottom:"Bottom limit of the bounding box.", right:"Right limit of the bounding box.", top:"Top limit of the bounding box.", project_path:"Root directory of the project", hotspots_region:"Hotspots region name", time:"Day for the run"='today', threshold:"Threshold to apply to output of the model"=0.5, skip_hotspots:"Skip download of ladsweb data"=False, skip_ladsweb:"Skip download of ladsweb data"=False, skip_preprocess:"Skip download of ladsweb data"=False, skip_getpreds:"Skip download of ladsweb data"=False)

The hotspots_region name should be defined according with the image bellow. Names with multiple words use _ in place of the spaces. More info here: https://firms.modaps.eosdis.nasa.gov/active_fire/#firms-txt

IPython.display.Image(url="https://firms.modaps.eosdis.nasa.gov/images/Regions_500px.jpg")

Example:

#!/bin/bash -l
region=PI
project_path=data
hotspots_region=Europe
left=-10
bottom=36
right=5
top=44
banet_nrt_run $region $left $bottom $right $top $project_path $hotspots_region

Important: Note that hotspots will only be automatically downloaded starting 7 days ago from the current date. If you want to compute burned areas for an earlier period you need to manually donwload the active fires data.