wst idl routines

Last modified: Thu Mar 16 13:07:14 2023.


List of Routines


Routine Descriptions

WINDPLOTSTORM - PLOT A DAYS WORTH OF WIND DATA.

[Next Routine] [List of Routines]
NAME:
windplotstorm - plot a days worth of wind data.
SYNTAX: windplotstorm,d,rain=rain,maxvel=maxvel,day=day
ARGS:
 d[n]:{}	wind data input by windinpraw()
KEYWORDS:   
  rain  : int  if true then include rainfall
 maxvel : float  max wind velocity to use for vertical scale
 day    :      if set , then just plot day, don't bother with timestamp
RETURNS:
		plots the wind data.
DESCRIPTION:
	Plot the wind data for a day. The top plot is the wind data versus hour 
of data (ast). The data has bin binned to 1 minute steps. The white (black)
plot is the average over each minute. The red plot is the peak hold over
each minute.
	The bottom plot is the median wind velocity for each minute versus 
ast hour of day. The direction is where the wind is coming from.

EXAMPLE:


 yymmdd=070412
 n=windinpraw(yymmdd,d)
 windplotday,d

(See /pkg/rsi/local/libao/phil/wst/wstplotstorm.pro)


WSTBINDATA - BIN DATA TO THE REQUESTED TIME STEP

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstbindata - bin data to the requested time step

SYNTAX: nbins=wstbindata(yinp,xinp,Davg,Dpk,Dx,binsize=binsize,$
                 hrdat=hrdat,degdat=degdat,jddat=jddat,hist=hist,$
				  dmin=dmin)
ARGS:
 yinp[n]: float/double data to process
 xinp[n]: double   x value for each y sample
