data gap in VIIRS granule limit subsetting

Errors and unexpected results
Post Reply
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

data gap in VIIRS granule limit subsetting

Post by hproe »

Hi -

I have a VIIRS DNB granule from an ascending orbit that shows having a narrow data gap (missing line?) in the thumbnail. The gap limits the selection of a sub-area to the data scanned prior to the data gap like
VIIRSthumbnail.png

I have uploaded the DNB granule (with separate GDNBO file) as VIIRS-HP.7z to the SSEC server.

cheers, HP
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: data gap in VIIRS granule limit subsetting

Post by bobc »

Hi HP -

Thanks for reporting this. I have added your data to our testing repository for Inquiry 2139, which concerns subsetting issues when a VIIRS SDR granule is missing a scanline. There was a fix put in for EDR granules with a missing scanline, but that was resolved in a separate inquiry, Inquiry 1704, and this fix didn't apply to the SDRs.

In the meantime, you can use the loadVIIRSImage() function to display the full granule at full resolution. There are a couple of limitations to using this function:
  1. You can't geographically subset by either lat/lon or line/ele values. By default the full resolution of the granule will be displayed. You can reduce the resolution via the stride, xStride, or yStride keywords.
  2. In the case of this this granule with the missing scanline, the full granule will be displayed, but you can only probe the display south of the missing scanline.

This loadVIIRSImage() function is not yet documented in the User's Guide since the Suomi NPP chooser itself is still under development, but you can find some documentation for it in the 'Background Processing Functions' of the Jython Library. Here is a quick script you can use as a template to get the data displayed. All you should have to change is the 'filePath' directory to point at your file.

Code: Select all

from glob import glob
filePath = 'C:/Users/rcarp/Data/NPP/'
viirsParms = dict(
    file_list = glob(filePath+'SVDNB*'),
    field = 'VIIRS-DNB-SDR_All/Radiance',
    )
viirsData = loadVIIRSImage(**viirsParms)
panel = buildWindow()
viirsLayer = panel[0].createLayer('Image Display', viirsData)
viirsLayer.setEnhancement('Gray scale', range=(-1.9E-10, 3.4E-9))
panel[0].setCenter(39, 24, scale=6)
panel[0].setWireframe(False)

Thanks again -
Bob Carp
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

Re: data gap in VIIRS granule limit subsetting

Post by hproe »

Hi Bob -

Many thanks for the scripting hint. I will make good use of it. BTW the sample data retrieved from CLASS (and not from peate), but uisng the option to with split nav and image data.

HP
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: data gap in VIIRS granule limit subsetting

Post by bobc »

Hi HP -

Thanks for clarifying that the data was from CLASS and not peate. I added note of this to the inquiry.

If you notice any problems or have any suggestions with the loadVIIRSImage function, please let us know.

- Bob
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

Re: data gap in VIIRS granule limit subsetting

Post by hproe »

Hi Bob -

Finally I have found the time to test your script. However, I cannot get it working. The only thing I changed, is the file path in line 2. Zhe following error message is returned:
Traceback (most recent call last):
File "<string>", line 7, in <module>
File "C:\Program Files\McIDAS-V-System\mcidasv.jar\edu\wisc\ssec\mcidasv\resources\python\background.py", line 3627, in loadVIIRSImage
NameError: global name '_mcv' is not defined

HP
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: data gap in VIIRS granule limit subsetting

Post by bobc »

Hi HP -

Sorry that you're having problems with the script. I've been trying to replicate the error message, but I've been unable to. I'm trying to look into how this could happen, but in the meantime can you please try the following:

1. In the session where you are seeing the bug, can you please run the following the Jython Shell and let me know the output:

Code: Select all

_mcv

This assumes you are running a nightly build. If you are running 1.5, then you will need to run 'print _mcv'. I'm thinking you will get a NameError that '_mcv' is not defined, but it's worth checking.

2. Would you try running your script in a pristine session? You can do this with the -tempuserpath flag. From the McIDAS-V-System directory, run:

Code: Select all

runMcV.bat -tempuserpath

This will start up McIDAS-V as if it were the first time ever run on your machine. From here, open the Jython Shell and run your script. Does this work, or do you still get an error?

Thanks -
Bob
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

Re: data gap in VIIRS granule limit subsetting

Post by hproe »

Hi Bob -

Awfully sorry. The problem is with me, having run your code directly from the Library. Running it in the shell or including it in the Library as a function makes it work as expected, i.e. in my case it displays 2 consecutive granules and bridges a missing line in one of the granules.

I did not know that, when you insert code lines into the User Library and then hit 'save', the lines are executed ... and this misled me to test your code this way!

BTW I usually display DNB imagery by applying the log to the radiance, like:

Code: Select all

 imLayer=imDisplay.createLayer('Image Display',log(viirsData))
 imLayer.setEnhancement('Gray scale',range=(-26,-18))

Of course, the range may need some manual optimisation, but (-26,-18) is a good starting point.

HP
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: data gap in VIIRS granule limit subsetting

Post by bobc »

Hi HP -

Thanks for following up, and I'm glad that this code works for you if you run it from the Jython Shell or if you define it as a function in the Jython Library.

Also, thanks for the tip about using log in createLayer. I never considered using this before but it looks to be useful.

If you run into any other problems, please let us know.

Thanks again -
Bob
Post Reply