Page 1 of 1

MODISA Image Generation

Posted: Tue Mar 14, 2017 10:47 am America/New_York
by alakes
I have three questions if any expert can help.

1. I am generating png image from MODISA mapped data using GPT WriteImage Operator. Is there any way to attach color bar to the png image?
Something like this

2. The WriteImage generates png image with transparent back ground. Any way to make the background black?

3. I generated MODISA Projected browse file for Indian Ocean region containing bands named red, Green, Blue. I can generate True color image in SeaDAS GUI but is there any command line usage or way (using script) is there to save to png?


** Not preferring any third party application due to increase in dependency. Anyway.

Any suggestions are welcome and thanks in advance..

MODISA Image Generation

Posted: Tue Mar 14, 2017 1:52 pm America/New_York
by gnwiii
My personal approach to the issues you posed:

1.  attaching a colorbar

a. GPT is generally used in batch processing to create lots of images, hopefully all with the same colour scale.  Rather than attaching a colour scale to each image, it
often makes sense to keep it separate.  I often do one image using the GUI, which does let me save a colour scale, and the next 999 images with a script.

b. There are many programs that can be used to generate images from mapped netcdf rasters, including matlab/octave, IDL/gnudatalanguage, GMT5, ncarg/ncl, python, R, and julia.  All these have a much larger user base than GPT and also much larger resources for development.  When I think of some feature that would be nice to have in SeaDAS, I also think, maybe it is better for the NASA folks to focus on the things that can't be done with tools supported outside OBPG.   I do appreciate your point about minimizing dependencies on additional tools, but I find in practice that I can't get by without R, gdal, ImageMagick, and python (python is also used in linux system scriptshead wget, so always available to many SeaDAS users). These give me quite a few options outside SeaDAS for image manipulations. Python (via beampy) can let you write scripts to do many of the GUI manipulations.

2. transparent background

I prefer to get images with transparent background because it adds flexibility.  Black background is nice for screen viewing, but gives soggy printouts on my inkjet and enriches the printer makers.   Again, there are 3rd party tools that support image compositing, such as ImageMagick's "compose".

3.  If you aren't stuck with Windows, you can generate true colour images using l1brsgen or l3mapgen, both included in the OCSSW processing system

MODISA Image Generation

Posted: Fri Mar 17, 2017 8:43 am America/New_York
by alakes
The true color problem is solved using pconvert (https://seadas.gsfc.nasa.gov/help/general/PConvertUsage.html). Initially there was some issue to run pconvert (https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?pid=21241;hl=pconvert).
Just had to change "export SEADAS_HOME=${installer:sys.installationDir}" to "export SEADAS_HOME=$HOME/SeaDAS-7.4"
and "-Xmx${installer:maxHeapSize} \" to "-Xmx16384M \" in the $SEADAS/bin/pconvert.sh