Convert Brightness to Temperatures --- *.gini Satellite Data

How do I...?
Post Reply
User avatar
Greg
Posts: 29
Joined: Thu Jan 15, 2009 11:52 am

Convert Brightness to Temperatures --- *.gini Satellite Data

Post by Greg »

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 ..
User avatar
jayh
Posts: 424
Joined: Thu Jan 15, 2009 10:34 pm

Re: Convert Brightness to Temperatures --- *.gini Satellite Data

Post by jayh »

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
User avatar
jessica.braun
Posts: 66
Joined: Wed Jan 07, 2009 7:51 pm

Re: Convert Brightness to Temperatures --- *.gini Satellite Data

Post by jessica.braun »

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
User avatar
Greg
Posts: 29
Joined: Thu Jan 15, 2009 11:52 am

Re: Convert Brightness to Temperatures --- *.gini Satellite Data

Post by Greg »

Thanks I will give it a try.

Greg ..
User avatar
aude
Posts: 5
Joined: Thu Feb 05, 2009 9:37 pm

Re: Convert Brightness to Temperatures --- *.gini Satellite Data

Post by aude »

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
User avatar
aude
Posts: 5
Joined: Thu Feb 05, 2009 9:37 pm

Re: Convert Brightness to Temperatures --- *.gini Satellite Data

Post by aude »

How did you fix that?
Post Reply