public static async Task <ETOPO1DataHandler> CreateAsync(IStorageContext dataContext) { var storageDefinition = dataContext.StorageDefinition; var latIntegratorTask = LinearIntegratorsFactory.SmartConstructAsync(dataContext, IntegratorsFactoryHelpers.AutodetectLatName(storageDefinition)); var lonIntegratorTask = LinearIntegratorsFactory.SmartConstructAsync(dataContext, IntegratorsFactoryHelpers.AutodetectLonName(storageDefinition)); var timeIntegrator = new NoTimeAvgProcessing(); var latIntegrator = await latIntegratorTask; var lonIntegrator = await lonIntegratorTask; var thinningLatIntegrator = new SpatGridIntegatorThinningDecorator(latIntegrator); var thinningLonIntegrator = new SpatGridIntegatorThinningDecorator(lonIntegrator); var baseNodeUncertainty = new Etopo1BaseUnceratinty(); var temporalVarianceCalculaator = new ReducedDemensionLinearCombVarianceCalc(); var spatialVarianceCalculator = new LinearCombinationOnSphereVarianceCalculator(new StorageContextMetadataSpatialVarianceExtractor(storageDefinition), latIntegrator, lonIntegrator); var gaussianFieldUncertaintyEvaluator = new SequentialTimeSpatialUncertaintyEvaluatorFacade(timeIntegrator, thinningLatIntegrator, thinningLonIntegrator, temporalVarianceCalculaator, spatialVarianceCalculator, baseNodeUncertainty); var coverageCheckUncertaintyEvaluator = new GridUncertaintyConventionsDecorator(gaussianFieldUncertaintyEvaluator, latIntegrator, lonIntegrator, timeIntegrator); var variablePresenceCheckEvaluator = new VariablePresenceCheckDecorator(dataContext.StorageDefinition, coverageCheckUncertaintyEvaluator); var gridAggregator = new GridMeanAggregator(dataContext, timeIntegrator, latIntegrator, lonIntegrator, false); var clusteringAggregator = new GridClusteringDecorator(dataContext.StorageDefinition, gridAggregator, timeIntegrator, latIntegrator, lonIntegrator); return(new ETOPO1DataHandler(dataContext, variablePresenceCheckEvaluator, clusteringAggregator)); }
public static async Task <GTOPO30DataHandler> CreateAsync(IStorageContext dataContext) { var storageDefinition = dataContext.StorageDefinition; var latIntegratorTask = LinearIntegratorsFactory.SmartConstructAsync(dataContext, IntegratorsFactoryHelpers.AutodetectLatName(storageDefinition)); var lonIntegratorTask = LinearIntegratorsFactory.SmartConstructAsync(dataContext, IntegratorsFactoryHelpers.AutodetectLonName(storageDefinition)); var timeIntegrator = new NoTimeAvgProcessing(); var latIntegrator = await latIntegratorTask; var lonIntegrator = await lonIntegratorTask; var thinningLatIntegrator = new SpatGridIntegatorThinningDecorator(latIntegrator); var thinningLonIntegrator = new SpatGridIntegatorThinningDecorator(lonIntegrator); var baseNodeUncertainty = new Etopo1BaseUnceratinty(); var temporalVarianceCalculaator = new ReducedDemensionLinearCombVarianceCalc(); var spatialVarianceCalculator = new LinearCombinationOnSphereVarianceCalculator(new StorageContextMetadataSpatialVarianceExtractor(storageDefinition), latIntegrator, lonIntegrator); var bitMaskProvider = new EmbeddedResourceBitMaskProvider(typeof(GTOPO30DataHandler), "Microsoft.Research.Science.FetchClimate2.gtopo30.bf"); var gaussianFieldUncertaintyEvaluator = new SequentialTimeSpatialUncertaintyEvaluatorFacade(timeIntegrator, thinningLatIntegrator, thinningLonIntegrator, temporalVarianceCalculaator, spatialVarianceCalculator, baseNodeUncertainty); var coverageCheckUncertaintyEvaluator = new GridUncertaintyConventionsDecorator(gaussianFieldUncertaintyEvaluator, latIntegrator, lonIntegrator, timeIntegrator); var landMaskEnabledUncertaintyEvaluator = new GridBitmaskDecorator(coverageCheckUncertaintyEvaluator, bitMaskProvider); var variablePresenceCheckEvaluator = new VariablePresenceCheckDecorator(dataContext.StorageDefinition, landMaskEnabledUncertaintyEvaluator); var gridAggregator = new GridMeanAggregator(dataContext, timeIntegrator, latIntegrator, lonIntegrator, true); var clusteringAggregator = new GridClusteringDecorator(dataContext.StorageDefinition, gridAggregator, timeIntegrator, latIntegrator, lonIntegrator); return(new GTOPO30DataHandler(dataContext, variablePresenceCheckEvaluator, clusteringAggregator)); }