AnsweredAssumed Answered

Can a python raster function operate on specific layers in a mosaic dataset?

Question asked by slayback on May 21, 2015

I'm trying to create a python raster function that would be applied to a mosaic dataset, to do some relatively simple on-the-fly processing and display/output the result.


I'm unclear how (or if possible) to pass in specific layers in the mosaic dataset, as a result of either a query on the MD's attribute table, or as a result of specifying the date and dimension - I can (and have) setup the mosaic dataset as multidimensional, with two variables, and time as the dimension. (not sure if that helps or hinders).


The .getConfiguration method has an extractBands attribute, that is close to what I want. But the data don't have bands. So perhaps one solution is to setup some sort of dummy band structure, but I think that would get overly complicated to read the data in that way.  I'd rather just be able to directly set a query on the mosaic dataset attributes to define the raster layer returned from the MD. Or on the multidimensional variables/dimensions.


There's also the selectRasters method, but I don't see much documentation on that...the example just shows it selecting one of two already input/defined rasters: PythonRasterFunction · Esri/raster-functions Wiki · GitHub


I could also break the mosaic dataset into two separate MDs, one per variable, but I'd still need to select on time...and in this case, I cant just use the time properties to select the time, as I specifically need to access data from both the current day (which could be set using time slider etc) AND the previous day.


Is this possible? Or am I on the wrong track here and there's some other better way to go about running a raster function on specific layers (defined by input parameters) in a mosaic dataset?  In the end, the idea would be to set this up as a processing template on the mosaic dataset, that a user would then set the parameters for. 


Thanks in advance for any suggestions.