Hello:
Looking at *.gini satellite data files. It is grid data, brightness values. Can I generate a jython formula to convert brightness to temperatures for the IR bands?
b brightness
t temperature
I believe the formula is if b less than 176 let t = (660-b)/2
if b is equal to or greater than 176 let t =418-b
McIDAS-V beta1
Thanks ..
Greg ..
Convert Brightness to Temperatures --- *.gini Satellite Data
Re: Convert Brightness to Temperatures --- *.gini Satellite Data
Hi Greg- Could you send a sample *.gini file to the Help Desk? We'd like to play around with one and see what we come up with.
Thanks, Jay
Thanks, Jay
- jessica.braun
- Posts: 66
- Joined: Wed Jan 07, 2009 7:51 pm
Re: Convert Brightness to Temperatures --- *.gini Satellite Data
Hi Greg,
To generate a formula for this conversion, you can start by creating a method in your local jython library. Select Tools->Formulas->Jython Library and select the Local Jython->User's library.
I talked with a coworker more knowledgeable in Jython and he helped me come up with this method:
def brightnessToTemp(a):
b = a[0];
m = mask(b,"<",176.)
b = m*(660.-b)/2. + (1.-m)*(418.-b)
return newUnit(b,"Temperature","K")
This method pulls out the 2D data object, and uses a "mask" function to create a field of 0s and 1s that do the "if" test and uses these to compute the new field.
To create a formula from this, you can right click on the method definition (brightnessToTemp) and there should be an option "Make Formula for".
Hope this helps,
Jess
To generate a formula for this conversion, you can start by creating a method in your local jython library. Select Tools->Formulas->Jython Library and select the Local Jython->User's library.
I talked with a coworker more knowledgeable in Jython and he helped me come up with this method:
def brightnessToTemp(a):
b = a[0];
m = mask(b,"<",176.)
b = m*(660.-b)/2. + (1.-m)*(418.-b)
return newUnit(b,"Temperature","K")
This method pulls out the 2D data object, and uses a "mask" function to create a field of 0s and 1s that do the "if" test and uses these to compute the new field.
To create a formula from this, you can right click on the method definition (brightnessToTemp) and there should be an option "Make Formula for".
Hope this helps,
Jess
Re: Convert Brightness to Temperatures --- *.gini Satellite Data
Thanks I will give it a try.
Greg ..
Greg ..
Re: Convert Brightness to Temperatures --- *.gini Satellite Data
Hi,
I have the same problem. I am trying to convert brightness values to temperature units.
I have written a method very similar to yours, it looks ok in Jython and I am able to create a formula from it.
However, when I try to use the formula on an image, I have the following error message:
Error reading xml org.python.core.PyException
Do you or anyone has an idea of why is that?
Thank you
I have the same problem. I am trying to convert brightness values to temperature units.
I have written a method very similar to yours, it looks ok in Jython and I am able to create a formula from it.
However, when I try to use the formula on an image, I have the following error message:
Error reading xml org.python.core.PyException
Do you or anyone has an idea of why is that?
Thank you
Re: Convert Brightness to Temperatures --- *.gini Satellite Data
How did you fix that?