Suomi NPP/mixing I band and M band

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Suomi NPP/mixing I band and M band

Post by joleenf »

Hi,

I was trying to mix I band and M band Suomi NPP data: Calculate an NDSI using the I bands, using masks with the I band and M band (T15).
See NDSI in http://onlinelibrary.wiley.com/doi/10.1 ... 9/abstract

"Snow and ice products from Suomi NPP VIIRS"
Jeffrey Key et. al.
Journal of Geophysical Research: Atmospheres
Volume 118, Issue 23, pages 12,816–12,830

I cannot mix the M band and I bands either by resampling or directly in the formula...

Code: Select all


I1=selectData('I1')
I2=selectData('I2')
I3=selectData('I3')
T15=selectData('T15')

ds = I1.getDomainSet()

rI2=resample(I2,ds)
rI3=resample(I3,ds)
rT15=resample(T15,ds)

maskTemp = mask(T15,'<',281,1)
maskR2=mask(rI2,'>',0.11,1)

NDSI = (I1-rI3)/(I1+rI3)

snowIce = NDSI*maskTemp*maskR2

activeDisplay().createLayer('Image Display', snowIce)


I also tried replicating this with a mixture of formulas. However, the navigation for each band must be selected and I usually get a setSample error.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: Suomi NPP/mixing I band and M band

Post by bobc »

Hi Joleen -

I think that I'm replicating your problem. See the attached image where I have a 4 panel display:

Panel 1: SVI01 that was sampled when selecting the field
Panel 2: SVI02 resampled into the SVI01 domain
Panel 3: SVI03 resampled into the SVI01 domain
Panel 4: SVM15 resampled into the SVI01 domain

The SVI granules display correctly, but the SVM displays in the incorrect location and it is only part of the data. I spoke with Rick, and he thinks that the problem might be that the geolocation files differ between SVI and SVM. In my testing I used GITCO for SVI and GMTCO for SVM. This data was from the peate server, so I was working with single-banded files.

I wrote up McIDAS-V Inquiry #1684 to cover this problem. Is this the same issue that you were seeing?
http://mcidas.ssec.wisc.edu/inquiry-v/?inquiry=1684

Thanks -
Bob
Attachments
SVI01, SVI02, SVI03, SVM15
SVI01, SVI02, SVI03, SVM15
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Suomi NPP/mixing I band and M band

Post by joleenf »

Hi Bob,

Not exactly the same issue, but probably related. I was using jython. If I tried to resample the M band using the I band navigation, the result was an image full of missing values. If I tried multiplying the M band by an I band without resampling, the range of the image returned was 1 to 1.

When using formulas, like sub(a,b), I got a setSamples error.

Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: Suomi NPP/mixing I band and M band

Post by Rick »

Hi Joleen,

Using sub(a,b) were those resampled?

Rick
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: Suomi NPP/mixing I band and M band

Post by bobc »

Hi Joleen -

I'm having trouble replicating your exact problems on either Windows or Mac. Here's what I'm doing:

1. Through the GUI, individually add the following 3 files:
SVI01_npp_d20140122_t1843063_e1844304_b11597_c20140123010724640954_noaa_ops.h5
SVI02_npp_d20140122_t1843063_e1844304_b11597_c20140123010718218917_noaa_ops.h5
SVM15_npp_d20140122_t1843063_e1844304_b11597_c20140123010700451913_noaa_ops.h5

2. Open the Jython Shell, and run the following:

Code: Select all

I1=selectData('I1') #SVI01 Radiance
I2=selectData('I2') #SVI02 Radiance
T15=selectData('T15') #SVM15 Radiance
ds = I1.getDomainSet()
rI2=resample(I2,ds)
rT15=resample(T15,ds)

3. In the first Field Selector window, I chose SVI01 Radiance and subsetted out an area near the center of the granule. In the next 2 Field Selector windows, I selected SVI02 radiance and SVM15 radiance without subsetting a region.

4. I then created a display window with 3 panels, and ran the following commands in the Jython Shell for each panel in the display:

Code: Select all

layer1=activeDisplay().createLayer('Image Display',I1)
layer2=activeDisplay().createLayer('Image Display',rI2)
layer3=activeDisplay().createLayer('Image Display',rT15)

- Before running each line, I just clicked on my desired panel in the display so activeDisplay() would place the display in the correct panel

When I do this, I get results like the display attached to my first post, where everything appears to be valid data that can be probed... just the SVM15 doesn't correctly pick up on the domain from SVI01. So it seems like I'm not getting your results of a display with all missing values.

If I try multiplying the M band by the I band without any subsetting, I'm seeing a strange results, but I'm not seeing an image of 1 to 1. In the Jython Shell, I ran the following:

Code: Select all

I1=selectData('I1') #SVI01 Radiance
T15=selectData('T15') #SVM15 Radiance
IbyM = mul(I1,T15)
MbyI = mul(T15,I1)
panel1=buildWindow()
panel1[0].createLayer('Image Display',IbyM)
panel2=buildWindow()
panel2[0].createLayer('Image Display',MbyI)

For the display of 'IbyM', the data displays, but not correctly... it is geographically shifted to the east of where it should be and the bowtie takes up more of the granule than it should. The data can be probed, however. For the display of 'MbyI', the data displays at the correct location, but again the bowtie extends further into the granule than it should, and the data can be probed fine. This problem may require a new inquiry. I get the same results if I do this w/o scripting with a simple formula: "mul(a,b)".

Since we are seeing different results, I'm wondering if it is because we are using different data. Are you using single-banded data from peate, or multi-banded data from CLASS? Can you please post your data on ftp for me to try, myself? Also, when you subset your data for SVI01, are you choosing an area that goes right up to the edge of the granule?

Thanks again -
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Suomi NPP/mixing I band and M band

Post by joleenf »

Hi Bob,

Sorry for the late reply. I put the data on ftp://ftp.ssec.wisc.edu/pub/ssec/joleenf/npp/

I noticed that I grabbed the wrong M band (M05), but that should not account for the difference we are seeing. It would be strange. Also, I noticed you were selecting radiance, while in the M-band, I was using Brightness Temperature.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: Suomi NPP/mixing I band and M band

Post by bobc »

I met with Joleen, and the reason that we were seeing differing results is because in each of the selectData steps, she subsetted a region, whereas I was only subsetting a region in the I1 granule. The reason for subsetting all 4 granules was in hopes of getting a full-resolution display. If I subset each of the granules (I1, I2, I3 and T15), I get Joleen's results.

This information will be added to the inquiry 1684.

- Bob Carp
Post Reply