Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to py3 and some bug fixes #2

Open
saeed-moghimi-noaa opened this issue Apr 22, 2022 · 4 comments
Open

Updating to py3 and some bug fixes #2

saeed-moghimi-noaa opened this issue Apr 22, 2022 · 4 comments

Comments

@saeed-moghimi-noaa
Copy link
Owner

saeed-moghimi-noaa commented Apr 22, 2022

@pvelissariou1 @ps2epsi @gseroka

All,
Make a clean clone of the code. Please review this issue:

Known issues:

  • some times git pull make pynmd not working properly. In those case you may want to clone the code all over again
  • base_info.py files are slightly modified for each set of plots

Results for Harvey:

  • tide only
  • without offset (no bias correction)
  • with offset (with bias correction)

Comment here and report errors and ...

For setting up Python Env see here:

https://gist.github.com/saeed-moghimi-noaa/3c07084fca030495010628bda9f579aa

@saeed-moghimi-noaa
Copy link
Owner Author

Effects of bias correction

map plots

maxelehar_region_maxelev

base_info.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input params

"""
__author__ = "Saeed Moghimi"
__copyright__ = "Copyright 2017, UCAR/NOAA"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "[email protected]"


from   pynmd.plotting.vars_param import *
from   collections import defaultdict
import datetime


cases = defaultdict(dict)

#### INPUTS ####

#base_dir_sm   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
#track_fname   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
#hwm_fname     = 'xxx'
#base_dir_coops_piks = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'
#base_dir_obs        = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'

#nwm_channel_pnts    = 'xxx'
#nwm_channel_geom    = 'xxx'
#nwm_results_dir     = 'xxx'

#name = 'HARVEY'
#year = '2017'

#### INPUTS ####
base_dir_sm         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
track_fname         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
hwm_fname           = '../obs/obs_all/hwm/harvey2017.csv'
base_dir_obs        = '../obs/obs_all/'
nwm_channel_pnts    = None
nwm_channel_geom    = None
nwm_results_dir     = None
##
name = 'HARVEY'
year = '2017'


# map_plot_options
#### map_plot_options
plot_adc_fort       = False
plot_adc_maxele     = True
plot_nems_fields    = False
plot_forcing_files  = False
plot_nwm_files      = False
plot_transects      = False
plot_mesh           = False
vec                 = False
local_bias_cor      = True


#HWM proximity limit
prox_max = 0.0075 * 1  #grid size * n

## NOTE <<<
## for HWM plot make this False <<<
## for map and timeseries you can make this True <<<
if False:
    #Base run only tide
    key  = '00-atm:n-tid:y-wav:n'
    cases[key]['dir']    = base_dir_sm + '/harvey.tide_baserun.20220324/run/'
    cases[key]['label']  = 'Only tide'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #
    key  = '00-atm:y-tid:y-wav:n'
    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.nooffset/run/'
    cases[key]['label']  = 'No offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #2way wav-ocn
    key  = '00-atm:y-tid:y-wav:y'
    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.7doffset/run/'
    cases[key]['label']  = 'Offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key1 = key

    ###########

#out_dir  = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/ca_adcirc_plot/2017_harvey/'


out_dir  = '../yuji_plots/ca_adcirc_plot/2017_harvey/p1_diff_tide/'

#########################  Variable Limits Settings ####################################
tim_lim = {}
tim_lim['xmin'] = datetime.datetime(2017, 8, 20)
tim_lim['xmax'] = datetime.datetime(2017, 9, 2)
#tim_lim['xmin'] = datetime.datetime(2017, 8, 17,12) - datetime.timedelta(2)
#tim_lim['xmax'] = datetime.datetime(2017, 8, 17,12) + datetime.timedelta(2)

#### Deffinitions 


## Suggestion!! <<<
## for HWM and map surge plots make this True <<<
## for diff map plots make this False <<<
if True:
    # key1 - key0 >> key0 is tide
    defs['elev']['cmap']  =  maps.jetMinWi
    defs['elev']['label']  =  'Surge [m]'
    defs['elev']['vmin']  =  0
    defs['elev']['vmax']  =  0.5
    
else:
    # key1 - key0 >> key0 is run without wave
    defs['elev']['label']  =  'Diff [m]'
    #defs['elev']['cmap']  =  maps.jetWoGn()
    defs['elev']['cmap']   =  plt.cm.jet
    defs['elev']['vmin']  =  -0.5
    defs['elev']['vmax']  =   0.5

#rad-stress
defs['rad']['vmin']  =  0.0
defs['rad']['vmax']  =  0.01
defs['rad']['cmap']  =  maps.jetMinWi

if True:
    #wind-stress
    defs['wind']['vmin']  =  0.0
    defs['wind']['vmax']  =  0.01
    defs['wind']['label'] = 'Wind force [m$^ \\mathrm{-2}$ s$^ \\mathrm{-2}$] '
else:
    #wind vel
    defs['wind']['vmin']  =  10
    defs['wind']['vmax']  =  40  
    defs['wind']['label'] = 'Wind Speed [m$^ \\mathrm{}$ s$^ \\mathrm{-1}$] '

defs['wind']['cmap']  =  maps.jetMinWi

################################################
varname = 'pmsl'
defs['pmsl']  ['fname']   = 'fort.73.nc'
#defs[varname]['label']   = 'Pressure [mH2O] '
defs[varname] ['label']  = 'pressure [Pa]'
defs[varname] ['var']     = 'pressure'
if True:
    defs['pmsl']['vmin']  = 9.2000
    defs['pmsl']['vmax']  = 10.5000
else:
    defs['pmsl']['vmin']  =  92000
    defs['pmsl']['vmax']  =  101000
    #defs[varname]['vmin']  =  val.min() // 1000 * 1000

defs['hs']['vmin']  =  0
defs['hs']['vmax']  =  8                    ### plot stuff
defs['rad' ]['fname'] = 'rads.64.nc'
defs['elev']['fname'] = 'fort.63.nc'
defs['wind']['fname'] = 'fort.74.nc'

##### SELECLT VARNAME TO PLOT ########################
#varnames = ['elev','rad','wind', 'hs','maxele']
varnames = ['elev']

##### SELECLT GEO REGION TO PLOT ########################
#regions = ['isa_landfall_zoom'] #,'isa_landfall','isa_local','isa_region','hsofs_region']
#regions = ['har_region','har_local','ike_region','hsofs_region','ike_local','ike_galv_bay']
#regions = ['hsofs_region']
regions = ['har_region','har_local','ike_region']

station_selected_list = True 

station_selected_list =  [
    '8764227',
    '8764044',
    '8770475',
    '8768094',
    '8770520',
    '8770777',
    '8770971',
    '8771013',
    '8771341',
    '8771450',
    '8772447',
    '8773259',
    '8773701',
    '8775237',
    '8775296',
    '8775870',
    ]



@saeed-moghimi-noaa
Copy link
Owner Author

saeed-moghimi-noaa commented Apr 22, 2022

Harvey Surge

map plots

maxelehar_region_maxelev

maxelehar_local_maxelev

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input params

"""
__author__ = "Saeed Moghimi"
__copyright__ = "Copyright 2017, UCAR/NOAA"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "[email protected]"


from   pynmd.plotting.vars_param import *
from   collections import defaultdict
import datetime


cases = defaultdict(dict)

#### INPUTS ####

#base_dir_sm   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
#track_fname   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
#hwm_fname     = 'xxx'
#base_dir_coops_piks = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'
#base_dir_obs        = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'

#nwm_channel_pnts    = 'xxx'
#nwm_channel_geom    = 'xxx'
#nwm_results_dir     = 'xxx'

#name = 'HARVEY'
#year = '2017'

#### INPUTS ####
base_dir_sm         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
track_fname         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
hwm_fname           = '../obs/obs_all/hwm/harvey2017.csv'
base_dir_obs        = '../obs/obs_all/'
nwm_channel_pnts    = None
nwm_channel_geom    = None
nwm_results_dir     = None
##
name = 'HARVEY'
year = '2017'


# map_plot_options
#### map_plot_options
plot_adc_fort       = False
plot_adc_maxele     = True
plot_nems_fields    = False
plot_forcing_files  = False
plot_nwm_files      = False
plot_transects      = False
plot_mesh           = False
vec                 = False
local_bias_cor      = True


#HWM proximity limit
prox_max = 0.0075 * 1  #grid size * n

## NOTE <<<
## for HWM plot make this False <<<
## for map and timeseries you can make this True <<<
if True:
    #Base run only tide
    key  = '00-atm:n-tid:y-wav:n'
    cases[key]['dir']    = base_dir_sm + '/harvey.tide_baserun.20220324/run/'
    cases[key]['label']  = 'Only tide'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #
    key  = '00-atm:y-tid:y-wav:n'

    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.nooffset/run/'
    cases[key]['label']  = 'No offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    #key0 = key

if True:
    #2way wav-ocn
    key  = '00-atm:y-tid:y-wav:y'
    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.7doffset/run/'
    cases[key]['label']  = 'Offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key1 = key

    ###########

#out_dir  = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/ca_adcirc_plot/2017_harvey/'


out_dir  = '../yuji_plots/ca_adcirc_plot/2017_harvey/p1_diff_tide/'

#########################  Variable Limits Settings ####################################
tim_lim = {}
tim_lim['xmin'] = datetime.datetime(2017, 8, 20)
tim_lim['xmax'] = datetime.datetime(2017, 9, 2)
#tim_lim['xmin'] = datetime.datetime(2017, 8, 17,12) - datetime.timedelta(2)
#tim_lim['xmax'] = datetime.datetime(2017, 8, 17,12) + datetime.timedelta(2)

#### Deffinitions 


## Suggestion!! <<<
## for HWM and map surge plots make this True <<<
## for diff map plots make this False <<<
if True:
    # key1 - key0 >> key0 is tide
    defs['elev']['cmap']  =  maps.jetMinWi
    defs['elev']['label']  =  'Surge [m]'
    defs['elev']['vmin']  =  0
    defs['elev']['vmax']  =  5
    
else:
    # key1 - key0 >> key0 is run without wave
    defs['elev']['label']  =  'Diff [m]'
    #defs['elev']['cmap']  =  maps.jetWoGn()
    defs['elev']['cmap']   =  plt.cm.jet
    defs['elev']['vmin']  =  -0.5
    defs['elev']['vmax']  =   0.5

#rad-stress
defs['rad']['vmin']  =  0.0
defs['rad']['vmax']  =  0.01
defs['rad']['cmap']  =  maps.jetMinWi

if True:
    #wind-stress
    defs['wind']['vmin']  =  0.0
    defs['wind']['vmax']  =  0.01
    defs['wind']['label'] = 'Wind force [m$^ \\mathrm{-2}$ s$^ \\mathrm{-2}$] '
else:
    #wind vel
    defs['wind']['vmin']  =  10
    defs['wind']['vmax']  =  40  
    defs['wind']['label'] = 'Wind Speed [m$^ \\mathrm{}$ s$^ \\mathrm{-1}$] '

defs['wind']['cmap']  =  maps.jetMinWi

################################################
varname = 'pmsl'
defs['pmsl']  ['fname']   = 'fort.73.nc'
#defs[varname]['label']   = 'Pressure [mH2O] '
defs[varname] ['label']  = 'pressure [Pa]'
defs[varname] ['var']     = 'pressure'
if True:
    defs['pmsl']['vmin']  = 9.2000
    defs['pmsl']['vmax']  = 10.5000
else:
    defs['pmsl']['vmin']  =  92000
    defs['pmsl']['vmax']  =  101000
    #defs[varname]['vmin']  =  val.min() // 1000 * 1000

defs['hs']['vmin']  =  0
defs['hs']['vmax']  =  8                    ### plot stuff
defs['rad' ]['fname'] = 'rads.64.nc'
defs['elev']['fname'] = 'fort.63.nc'
defs['wind']['fname'] = 'fort.74.nc'

##### SELECLT VARNAME TO PLOT ########################
#varnames = ['elev','rad','wind', 'hs','maxele']
varnames = ['elev']

##### SELECLT GEO REGION TO PLOT ########################
#regions = ['isa_landfall_zoom'] #,'isa_landfall','isa_local','isa_region','hsofs_region']
#regions = ['har_region','har_local','ike_region','hsofs_region','ike_local','ike_galv_bay']
#regions = ['hsofs_region']
regions = ['har_region','har_local','ike_region']

station_selected_list = True 

station_selected_list =  [
    '8764227',
    '8764044',
    '8770475',
    '8768094',
    '8770520',
    '8770777',
    '8770971',
    '8771013',
    '8771341',
    '8771450',
    '8772447',
    '8773259',
    '8773701',
    '8775237',
    '8775296',
    '8775870',
    ]


@saeed-moghimi-noaa
Copy link
Owner Author

saeed-moghimi-noaa commented Apr 22, 2022

Time series

