Skip to content

Commit

Permalink
USE_CLOUDY
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfrantz committed Apr 11, 2024
1 parent 2563f5a commit 7f1fd36
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/source/history/vdev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Develop version
approach of Olivier Hagolle. A new parameter ``SELECT = TRUE/FALSE`` was introduced. with ``FALSE`` enabling
the weighted average. Note that the ``INF`` and ``SCR`` products will not be produced when using this option.

- The Level 3 submodule received a new parameter ``USE_CLOUDY``, which can be used to allow observations with
a cloud score of less than 1% in the composite. On one hand, this reduces nodata gaps in the composite. On the
other hand, it will include clouds if there is no better observation.

- a new parameter ``OUTPUT_SUBFOLDERS`` was implemented that allows to output the data into subfolders under the tile
folder instead of just dumping everything into the tile folder itself. It is planned that this feature will be
expanded in the future. ``OUTPUT_SUBFOLDERS = FALSE`` remains the default.
Expand Down
8 changes: 8 additions & 0 deletions src/aux-level/param-aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,14 @@ void write_par_hl_bap(FILE *fp, bool verbose){
}
fprintf(fp, "OFF_SEASON = FALSE\n");

if (verbose){
fprintf(fp, "# This parameter specifies whether observations with a cloud score of less than 1%%\n");
fprintf(fp, "# should be candidates. On one hand, this reduces nodata gaps in the composite. On the other hand,\n");
fprintf(fp, "# it will include clouds if there is no better observation.\n");
fprintf(fp, "# Type: Logical. Valid values: {TRUE,FALSE}\n");
}
fprintf(fp, "USE_CLOUDY = FALSE\n");

if (verbose){
fprintf(fp, "# This parameter controls the strength of the DOY score.\n");
fprintf(fp, "# 0 disables the use of this score.\n");
Expand Down
4 changes: 2 additions & 2 deletions src/higher-level/bap-hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ float max_score = -1;
if (!bap->offsea && score[t].d < 0.01) continue;
if (bap->w.h > 0 && score[t].h < 0.01 &&
hmean > 0.01 && hsd > 0.01) continue;
if (bap->w.c > 0 && score[t].c < 0.01) continue;
if (bap->use_cloudy && bap->w.c > 0 && score[t].c < 0.01) continue;

n++;

Expand Down Expand Up @@ -799,7 +799,7 @@ float sum_weight = 0;
if (!bap->offsea && score[t].d < 0.01) continue;
if (bap->w.h > 0 && score[t].h < 0.01 &&
hmean > 0.01 && hsd > 0.01) continue;
if (bap->w.c > 0 && score[t].c < 0.01) continue;
if (bap->use_cloudy && bap->w.c > 0 && score[t].c < 0.01) continue;


for (b=0; b<nb; b++) l3->bap[b][p] += (ard[t].dat[b][p] * score[t].t);
Expand Down
1 change: 1 addition & 0 deletions src/higher-level/param-hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void register_bap(params_t *params, par_hl_t *phl){
register_intvec_par(params, "DOY_STATIC", 1, 365, &phl->bap.Dt, &phl->bap.nDt);

register_bool_par(params, "OFF_SEASON", &phl->bap.offsea);
register_bool_par(params, "USE_CLOUDY", &phl->bap.use_cloudy);
register_float_par(params, "DREQ", 1, FLT_MAX, &phl->bap.dreq);
register_float_par(params, "VREQ", 1, 90, &phl->bap.vreq);

Expand Down
1 change: 1 addition & 0 deletions src/higher-level/param-hl.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ typedef struct {
int nDt, nDs;
float *Ds; // function values for target DOYs
int offsea; // use off-season data?
int use_cloudy; // use ultra-cloudy data?
int select; // select or weight?

int score_type;
Expand Down

0 comments on commit 7f1fd36

Please sign in to comment.