Ejemplo n.º 1
0
import scipy as sp
import imp
imp.load_source('transect_analysis',
                '/home/563/esh563/goulburn_NT/transect_analysis.py')
import transect_analysis as ta

# Specify start and end coords on coast.
# Choose order so that (transect_axis, coastline_axis) forms a right hand coordinate system
lon0 = 134.5293
lat0 = -12.4715
coast_lon1 = 133.3290
coast_lat1 = -12.1468

month = 12

trans_lon0, trans_lat0, trans_lon1, trans_lat1, n_points, n_trans, coast_distances, tran_distances = ta.define_transects(
    lon0, lat0, coast_lon1, coast_lat1, 453300, 25000)

static_path = '/g/data/ua8/ARCCSS_Data/MCASClimate/v1-0/static/static.nc'
static = xr.open_dataset(static_path).sel(latitude=slice(-12.75, -6),
                                          longitude=slice(130, 139))
static_tran = ta.calc_transects(static, trans_lon0, trans_lat0, trans_lon1,
                                trans_lat1, n_points, n_trans)
static_tran = static_tran.assign_coords(coastal_axis=coast_distances)
static_tran = static_tran.assign_coords(transect_axis=tran_distances)

# Calcualate distance where landmask drops below 0.5
coast_i = np.where(
    static_tran.mean('coastal_axis').LANDMASK.values < 0.5)[0][0] - 1
coast_location = tran_distances[coast_i]

# Redefine tran_distances so that coastline occurs at 0.
Ejemplo n.º 2
0
import pyproj as pp
import scipy as sp
import imp

imp.load_source('transect_analysis',
                '/home/563/esh563/goulburn_NT/transect_analysis.py')
import transect_analysis as ta

# Specify start and end coords on coast.
# Choose order so that (transect_axis, coastline_axis) forms a right hand coordinate system
lon0 = 134.5293
lat0 = -12.4715
coast_lon1 = 133.3290
coast_lat1 = -12.1468

trans_lon0, trans_lat0, trans_lon1, trans_lat1, n_points, n_trans, coast_distances, tran_distances = ta.define_transects(
    lon0, lat0, coast_lon1, coast_lat1, 453300, spacing=8 * 10**3)

static_path = '/g/data/ua8/ARCCSS_Data/MCASClimate/v1-0/static/static.nc'
static = xr.open_dataset(static_path).sel(latitude=slice(-12.75, -6),
                                          longitude=slice(130, 139))
static_tran = ta.calc_transects(static, trans_lon0, trans_lat0, trans_lon1,
                                trans_lat1, n_points, n_trans)
static_tran = static_tran.assign_coords(coastal_axis=coast_distances)
static_tran = static_tran.assign_coords(transect_axis=tran_distances)

# Calcualate distance where landmask drops below 0.5
coast_i = np.where(
    static_tran.mean('coastal_axis').LANDMASK.values < 0.5)[0][0] - 1
coast_location = tran_distances[coast_i]

# Redefine tran_distances so that coastline occurs at 0.