100_map_Station__8768094_at_Calcasieu_Pass__LA_
100_tim_Station__8768094_at_Calcasieu_Pass__LA_
101_map_Station__8771013_at_Eagle_Point__Galveston_Bay__TX_
101_tim_Station__8771013_at_Eagle_Point__Galveston_Bay__TX_
102_map_Station__8773259_at_Port_Lavaca__TX_
102_tim_Station__8773259_at_Port_Lavaca__TX_
103_map_Station__8775870_at_Bob_Hall_Pier__Corpus_Christi__TX_
103_tim_Station__8775870_at_Bob_Hall_Pier__Corpus_Christi__TX_

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input params

"""
__author__ = "Saeed Moghimi"
__copyright__ = "Copyright 2017, UCAR/NOAA"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "[email protected]"


from   pynmd.plotting.vars_param import *
from   collections import defaultdict
import datetime


cases = defaultdict(dict)

#### INPUTS ####

#base_dir_sm   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
#track_fname   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
#hwm_fname     = 'xxx'
#base_dir_coops_piks = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'
#base_dir_obs        = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'

#nwm_channel_pnts    = 'xxx'
#nwm_channel_geom    = 'xxx'
#nwm_results_dir     = 'xxx'

#name = 'HARVEY'
#year = '2017'

#### INPUTS ####
base_dir_sm         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
track_fname         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
hwm_fname           = '../obs/obs_all/hwm/harvey2017.csv'
base_dir_obs        = '../obs/obs_all/'
nwm_channel_pnts    = None
nwm_channel_geom    = None
nwm_results_dir     = None
##
name = 'HARVEY'
year = '2017'


# map_plot_options
#### map_plot_options
plot_adc_fort       = False
plot_adc_maxele     = True
plot_nems_fields    = False
plot_forcing_files  = False
plot_nwm_files      = False
plot_transects      = False
plot_mesh           = False
vec                 = False
local_bias_cor      = True


#HWM proximity limit
prox_max = 0.0075 * 1  #grid size * n

## NOTE <<<
## for HWM plot make this False <<<
## for map and timeseries you can make this True <<<
if True:
    #Base run only tide
    key  = '00-atm:n-tid:y-wav:n'
    cases[key]['dir']    = base_dir_sm + '/harvey.tide_baserun.20220324/run/'
    cases[key]['label']  = 'Only tide'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #
    key  = '00-atm:y-tid:y-wav:n'

    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.nooffset/run/'
    cases[key]['label']  = 'No offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #2way wav-ocn
    key  = '00-atm:y-tid:y-wav:y'
    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.7doffset/run/'
    cases[key]['label']  = 'Offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key1 = key

    ###########

#out_dir  = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/ca_adcirc_plot/2017_harvey/'


out_dir  = '../yuji_plots/ca_adcirc_plot/2017_harvey/p1_diff_tide/'

#########################  Variable Limits Settings ####################################
tim_lim = {}
tim_lim['xmin'] = datetime.datetime(2017, 8, 20)
tim_lim['xmax'] = datetime.datetime(2017, 9, 2)
#tim_lim['xmin'] = datetime.datetime(2017, 8, 17,12) - datetime.timedelta(2)
#tim_lim['xmax'] = datetime.datetime(2017, 8, 17,12) + datetime.timedelta(2)

#### Deffinitions 


## Suggestion!! <<<
## for HWM and map surge plots make this True <<<
## for diff map plots make this False <<<
if True:
    # key1 - key0 >> key0 is tide
    defs['elev']['cmap']  =  maps.jetMinWi
    defs['elev']['label']  =  'Surge [m]'
    defs['elev']['vmin']  =  0
    defs['elev']['vmax']  =  0.5
    
else:
    # key1 - key0 >> key0 is run without wave
    defs['elev']['label']  =  'Diff [m]'
    #defs['elev']['cmap']  =  maps.jetWoGn()
    defs['elev']['cmap']   =  plt.cm.jet
    defs['elev']['vmin']  =  -0.5
    defs['elev']['vmax']  =   0.5

#rad-stress
defs['rad']['vmin']  =  0.0
defs['rad']['vmax']  =  0.01
defs['rad']['cmap']  =  maps.jetMinWi

if True:
    #wind-stress
    defs['wind']['vmin']  =  0.0
    defs['wind']['vmax']  =  0.01
    defs['wind']['label'] = 'Wind force [m$^ \\mathrm{-2}$ s$^ \\mathrm{-2}$] '
else:
    #wind vel
    defs['wind']['vmin']  =  10
    defs['wind']['vmax']  =  40  
    defs['wind']['label'] = 'Wind Speed [m$^ \\mathrm{}$ s$^ \\mathrm{-1}$] '

defs['wind']['cmap']  =  maps.jetMinWi

################################################
varname = 'pmsl'
defs['pmsl']  ['fname']   = 'fort.73.nc'
#defs[varname]['label']   = 'Pressure [mH2O] '
defs[varname] ['label']  = 'pressure [Pa]'
defs[varname] ['var']     = 'pressure'
if True:
    defs['pmsl']['vmin']  = 9.2000
    defs['pmsl']['vmax']  = 10.5000
else:
    defs['pmsl']['vmin']  =  92000
    defs['pmsl']['vmax']  =  101000
    #defs[varname]['vmin']  =  val.min() // 1000 * 1000

defs['hs']['vmin']  =  0
defs['hs']['vmax']  =  8                    ### plot stuff
defs['rad' ]['fname'] = 'rads.64.nc'
defs['elev']['fname'] = 'fort.63.nc'
defs['wind']['fname'] = 'fort.74.nc'

##### SELECLT VARNAME TO PLOT ########################
#varnames = ['elev','rad','wind', 'hs','maxele']
varnames = ['elev']

##### SELECLT GEO REGION TO PLOT ########################
#regions = ['isa_landfall_zoom'] #,'isa_landfall','isa_local','isa_region','hsofs_region']
#regions = ['har_region','har_local','ike_region','hsofs_region','ike_local','ike_galv_bay']
#regions = ['hsofs_region']
regions = ['har_region','har_local','ike_region']

station_selected_list = True 

station_selected_list =  [
    '8764227',
    '8764044',
    '8770475',
    '8768094',
    '8770520',
    '8770777',
    '8770971',
    '8771013',
    '8771341',
    '8771450',
    '8772447',
    '8773259',
    '8773701',
    '8775237',
    '8775296',
    '8775870',
    ]


@saeed-moghimi-noaa
Copy link
Owner Author

High Water Marks

all_stat_HWM
maps_hwm_obs_No_offset
maps_hwm_obs_Offset
scatters_HWM
taylor_HWM

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input params

"""
__author__ = "Saeed Moghimi"
__copyright__ = "Copyright 2017, UCAR/NOAA"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "[email protected]"


from   pynmd.plotting.vars_param import *
from   collections import defaultdict
import datetime


cases = defaultdict(dict)

#### INPUTS ####

#base_dir_sm   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
#track_fname   = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
#hwm_fname     = 'xxx'
#base_dir_coops_piks = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'
#base_dir_obs        = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/obs/'

#nwm_channel_pnts    = 'xxx'
#nwm_channel_geom    = 'xxx'
#nwm_results_dir     = 'xxx'

#name = 'HARVEY'
#year = '2017'

#### INPUTS ####
base_dir_sm         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/data/'
track_fname         = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/nsem-workflow/parm/storms/harvey/bal092017.dat'
hwm_fname           = '../obs/obs_all/hwm/harvey2017.csv'
base_dir_obs        = '../obs/obs_all/'
nwm_channel_pnts    = None
nwm_channel_geom    = None
nwm_results_dir     = None
##
name = 'HARVEY'
year = '2017'


# map_plot_options
#### map_plot_options
plot_adc_fort       = False
plot_adc_maxele     = True
plot_nems_fields    = False
plot_forcing_files  = False
plot_nwm_files      = False
plot_transects      = False
plot_mesh           = False
vec                 = False
local_bias_cor      = True


#HWM proximity limit
prox_max = 0.0075 * 1  #grid size * n

## NOTE <<<
## for HWM plot make this False <<<
## for map and timeseries you can make this True <<<
if False:
    #Base run only tide
    key  = '00-atm:n-tid:y-wav:n'
    cases[key]['dir']    = base_dir_sm + '/harvey.tide_baserun.20220324/run/'
    cases[key]['label']  = 'Only tide'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #
    key  = '00-atm:y-tid:y-wav:n'

    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.nooffset/run/'
    cases[key]['label']  = 'No offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key0 = key

