PDA

View Full Version : Plot_WindRose



aarchibald
11-19-2007, 04:28 AM
Hi Everyone,

This is my first post and I will say that I am very new to PV_Wave!
I am trying to plot up some pollutant data as a wind rose to look at which sectors the pollutants predominantly come from. The example on the PVWave help looks very helpful but unfortunately I dont really understand it :o.

Example 1

A traditional wind rose:

a = READ_AIRS(!Dir + '/demo/gallery3/data/wd_demo35.dat')

s = str_to_dt('1/1/99',date_fmt=1)

e = str_to_dt('12/31/99',date_fmt=1)

TEK_COLOR

l = (a('LOCATIONS'))(0)

PLOT_WINDROSE, s, e, a(l,'DATE'), a(l,'R S'), a(l,'R D'), $
a(l,'LOCATION'), /Legend, /Titles
Example 2

A polution rose:

LOADCT, 8 & co = BYTSCL(INDGEN(6))

PLOT_WINDROSE, s, e, a(l,'DATE'), $
a(l,'R S')*randomu(seed,n_elements(a(l,'R S'))), $
a(l,'R D'), a(l,'LOCATION'), /CLegend, /Titles, $
Color=WoColorConvert(co), Text=WoColorConvert(co(5)), $
Fore=WoColorConvert(co(5)), Units='ppm'

What I have is a single data file with time (julian days), pollutant conc, wind direction (all comma seperated). I would really appreciate any help on how I can use this data to create a wind rose plot.

Thanks for reading!

Alex.

rwagner
11-19-2007, 08:22 AM
Hi Alex,
It seems that the trouble you're having is more with reading in your data and getting it in the right formats rather than calling plot_windrose. Take a look at this example. (Please note I didn't compile this, it's off the top of my head, so there might be a typo...) Please let me know if this works out for you.

-Ryan



pro pollution

;Read the input file
status = DC_READ_FREE('/path/to/filename', julians, concs, dirs, /Column)

;Assuming the input file was sorted by dates... first->last
;Convert Julian dates into proper date structures

start_date = JUL_TO_DT(julians(0))
end_date = JUL_TO_DT(julians(N_ELEMENTS(julians) -1))
dates = JUL_TO_DT(julians)

;Plot the data
PLOT_WINDROSE, start_date, end_date, dates, concs, dirs


end