A pixel based classifier that uses GOES raw products and shapefiles for generating truth set.
code/train.py
.code/config.json
config.json
is formatted as follows:
{
"type" : <'pixel' or 'DeConv'>,
"num_neighbor" : <n for n*n neighborhood of pixel to predict >,
"jsonfile" : <location of json containing data information to be used for training>,
"num_epoch" : <number of epochs>,
"batch_size" : <batch size (10000)>,
"model_path" : <path/to/keras/model>,
"eval_json" : <location of json containing data information to be used for evaluation>,
"pred_json" : <location of json containing data information to be used for prediction>
}
jsonfile
contains information about data. It needs to be formatted as follows:[
{
"ncfile" : <path to the GOES 16 nc File eg:`.../2018/143/23/`>,
"nctime" : <time string in 'yyyyqqqhhmm' format. This should be a part of the ncfile name>,
"shp" : <`path/to/shp/file` shapefile denoting smoke occurence in the `ncfile` (in WGS84 Coordinates) >,
"extent" : <extent information in lat,lon eg:[-110.0,33.0,-105.0,37.0]>,
"start" : <unused for now>,
"end" : <unused for now>
}, ...
]
model_path
field in config.json
TIFF_DIR
in config.py
file. The code uses this cache until the files are deleted manually.infer.py
Predicter
class in infer.py
requires: <path/to/ncfile>
,datetime.datetime object
, extent
, path/to/model
to initializePredicter.predict
method returns a GeoJson Dictionary object containing the predicted
smoke plumes.batch_predict.py
config.json
pred_json
field in config.json
contains information about data to predict. The format is as follows:
[
{
"ncfile" : <path to the GOES 16 nc File eg:`.../2018/143/23/`>,
"nctime" : <time string in 'yyyyqqqhhmm' format. This should be a part of the ncfile name>,
"extent" : <extent information in lat,lon eg:[-110.0,33.0,-105.0,37.0]>,
},...
]
pred_json
is stored in path given by OUTPUT_DIR
in config.py
.config.json
eval_json
field in config.json
denotes the location of json containing info on data to evaluate. It follows the same format as jsonfile
given above.OUTPUT_DIR
in config.py