Skip to content
Snippets Groups Projects
Commit b02c7e98 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent 161f348e
No related branches found
No related tags found
No related merge requests found
......@@ -48,16 +48,18 @@ def calculate_radii_and_rossby(start, end, inc, segment, e_overestim, extremum,
for i in range(start, end, inc):
current_eddy = report_graph.node_to_date_eddy(segment[i], e_overestim)
date = datetime.date(1950,1,1) + datetime.timedelta(current_eddy['date_index'])
date = datetime.date(1950, 1, 1) \
+ datetime.timedelta(current_eddy['date_index'])
year = date.year
# calculate the location in the shapefile
d_init_1 = extremum[year].record(0)[1]
location = comp_ishape(d_init_1, ishape_last[year],
current_eddy['date_index'], current_eddy['eddy_index'])
# now that we have the location in the shapefiles, we need to get the radius and the rossby number
current_eddy['date_index'],
current_eddy['eddy_index'])
# now that we have the location in the shapefiles, we need to
# get the radius and the rossby number
shapeRec = extremum[year].shapeRecord(location)
# rossby:
lat_in_deg = shapeRec.shape.points[0][1]
......@@ -137,8 +139,8 @@ shp_tr_dir = input('Directory containing %Y/SHPC_(anti|cyclo): ')
for year in range(1993,2019):
shp_dir = path.join(shp_tr_dir, f'{year}/SHPC_{orientation}')
extremum[year] = shapefile.Reader(path.join(shp_dir, 'extremum.shp'))
max_speed[year] = shapefile.Reader(path.join(shp_dir, 'max_speed_contour.shp'))
extremum[year] = shapefile.Reader(path.join(shp_dir, 'extremum'))
max_speed[year] = shapefile.Reader(path.join(shp_dir, 'max_speed_contour'))
ishape_last[year] = loadtxt(path.join(shp_dir, 'ishape_last.txt'),
dtype = int, delimiter = "\n", unpack = False)
......@@ -147,12 +149,8 @@ num_of_days_to_avg = 7
# we iterate on the years because the segments are non sequential in time
for yr in range(1993, 2019):
print(f'Current year: {yr}')
# grab the shapefiles
# load the shapefiles and the ishape_last files
print('Loading extrema and ishape_last files.')
print('Loading shapefiles...')
max_rcd = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment