Can't make a simple smooth edge RGB in GUI or script

Post any questions, ideas, or topics related to Jython and Python scripting.
User avatar
kaba
Posts: 51
Joined: Tue Mar 24, 2009 2:52 pm

Can't make a simple smooth edge RGB in GUI or script

Post by kaba »

Hello guys,
I am trying to make a RGB image using a netCDF file as input.
When Tim, does this in X, the image looks very smooth on the edges even with heavy stride.
On the other hand, when I do it in V, even if I bring in every single pixel or use a jython script
with loadGrid and mycombineRGB it does not come any close to X.

Here is a sample image showing how it looks in X on the left vs V on the right.
ftp://ftp.ssec.wisc.edu/ABI/kaba/temp/HAC-SHAS-V1.png

Also here is an ftp link with a sample netCDF that has all three bands in it to try for verification.
ftp://ftp.ssec.wisc.edu/ABI/kaba/temp/H ... INH_65_.nc

Thanks for the help in advance.

Best
kaba
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: Can't make a simple smooth edge RGB in GUI or script

Post by barryr »

Hi Kaba,
I downloaded your sample netCDF file and displayed the 0.47um band on a Globe Display using the General Files chooser with Color-Shaded Plan View. I found that I could improve things using a combination of a higher sampling rate and a better "Texture Quality" in the Layer Controls tab.

See the attached examples. The two every_fourth*.jpg ones were created at a lower sampling rate (every fourth point in the Data Sampling tab) using the Medium and High settings for the Texture Quality in the Layer Controls, and the two every_other*.jpg ones were created at a higher sampling rate (every other point) using the Medium and High settings for the Texture Quality.

I assume that if you chose every data point and a High setting for Texture Quality, it would be even better. However, with the images you're using it looks like you will need a lot of memory to do so. (I tried it on my computer, but it was running out of memory and bogging down badly.)

I hope this helps.
Barry
Attachments
every_fourth_point_texture_medium.jpg
every_fourth_point_texture_high.jpg
every_other_point_texture_medium.jpg
every_other_point_texture_high.jpg
User avatar
kaba
Posts: 51
Joined: Tue Mar 24, 2009 2:52 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by kaba »

Hello Barry,
Try making RGB images with that and see what you get.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by joleenf »

Hi,

I was able to get an acceptable edge when using full resolution ABI fixed grid format files, without changing texture quality:

abi_edge_nativeprojection.png


However, in order to access the native projection of the data, displaying a single banded color shaded plan view was also necessary. Loading extra data is slightly inefficient.

Step 1:
No option to re-project using the native data projection.
No option to re-project using the native data projection.


Step 2:
Once a single band color-shaded plan view is added, the layer can use the native data projection.
Once a single band color-shaded plan view is added, the layer can use the native data projection.



Since I normally run with auto-set projection off, I tried displaying with auto-set projection as "on." This does not re-project to the data navigation when using the RGB composite alone. A single banded color-shaded plan view display will re-project the data as needed (but is a silly step if only the RGB is needed. The layer navigation has to exist, but it is not being used in the case of the RGB).

Finally, using a globe display with this data produces a ragged edge.

abi_edge_globeDisplay.png


In the end, McIDAS-V displays AREA and fixed grid format with nice edges, but something is happening with the lat/lon assignment that is not compatible with a nice edge in McIDAS-V. In this case, having access to texture quality will be critical. However, displaying the data will every point has a negative implication for using less data to minimize memory usage.

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

Re: Can't make a simple smooth edge RGB in GUI or script

Post by joleenf »

FWIW,

This is the result using the same AHI data file that Kaba posted in python's basemap package (geos projection).

Screen Shot 2016-11-15 at 11.03.15 AM.png


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

Re: Can't make a simple smooth edge RGB in GUI or script

Post by bobc »

Hi Joleen and Kaba -

Thanks for the thorough description of the problems you are coming across.

1. Texture quality with RGB displays:
I wrote up Inquiry 2455 for adding a Texture Quality slider to the Layer Controls for both RGB display types. I investigated if it was possible to adjust the texture quality of a RGB layer through the Jython Shell but I've been unable to get anything to work.

2. Retaining projection information with the "Three Color (RGB) Image (Auto-scale)" formula and the "RGB Composite" display type:
I tried Kaba's file and I replicated that when the auto-scale RGB formula was used in conjunction with the RGB Composite display type the projection information of the fields passed through the formula isn't retained. If I use the "Three Color (RGB) Image" formula with the "3 Color (RGB) Image" display type then the projection information is retained just fine. I'm replicating this with ABI DOE-4 files loaded through the General>Files/Directories chooser as well. I wrote up fixing this as Inquiry 2454. With the ABI data, I was able to load the data with local ADDE and in this case both RGB formulas/display types retained the projection information, so it looks like this is just an issue with data loaded through the local file chooser (or the loadGrid() function).

If there are any other questions or concerns, please let me know.

Thanks -
Bob Carp
User avatar
ghansham
Posts: 175
Joined: Thu Nov 11, 2010 5:40 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by ghansham »

Hi all,
I think its not a big issue.
Just check if byreference rendering is ON. And also check if use data projection is ON in view window.
Right down in visad, by reference renderer uses quad texture which are pretty smooth if display projection is same as data projection. And memory utilization is pretty low. Quad texture use 8 floating point values per tile. TomR sir did this wonderful job long time back in 2010. Texture quality is at its best when using quad textures and changing it has no effect on display from user control.
Looking forward to hear from you.
Regards
Ghansham
User avatar
ghansham
Posts: 175
Joined: Thu Nov 11, 2010 5:40 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by ghansham »

One more thing, in globe display quad textures are disabled. So you can get the smooth image only in map display.
Regards
Ghansham
User avatar
ghansham
Posts: 175
Joined: Thu Nov 11, 2010 5:40 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by ghansham »

Oh now i got it issue lies here, the mcv rgb composite control should use MapProjection class somewhere rather than visad.CoordinateSystem. I have a refined version of this class which I use at many places. I can send it through mail to mug person for testing.
Regards
Ghansham
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Can't make a simple smooth edge RGB in GUI or script

Post by joleenf »

Hi Ghansham,

Yes, if you could send the modified class to the help desk. Bob and Barry have been looking at this.

Also, I believe I have referencing on, but still the results were as posted above. I usually run in map view with auto-set projection off, but have tested with auto-set projection "on" and saw the same results. However, it sounds like the modified class that you have at takes care of the projection issues being observed.

Screen Shot 2016-11-22 at 9.03.04 AM.png


Joleen
Post Reply