Re: Operating at the pixel level with a PNG or x11 [SEC=UNCLASSIFIED]

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 10 2012 - 12:37:35 MST

Hi Griffith.

The term "pixel" has several different uses. In computer graphics it
often refers to individual picture cells or color elements in a raster
graphic format such as PNG or JPEG. In satellite observations and
related climate science, the term is often used for individual data
cells. Here, I think the term originated with hardware picture cells
in imaging devices, but it has been propagated somewhat into the
language for derived data grids.

So, in what sense do you mean "pixels"? Do you really want to set
individual PNG picture cells, or you you want to operate on data cells
in some high resolution data set? When plotting, usually a single
data cell is mapped into several image pixels.

Your reference to "reg->land(lat, lon)" appears to be a data grid
reference. This implies that you are working at the data cell level,
not the image cell level.

--Dave

On Thu, Feb 9, 2012 at 8:42 PM, Griffith Young <G.Young@bom.gov.au> wrote:
> Hello NCL-Talk,
>        I might be using the wrong tool, but ...
>
>        Is it possible to plot individual pixels in a PNG?
>
>        Something like:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> reg=addfile("regional_quarter_grid.nc", "r")
> n_lat = dimsizes(reg->land&lat)
> n_lon = dimsizes(reg->land&lon)
> png="png"
> png@wkHeight=n_lat
> png@wkWidth=n_lon
> wks = gsn_open_wks(png, "land")
> do lat = 0, n_lat - 1
>  do lon = 0, n_lon - 1
>    if (reg->land(lat, lon) .eq. 1) then
>      Function_I_Am_Looking_For_To_Set_Pixel(wks, lat, lon)
>    end if
>  end do
> end do
>
>        Or maybe there is something that already does this?
>
> Thanks in advance,
>        Griff Young.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 10 12:37:45 2012

This archive was generated by hypermail 2.1.8 : Fri Feb 17 2012 - 08:50:10 MST