mgfasel

Setting script output parameter in Python

Discussion created by mgfasel on Mar 7, 2011
Latest reply on Mar 8, 2011 by mgfasel
Hi everyone,

I'm working on a simple model (see picture attached) that, basically, takes a location and an hour as inputs and deliver a IDW predicted value (e.g. 2375.54) as output based on the cell values of rasters stored in a geodatabase.

There are four rasters stored, one for each period of the day (morning, afternoon, evening and night).

I added a Python script aimed to change the name of the raster to use by the model tools according to the hour given in parameter. For example if hour = 7 the tools should use the "Morning" raster to make the prediction. If hour = 15 = 3pm, it should use the afternoon raster and so on.

The model works fine if I set all the input and output parameters manually, but I can't figure out how to change dynamically the name of the raster the model has to work with.

What would be the best way to switch dynamically between rasters in this kind of model?

Thanks for any help or suggestion..

Marc

Outcomes