[Thread Prev][Thread Next][Index]

Re: [ferret_users] Create an image to be georeferenced



Hello All,
A method I've used in making images to overlay on Google Earth is to create borders that extend a known distance in lat/lon units beyond the axes. The script "chartborder.jnl" given below does this. The variable "maxlen" is something I use in a related situation. Often I want to get the aspect ratio of the axes right but don't know in advance whether the x or y-axis should be longer. So I would use "go chartaxes 12 ..." to set up a plot with the longer axis 12 inches long and the other whatever it neeads to be to get the aspect ratio right.

Hope these may be of use to someone else.
Mick
PS Another useful feature of the "chartborder" approach (I think) is that a colorbar outside the axes can appear next to the georeferenced image in Google Earth.


------------------------
! chartborder : assigns chart axes lengths given a desired longer
! axis length and the lowerleft and upperright coords
! *** adapted from chartaxes.jnl, this version attempts to create ***
! *** a border of known width around the image to facilitate use ***
! *** with Google Earth ***

! usage: chartborder maxlen lon1 lat1 lon2 lat2 xborder yborder
! where (lon1,lat1), (lon2,lat2) are the lower left and
! upper right corners
! maxlen is the major axis length, and
! xborder,yborder are the desired border widths

let d2r=atan(1.)/45
let maxlen=$1
let xdegrees=($4-$2)*cos(d2r*($5+$3)/2)
let ydegrees=$5-$3
let axratio=ydegrees/xdegrees
let xaxlen=if(axratio le 1)then $1 else $1/axratio
let yaxlen=if(axratio le 1)then $1*axratio else $1
ppl axlen,`xaxlen`,`yaxlen`

let xborderwid=$6*xaxlen/xdegrees ; let yborderwid=$7*yaxlen/ydegrees
; ppl size,`xaxlen+2*xborderwid`,`yaxlen+2*yborderwid`
ppl origin,`xborderwid`,`yborderwid`

----------------------------------
! chartborder : assigns chart axes lengths given a desired longer
! axis length and the lowerleft and upperright coords
! *** adapted from chartaxes.jnl, this version attempts to create ***
! *** a border of known width around the image to facilitate use ***
! *** with Google Earth ***

! usage: chartborder maxlen lon1 lat1 lon2 lat2 xborder yborder
! where (lon1,lat1), (lon2,lat2) are the lower left and
! upper right corners
! maxlen is the major axis length, and
! xborder,yborder are the desired border widths

let d2r=atan(1.)/45
let maxlen=$1
let xdegrees=($4-$2)*cos(d2r*($5+$3)/2)
let ydegrees=$5-$3
let axratio=ydegrees/xdegrees
let xaxlen=if(axratio le 1)then $1 else $1/axratio
let yaxlen=if(axratio le 1)then $1*axratio else $1
ppl axlen,`xaxlen`,`yaxlen`

let xborderwid=$6*xaxlen/xdegrees ; let yborderwid=$7*yaxlen/ydegrees
; ppl size,`xaxlen+2*xborderwid`,`yaxlen+2*yborderwid`
ppl origin,`xborderwid`,`yborderwid`
facts> more chartaxes.jnl
! chartaxes : assigns chart axes lengths given a desired longer
! axis length and the lowerleft and upperright coords

let d2r=atan(1.)/45
let maxlen=$1
let xdegrees=($4-$2)*cos(d2r*($5+$3)/2)
let ydegrees=$5-$3
let axratio=ydegrees/xdegrees
let xaxlen=if(axratio le 1)then $1 else $1/axratio
let yaxlen=if(axratio le 1)then $1*axratio else $1
ppl axlen,`xaxlen`,`yaxlen` ; ppl size,`xaxlen+1.5`,`yaxlen+1.5`
ppl origin,0.75,0.75


Jaison Kurian wrote:
Hi Tony,
I think it is possible...two/three ways ...

1. before making plot, set all margins to zero

yes? go margins 0,0,0,0

2. use "/AXES" qualifier to define a viewport without margins

yes? define view/AXES/xlim=0:1/ylim=0:1 v1 ; set view v1


3. The problem with methods 1 and 2 is that, a very small white band
will appear on the top side. I don't know how to get rid of
this. Anyway you can try the following options (and is valid
for a plot made in normal way with /nolab/nokey/noaxes qualifiers)

3.1 Use some tools like gimp/xv to chop off the white band.

3.2 Lengthy solution.....make a ps file, corrent the bounding
box (open the ps file in text editing tool and adjust the
arguments for "%%BoundingBox" in the 5th line)...convert
it to gif using linux command "convert".

Regards,

Jaison

On Wed, 21 Jun 2006, Tony Jolibois wrote:

       Hi all,

Is it possible with ferret to create an image without any label, key or
axis, just the field, in order to be able to georeference it (see images
attached, first with labels, second can be georeferenced).
When I try the fill command with /nolabs/nokey/noaxis, there is a white
band around the image, so it can not be georeferenced, must cut the band
before.

Thanks in advance,
Tony








[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement