Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
extract_cyclones
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
cyclobs
extract_cyclones
Commits
fd95cb15
Commit
fd95cb15
authored
Sep 30, 2020
by
CEVAER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added subdirectory (year, day of year) creation
parent
023d4dd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
bin/extractWrapper.sh
bin/extractWrapper.sh
+2
-0
extract_cyclones/__init__.py
extract_cyclones/__init__.py
+11
-2
No files found.
bin/extractWrapper.sh
View file @
fd95cb15
...
...
@@ -5,6 +5,8 @@ file_path=$7
filename
=
"
${
file_path
##*/
}
"
filename_no_ext
=
"
${
filename
%.*
}
"
# TODO put report file in same dir as generated files
file_report_dir
=
"
$output_path
/report/
$filename_no_ext
"
mkdir
-p
"
$file_report_dir
"
...
...
extract_cyclones/__init__.py
View file @
fd95cb15
...
...
@@ -256,8 +256,13 @@ def extract_write_cyclone_data(dataset, kept_track_points, filename, output_path
if
is_full_time
:
sel
.
attrs
[
"measurement_start_date"
]
=
min_time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
sel
.
attrs
[
"measurement_stop_date"
]
=
max_time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
year
=
str
(
min_time
.
year
)
doy
=
min_time
.
strftime
(
'%j'
)
else
:
sel
.
attrs
[
"measurement_start_date"
]
=
str
(
file_date
+
min_time
)
min_date
=
file_date
+
min_time
year
=
min_date
.
year
doy
=
min_date
.
strftime
(
'%j'
)
sel
.
attrs
[
"measurement_start_date"
]
=
str
(
min_date
)
sel
.
attrs
[
"measurement_stop_date"
]
=
str
(
file_date
+
max_time
)
# Removing attributes
...
...
@@ -289,7 +294,10 @@ def extract_write_cyclone_data(dataset, kept_track_points, filename, output_path
sel
.
rio
.
set_spatial_dims
(
'lon'
,
'lat'
,
inplace
=
True
)
sel
.
rio
.
write_crs
(
"epsg:4326"
,
inplace
=
True
)
sel
.
to_netcdf
(
os
.
path
.
join
(
output_path
,
output_filename
))
out
=
os
.
path
.
join
(
output_path
,
str
(
year
),
doy
)
os
.
makedirs
(
out
,
exist_ok
=
True
)
sel
.
to_netcdf
(
os
.
path
.
join
(
out
,
output_filename
))
def
process_file
(
session
,
file
,
output_path
,
extract_date_func
,
attrs_to_del
,
var_to_del
,
wind_col
,
...
...
@@ -299,6 +307,7 @@ def process_file(session, file, output_path, extract_date_func, attrs_to_del, va
filename
=
os
.
path
.
basename
(
file
)
file_date
=
extract_date_func
(
filename
)
logger
.
debug
(
f
"File date
{
file_date
}
"
)
track_points
=
get_track_points_from_database
(
session
,
file_date
)
logger
.
debug
(
f
"Number of track point found :
{
len
(
track_points
)
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment