Example #1
0
                    
                # if data is not complete, move on. No need to fight here.
                ndat = 10*60*20 # minutes*seconds/minute*samples/second
                if len(data['Sonic_CupEqHorizSpeed_100m'][0][0][0].flatten()) != 12000:
                    continue
                    
                # make a vector of datetimes for the data
                timerange = MET.make_datetime_vector(file)
                # make a dataframe for the instrument at probeheight
                sonicdat = MET.make_dataframe_for_height(data, timerange, probeheight=probeheight)
                temp = sonicdat['Sonic_CupEqHorizSpeed_100m'].dropna()
                if len(temp)<1000:
                    continue
                    
                # extract variables needed for classificiation of IEC events
                cupspeed, winddir, sigma_data, params = MET.setup_IEC_params(sonicdat, probeheight=100)
                
                # look for extreme wind speed model events
                Ve01eventfound, Ve50eventfound = MET.find_EWM_events(cupspeed, params)
                Ve01events.extend(Ve01eventfound)
                Ve50events.extend(Ve50eventfound)
                
                # look for extreme operating gust events
                EOGeventfound = MET.find_EOG_events(cupspeed, params)
                EOGevents.extend(EOGeventfound)
                
                # look for extreme turbulence model events
                ETMeventfound = MET.find_ETM_events(cupspeed, sigma_data, params)
                ETMevents.extend(ETMeventfound)

                # look for extreme direction change events
Example #2
0
                # make a dataframe for the instrument at probeheight
                sonicdat = MET.make_dataframe_for_height(
                    data, timerange, probeheight=probeheight)
                sonicdat_lo = MET.make_dataframe_for_height(data,
                                                            timerange,
                                                            probeheight=38)
                sonicdat_hi = MET.make_dataframe_for_height(data,
                                                            timerange,
                                                            probeheight=122)
                temp = sonicdat['WS'].dropna()
                if len(temp) < 1000:
                    continue

                # extract variables needed for classificiation of IEC events
                params = MET.setup_IEC_params(sonicdat, probeheight=100)

                # # look for extreme wind speed model events
                # Ve01eventfound, Ve50eventfound = MET.find_EWM_events(sonicdat, params)
                # Ve01events = pd.concat([Ve01events,Ve01eventfound])
                # Ve50events = pd.concat([Ve50events,Ve50eventfound])

                # # look for extreme operating gust events
                # EOGeventfound = MET.find_EOG_events(sonicdat, params)
                # EOGevents = pd.concat([EOGevents,EOGeventfound])

                # # look for extreme turbulence model events
                # ETMeventfound = MET.find_ETM_events(sonicdat, params)
                # ETMevents = pd.concat([ETMevents,ETMeventfound])

                # # look for extreme direction change events
# import vis as vis
import utils as utils
import pickle as pkl

# paths (must mount volume smb://nrel.gov/shared/wind/WindWeb/MetData/135mData/)
towerID = 'M5'
metDataPath = '/Volumes/135mData/{}Twr/20Hz/mat/'.format(towerID)

savepath = '/Users/nhamilto/Documents/Wake_Dynamics/SiteChar/data/IEC_4'
try:
    os.makedirs(savepath)
except:
    pass

# setup IEC parameters for NWTC
params = MET.setup_IEC_params()

# load some threshold data
alpha_pos = np.load(
    '/Users/nhamilto/Documents/Wake_Dynamics/SiteChar/data/pos_alpha_limit.npy'
)
alpha_neg = np.load(
    '/Users/nhamilto/Documents/Wake_Dynamics/SiteChar/data/neg_alpha_limit.npy'
)
alpha_reference_velocity = np.load(
    '/Users/nhamilto/Documents/Wake_Dynamics/SiteChar/data/alpha_reference_velocity.npy'
)

#### Detect over given date range
# time range
years = [int(a) for a in np.arange(2017, 2019, 1)]  #