Select to view content in your preferred language

About selecting two rasters as input to a raster function template

08-29-2017 02:25 AM
Labels (1)
New Contributor

We have some mosaic datasets in the content of meteorological data. The information of some variables in these mosaic datasets is given below.

Long NameShort NameUnitsFormatDescription
Total precipitation (rain + snow)tpmGridpointAccumulated field. Convective precipitation + stratiform precipitation (CP + LSP).
2 meter temperature2tKGridpoint
2 meters dew point temperature2dKGridpoint

  1. For the tp variant, we would like to obtain the amount of precipitation between any two hours desired (for example, 3 hours total precipitation between 29.08.2017 12:00:00 AM and 29.08.2017 03:00:00 AM) with on-the-fly processing logic. How can we give 2 rasters generated for two different time as input to a raster function template written in python?
  2. For variables 2t and 2d, we want to calculate the moisture value at any given time with a mathematical function. How can we give two rasters for the same time that belong to two different variables as input to a raster function template written in python?

We have already tried the raster calculator and composite band options and we have arrived at the results we wanted. But our desire is to be able to provide these two situations with on-the-fly processing logic.

Thank you for reading. My English is not very good, if I can not explain the situation clearly, I can try to explain it in more detail. I look forward to your help and suggestions.

0 Kudos
5 Replies
MVP Alum

Adding  for greater exposure

Chris Donohue, GISP

0 Kudos
Occasional Contributor III

Hi Serkan,

as you look for Python raster functions and using 2 rasters as input: Are you aware of the samples at GitHub - Esri/raster-functions: A curated set of lightweight but powerful tools for on-the-fly image... ?

There is the source code for the wind-chill function - or the Heat-Index function. Both might be at least close to what you want to do - check those out!


0 Kudos
New Contributor

Thank you, Günter, I know what you are talking about. But they are not enough to do what I want, or I can not use it properly. Because I want to do mathematical operations between variables in a single mosaic dataset. As far as I understand, they are working on rasters in two different mosaic datasets.

For example, I want to compute the moisture with the following mathematical function for variables 2t and 2d in the ABC mosaic dataset.

10 ^ (2 + (7.5 * (((2d - 273.15) / (2d - 35.45)) - ((2t - 273.15 ) / (2t - 35.45)))))

0 Kudos
Esri Esteemed Contributor

What I have done in the past is loading different rasters as different bands into the dataset (using Composite Bands—Help | ArcGIS Desktop ). This allows you to extract the different datasets in a raster function and combine them as you wish. See also my blog post: 

New Contributor

In fact, I am already using the Composite bands method. However, at regular intervals, new data come out and are loaded into mosaic datasets. This loading process is also disadvantageous both in terms of time and copying of the data. For this reason, I would like to do this with on-the-fly processing logic to prevent the disadvantage.

0 Kudos