Exemple #1
0
def process_storm_files(args):

    so = StormOptions()

    so.air_fname = args['air_fname']
    so.sea_fname = args['sea_fname']

    #check to see if the correct type of files were uploaded
    if so.check_file_types() == False:
        return 2

    so.wind_fname = None

    so.format_output_fname(args['out_fname'])
    so.timezone = args['tz_info']
    so.daylight_savings = args['daylight_savings']

    if 'baro_y_min' in args and args['baro_y_min'] is not None:
        so.baroYLims = []
        so.baroYLims.append(args['baro_y_min'])
        so.baroYLims.append(args['baro_y_max'])

    if 'wl_y_min' in args and args['wl_y_min'] is not None:
        so.wlYLims = []
        so.wlYLims.append(args['wl_y_min'])
        so.wlYLims.append(args['wl_y_max'])

    #check to see if the time series of the water and air file overlap
    overlap = so.time_comparison()

    #if there is no overlap
    if overlap == 2:
        return 4

    try:
        snc = Storm_netCDF()
        so.netCDF['Storm Tide with Unfiltered Water Level'] = Bool(True)
        so.netCDF['Storm Tide Water Level'] = Bool(True)
        snc.process_netCDFs(so)

        sg = StormGraph()
        so.graph['Storm Tide with Wind Data'] = Bool(False)
        so.graph['Storm Tide with Unfiltered Water Level'] = Bool(True)
        so.graph['Storm Tide Water Level'] = Bool(True)
        so.graph['Atmospheric Pressure'] = Bool(True)
        sg.process_graphs(so)

        if args['sea_4hz'].lower() == 'true':
            so.int_units = False
            so.high_cut = 1.0
            so.low_cut = 0.045
            so.from_water_level_file = False

            ss = StormStatistics()

            for y in so.statistics:
                so.statistics[y] = Bool(False)

            so.statistics['H1/3'] = Bool(True)
            so.statistics['Average Z Cross'] = Bool(True)
            so.statistics['PSD Contour'] = Bool(True)

            ss.process_graphs(so)

        return 0
    except:
        return 5
Exemple #2
0
        self.val = val
         
    def get(self):
        return self.val
        
if __name__ == '__main__':
  
    so = StormOptions()
    so.clip = False
    so.air_fname = 'SCGEO14315_20175225_AIR.csv.nc'
    so.sea_fname = 'SCGEO14316_20175208_SEA_chopped.csv.nc'
#     so.wind_fname = "nc_wind.nc"
   
#     so.air_fname = 'FLVOL03143_stormtide_unfiltered.nc'
#     so.sea_fname = 'FLVOL03143_stormtide_unfiltered.nc'
#     so.wind_fname = "fl_wind.nc"
    
    so.from_water_level_file = False
    so.format_output_fname('waka_flaka')
    so.timezone = 'US/Eastern'
    so.daylight_savings = False
    so.graph['Storm Tide with Unfiltered Water Level and Wind Data'] = Bool(False)
    so.graph['Storm Tide with Unfiltered Water Level'] = Bool(True)
    so.graph['Storm Tide Water Level'] = Bool(False)
    so.graph['Storm Tide with Wind Data'] = Bool(False)
    so.graph['Atmospheric Pressure'] = Bool(False)
                    
    sg = StormGraph()
    so.int_units = False
    sg.process_graphs(so)
    
Exemple #3
0
        
class Bool(object):
    
    def __init__(self, val):
        self.val = val
         
    def get(self):
        return self.val
        
if __name__ == '__main__':
  
    so = StormOptions()
    so.clip = False
    so.air_fname = 'NCDAR00003_1511478_stormtide_unfiltered.nc'
    so.sea_fname = 'NCDAR00003_1511478_stormtide_unfiltered.nc'
    so.int_units = False
    so.high_cut = 1.0
    so.low_cut = 0.045
    so.from_water_level_file = True

    so.timezone = 'GMT'
    so.daylight_savings = False
    ss = StormStatistics()
    
    for y in so.statistics:
        so.statistics[y] = Bool(False)
        
    so.statistics['H1/3'] = Bool(True)
    so.statistics['Average Z Cross'] = Bool(True)
    so.statistics['PSD Contour'] = Bool(True)
    so.statistics['Peak Wave'] = Bool(True)