Closed simon-smart88 closed 6 months ago
Looking more, common$fit$data
is used by plot.disag_model
but if we want to put the same plot in here, we could just copy that code across and use the prepared data instead.
Closing this for now - a lot of the duplication was actually of the response data and this has been partially addressed by resp_simplify
@timcdlucas - not sure if this should be here or for {disaggregation} but in the current version, we end up with the data being duplicated multiple times and using the low resolution example covariates (100kb in total) ends up creating a 40Mb
.rds
by the end of the analysis which seems very inefficient and will cause us issues further down the line with larger rasters. These are the current locations where covariate rasters end up:common$covs
- where original rasters are loadedcommon$covs_prep
- where they are stacked prior to callingdisaggregation::prepare_data
common$prep$covariate_rasters
- the result ofdisaggregation::prepare_data
common$fit$data$covariate_rasters
- the result ofdisaggregation::disag_model
I will set
common$covs_prep
toNULL
afterdisaggregation::prepare_data
is completed but I don't understand whether we needcommon$fit$data
or if that can be set toNULL
too? That seems to be a complete duplication ofcommon$prep
and even if that's used bydisaggregation::predict_model
it would seem more efficient to just include the prepared data as an argument to that function.There is also
common$pred$covariates$sum
created bydisaggregation::predict_model
which is a single layer raster and I don't know what that represents.