Skip to content

Commit

Permalink
Merge pull request #89 from ayushpatnaikgit/remove_requirements
Browse files Browse the repository at this point in the history
Reduce requirements for interpolation, bias correction & outlier removal
  • Loading branch information
ayushpatnaikgit authored Jul 5, 2023
2 parents 72839cf + c7d09cd commit 21b8561
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data_cleaning/bias_correction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bias_PSTT2021(radiance_datacube, ncfobs_datacube)
function bias_PSTT2021(radiance_datacube, ncfobs_datacube, mask=ones(Int8, (size(radiance_datacube)[1],size(radiance_datacube)[2])))
for i in 1:size(radiance_datacube)[1]
for j in 1:size(radiance_datacube)[2]
if count(i->(ismissing(i)),radiance_datacube[i, j, :])/length(radiance_datacube[i, j, :]) > 0.50
if count(i->(ismissing(i)),radiance_datacube[i, j, :])/length(radiance_datacube[i, j, :]) > 0.90
continue
end
if ismissing(mask[i, j])
Expand Down
2 changes: 1 addition & 1 deletion src/data_cleaning/interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ na_interp_linear(x)
```
"""
function na_interp_linear(timeseries)
if count(i->(ismissing(i)), timeseries) > length(timeseries) *1/2
if count(i->(ismissing(i)), timeseries) > length(timeseries) *0.9
return zero(1:length(timeseries))
end
data = copy(timeseries)
Expand Down
2 changes: 1 addition & 1 deletion src/data_cleaning/outlier_removal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function outlier_variance(radiance_datacube, mask=ones(Int8, (size(radiance_data
if ismissing(mask[i, j])
continue
end
if count(i->(ismissing(i)),radiance_datacube[i, j, :])/length(radiance_datacube[i, j, :]) > 0.50 # Don't do anything if there are too many missings
if count(i->(ismissing(i)),radiance_datacube[i, j, :])/length(radiance_datacube[i, j, :]) > 0.90 # Don't do anything if there are too many missings
continue
end
stds[i, j] = std(detrend_ts(filter(x -> !ismissing(x), radiance_datacube[i, j, :])))
Expand Down

0 comments on commit 21b8561

Please sign in to comment.