From: "Jennifer.Abernethy@xxxxxxxx" <Jennifer.Abernethy@xxxxxxxx>
To: ferret_users@xxxxxxxx
Sent: Monday, September 3, 2012 6:52 AM
Subject: [ferret_users] fill_between a curve and a constant line
Hi,
New to ferret here. I have 40 years of monthly sst data at a specific lat/lon that moves between 26C and 30C. I want to color in the times it's above 29C red, and the times it's below 27C blue. I don't want anything else colored in.
I tried the fill_between script, but when used with a curve and a constant value, it colors in the curve above and the 'negative' space below the constant value, which is not what I want at all. (http://ferret.pmel.noaa.gov/Ferret/faq/fill-between-two-curves).
How might I do this?
To complicate things, the x axis is a time axis.
I've tried a few different things, and I think I'm stumped now at the point of defining the straight, constant lines as 'curves' themselves to refer to in the fill_between command. But I can't find how to define an constant array without typing in all 480 values manually
(http://ferret.pmel.noaa.gov/static/Demos/constant_array_demo/constant_array_demo.html), or how to @asn it to a time axis so it will plot with the sst data.
here's the monthly data and axis definitions:
use "enso_indices/stsu.nc"
define axis/units=days/t="1-jan-1970":"31-dec-2009":1/edges/cal=gregorian t_daily
define axis/edges/units=days/t0=1-jan-1900/cal=gregorian t_mon_historical = days1900(year,month,1)
let temp = tsu[x=130,y=-12] !long, lat
let temp_daily = temp[gt=t_daily@asn]
let temp_month = temp_daily[gt=t_historical@ave] !monthly averages
I guess I'd want a variable the same format as temp_month (40yrs of monthly values), but all values are 29 (and another variable where all values are 27)...?
Then I could use the fill_between command with the args curve, axis, curve:
go fill_between poly/over/nolabel/palette=red temp_month t_historical const_linearray29
go
fill_between poly/over/nolabel/palette=blue temp_month t_historical const_linearray27
maybe there's a much better way to do this.....
could some wonderful ferret expert please help me fill in the blanks?
thanks,
jenny