KEYWORDS:
 binsize : double  for histogram (see defaults below
 jddat   :         if set then assumme xdat is jd dates.
                   round to full ast days. this is the default
                   if hrdat,degdat is not supplied
                   Def binsize=15/1440. (15 minutes)
 hrdat   :         if set then xdat is in hours
                   def binsize is .1 hours
 degdat  :         if set then xdat is in degrees.
                   def binsize=1 deg.
              
RETURNS:
  nbins: long   number of bins in returned datahistogram
Davg[nbins]:double average the points in each bin
Dpk[nbins] :double take peak value from each bin
Djd[nbins] :double xvalue value for center of each bin
Dmin[nbins]:double if dmin=dmin also return histogram of minimums
hist[nbins]   :double return the histogram
               
DESCRIPTION:
   bin the input data using the xinp array. The default
binwidth is:
 jd data : 15/1440 (15 minutes5 minutes).
 hr data : .1 hours
 degdata:  1 deg
 You can change the binwidth with the binsize=keyword.
width with the tmStep= keyword.
	The prgoram returns the following binned data:
 Bavg[nbins]: averag data in each bin
 Bpk [nbins]: peak data in each bin
 Bx[nbins]  : x values for center of each bin

(See /pkg/rsi/local/libao/phil/wst/wstbindata.pro)


WSTDATETOJD - CONVERT WST STRING DATE TO JD

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstdatetojd - convert wst string date to jd

SYNTAX: jd=wstdatetojd(datestr)
ARGS:
   datestr: string  format "mm/dd/yy hh:mm:ss" ast
               
DESCRIPTION:
   Convert datestr from weather station to julday.

(See /pkg/rsi/local/libao/phil/wst/wstdatetojd.pro)


WSTGETARCHIVE - RESTORE ALL OR PART OF WEATHER STATION MONTHLY ARCHIVE

[Previous Routine] [Next Routine] [List of Routines]
NAME:
wstgetarchive - restore all or part of weather station monthly archive
SYNTAX: count=wstgetarchive(yymmdd1,yymmdd2,ball,ndays=ndays,dir=dir,$
                            maxDays=maxDays)
ARGS: 
yymmdd1  : long    year,month,day of first day to get (ast)
yymmdd2  : long    year,month,day of last  day to get (ast)
KEYWORDS:
    ndays: long    number of days to return. If supplied then
                   ignore yymmdd2. 
      dir: string  If provided, then this is the path to 
                         acces the archive save files. The default 
                         is:/share/megs2_u1/wst/ .
   maxDays: long   by default the program will limit you to
                   about 366 days (this is about 240Mbytes). If 
                   you want more data, than set maxdays to the
                   maximum allowable value (be sure your computer
                   has enough memory).
RETURNS:
   ball[count]: {wst}     number of samples returned
DESCRIPTION:
   This routine will input weather station data stored in the
idl archive. This archive is updated at the end of each month
from the online file. 
You specify the start and end dates of the data to extract. 

	A single month will consist of about 20Mbytes of data.

EXAMPLES

;get all data for jan14
 nrecs=wstgetarchive(140101,140131,ball)

(See /pkg/rsi/local/libao/phil/wst/wstgetarchive.pro)


WSTLDREC - LOAD STRUCT FROM ASCII INPUT

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstldrec - load struct from ascii input

SYNTAX: a=wstldrec(inpl)
ARGS:
  inpl: string  ascii record read from oriondata.txt.
               
DESCRIPTION:
   load wst structure from ascii input line

(See /pkg/rsi/local/libao/phil/wst/wstldrec.pro)


WSTLDREC21 - LOAD STRUCT FROM ASCII INPUT AFTER 13JAN21

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstldrec21 - load struct from ascii input after 13jan21
SYNTAX: a=wstldrec21(inpl,tip=tip)
ARGS:
  inpl: string  ascii record read from oriondata.txt.
KEYWORDS:
tip             if set then include tipping meter rain info
                this duplicates the rain entries with 2
                iw rainToday2, etc
               
DESCRIPTION:
   load wst structure from ascii input line
We switched orion weather stations on  13jan21 (old one was on the platform :)
The order of the data in the new ascii file is in a different order than the old one.
 This routine should be used for data on/after 13jan21.
 We are using the same structure, just loading it in a different order.
 missing:
    north offset no longer available
    rain duration

(See /pkg/rsi/local/libao/phil/wst/wstldrec21.pro)


WSTORIONLOGINP - READ AN ORION LOG FILE

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstorionloginp - read  an orion log file

SYNTAX: n=wstorionloginp(filename,logI)
ARGS:
  filename: string    to input
RETURNS:
      n:  int   number records input
 logI[n]: struct input data
               
DESCRIPTION:
   The complete orion logfiles can be downloaded from the web interface by:
data export
 show datalogs
 right click on link, then save.
These logs contain all of the orion data (not just the stuff saved
for ao wst logs.
Note:
 this routine needs the 8.6 version of read_csv.

(See /pkg/rsi/local/libao/phil/wst/wstorionloginp.pro)


WSTPLOTDAY - PLOT 1 DAY OF ORION DATA

[Previous Routine] [Next Routine] [List of Routines]
NAME:
wstplotday - plot 1 day of orion data
SYNTAX: npnts=wstplotday(yymmdd,b=b)
ARGS:
yymmdd : int  year,month,day to plot
KEYWORDS:
RETURNS:
npnts: long < 0 --> error
            > 0  number of points in day if provided
b[npnts]:{} if b= supplied return the input data

(See /pkg/rsi/local/libao/phil/wst/wstplotday.pro)


WSTPLOTMON - MONTHLY WEATHER STATION PLOTS

[Previous Routine] [Next Routine] [List of Routines]
NAME:
wstplotmon - monthly weather station plots
SYNTAX: npnts=wstplotmon(yymm,wait=wait
ARGS:
yymm : int  year,month to plot
KEYWORDS:
wait :   if set the wait for keyboard input between plots
usebar:  if set then user passes data in via bar= keyword.
         program will not read it in
RETURNS:
npnts: long < 0 --> error
            > 0  number of points in month
bar[npnts]:{} if usebar is not set then the input data will be
              passed back in bar.

(See /pkg/rsi/local/libao/phil/wst/wstplotmon.pro)


WSTRAWINPDAY - READ IN 1 DAYS WORTH OF DATA FROM ASCII FILE

[Previous Routine] [Next Routine] [List of Routines]
NAME: 
wstrawinpday - read in 1 days worth of data from ascii file

SYNTAX: n=wstrawinpday(yymmdd,bar,inpdir=inpdir,tip=tip)
ARGS:
  yymmdd: int   yymmdd of date for file (ast)
 inpdir : string input dir to read file. def: '/share/orion/'
  tip   :       if set then include tipping meter info in struct.
                this includes the rainelements with a 2 eg
                raintoday2
RETURNS:
      n:  int   number records input
 bar[n]: struct input data
               
DESCRIPTION:
   Input a days worth of wst data from the daily raw:
wst_yymmdd.txt. 
	The data is loaded into the {wststr) array bar. 
The file can have 1 or more minutes from the next ast day
Since the file rename occurs 1 minute after midnite

(See /pkg/rsi/local/libao/phil/wst/wstrawinpday.pro)


WSTRAWINPRECS - READ IN RECORDS FROM ASCII FILE

[Previous Routine] [List of Routines]
NAME: 
wstrawinprecs - read in records  from ascii file

SYNTAX: n=wstrawinprecs(lun,nrecs,bar)
ARGS:
  lun : int     from file open
  nrecs: long   number of entries to read
                use this to skip recs with bad dates
RETURNS:
      n:  int   number records input
 bar[n]: struct input data
               
DESCRIPTION:
   Routine reads nrecs worth of data from the file pointed to by lun.
Lun should be assigned to the oriondata.txt ascii file 
(written by the orion weather station). The routine does no positioning
before starting to read (so you should do a rewind if you don't know
where you are positioned in the file.
	The data is    loaded into the {wststr) array bar. 

(See /pkg/rsi/local/libao/phil/wst/wstrawinprecs.pro)