if True:
    #2way wav-ocn
    key  = '00-atm:y-tid:y-wav:y'
    cases[key]['dir']    = base_dir_sm + '/harvey.atm2ocn.20220324.7doffset/run/'
    cases[key]['label']  = 'Offset'
    cases[key]['hsig_file'] = None
    cases[key]['wdir_file'] = None
    key1 = key

    ###########

#out_dir  = '/scratch2/COASTAL/coastal/noscrub/Yuji.Funakoshi/ca_adcirc_plot/2017_harvey/'


out_dir  = '../yuji_plots/ca_adcirc_plot/2017_harvey/p1_diff_tide/'

#########################  Variable Limits Settings ####################################
tim_lim = {}
tim_lim['xmin'] = datetime.datetime(2017, 8, 20)
tim_lim['xmax'] = datetime.datetime(2017, 9, 2)
#tim_lim['xmin'] = datetime.datetime(2017, 8, 17,12) - datetime.timedelta(2)
#tim_lim['xmax'] = datetime.datetime(2017, 8, 17,12) + datetime.timedelta(2)

#### Deffinitions 


## Suggestion!! <<<
## for HWM and map surge plots make this True <<<
## for diff map plots make this False <<<
if True:
    # key1 - key0 >> key0 is tide
    defs['elev']['cmap']  =  maps.jetMinWi
    defs['elev']['label']  =  'Surge [m]'
    defs['elev']['vmin']  =  0
    defs['elev']['vmax']  =  5
    
else:
    # key1 - key0 >> key0 is run without wave
    defs['elev']['label']  =  'Diff [m]'
    #defs['elev']['cmap']  =  maps.jetWoGn()
    defs['elev']['cmap']   =  plt.cm.jet
    defs['elev']['vmin']  =  -0.5
    defs['elev']['vmax']  =   0.5

#rad-stress
defs['rad']['vmin']  =  0.0
defs['rad']['vmax']  =  0.01
defs['rad']['cmap']  =  maps.jetMinWi

if True:
    #wind-stress
    defs['wind']['vmin']  =  0.0
    defs['wind']['vmax']  =  0.01
    defs['wind']['label'] = 'Wind force [m$^ \\mathrm{-2}$ s$^ \\mathrm{-2}$] '
else:
    #wind vel
    defs['wind']['vmin']  =  10
    defs['wind']['vmax']  =  40  
    defs['wind']['label'] = 'Wind Speed [m$^ \\mathrm{}$ s$^ \\mathrm{-1}$] '

defs['wind']['cmap']  =  maps.jetMinWi

################################################
varname = 'pmsl'
defs['pmsl']  ['fname']   = 'fort.73.nc'
#defs[varname]['label']   = 'Pressure [mH2O] '
defs[varname] ['label']  = 'pressure [Pa]'
defs[varname] ['var']     = 'pressure'
if True:
    defs['pmsl']['vmin']  = 9.2000
    defs['pmsl']['vmax']  = 10.5000
else:
    defs['pmsl']['vmin']  =  92000
    defs['pmsl']['vmax']  =  101000
    #defs[varname]['vmin']  =  val.min() // 1000 * 1000

defs['hs']['vmin']  =  0
defs['hs']['vmax']  =  8                    ### plot stuff
defs['rad' ]['fname'] = 'rads.64.nc'
defs['elev']['fname'] = 'fort.63.nc'
defs['wind']['fname'] = 'fort.74.nc'

##### SELECLT VARNAME TO PLOT ########################
#varnames = ['elev','rad','wind', 'hs','maxele']
varnames = ['elev']

##### SELECLT GEO REGION TO PLOT ########################
#regions = ['isa_landfall_zoom'] #,'isa_landfall','isa_local','isa_region','hsofs_region']
#regions = ['har_region','har_local','ike_region','hsofs_region','ike_local','ike_galv_bay']
#regions = ['hsofs_region']
regions = ['har_region','har_local','ike_region']

station_selected_list = True 

station_selected_list =  [
    '8764227',
    '8764044',
    '8770475',
    '8768094',
    '8770520',
    '8770777',
    '8770971',
    '8771013',
    '8771341',
    '8771450',
    '8772447',
    '8773259',
    '8773701',
    '8775237',
    '8775296',
    '8775870',
    ]







"""
station_selected_list =  [
    '8771013',
    '8771510',
    '8770570',
    '8771450',
    '8768094',
    '8770933',
    '8770971',
    '8770777',
    '8770475',
    '8764044',
    #'8764227',
    #'8760417',
    ]
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant