Applied-GeoSolutions / multitemporal

Efficient, chainable time series processing of raster stacks.
GNU General Public License v2.0
4 stars 3 forks source link

multi-input modules can't mix steps and sources #22

Open ircwaves opened 6 years ago

ircwaves commented 6 years ago

Created by: rbraswell

Inputs to modules that use more than one input must either all be sources, or all be steps.

Steps must be either "initial" or not initial. Suggest adding a step type called mixed, and coding around that.

    for step in steps:                                                                                                                                                               

        if step['initial'] == True:                                                                                                                                                  
            bix = [sourcenames.index(si) for si in step['inputs']]                                                                                                                   
            d = data[bix,:,:,:]                                                                                                                                                      
        else:                                                                                                                                                                        
            d = np.array([results[si] for si in step['inputs']])                                                                                                                     

        if d.shape[0] == 1:                                                                                                                                                          
            d = d.reshape(d.shape[1], nyr, npx)                                                                                                                                      

        print step['name'], d.shape,                                                                                                                                                 
        results[step['name']] = step['function'](d, missing_out, step['params'])                                                                                                     
        if step.get('output', False):                                                                                                                                                
            OUTPUT[step['name']][:, :, istart:iend] = results[step['name']]