Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
Legacy
gde_calculations_prototype
Commits
0b89ddaf
Commit
0b89ddaf
authored
Sep 11, 2020
by
Cecilia Nievas
Browse files
Round to 5 decimal places when creating the OQ input files, function write_OQ_input_file
parent
ac22dcc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
GDE_TOOLS_access_SERA_HDF.py
View file @
0b89ddaf
...
...
@@ -31,6 +31,8 @@ import h5py
import
numpy
as
np
import
GDE_TOOLS_general
as
gdet_gral
import
GDE_TOOLS_world_grid
as
gdet_grid
import
pdb
def
verify_paths_are_given
(
gral_path
,
hdf5_filename
,
in_case
,
distrib_method
):
"""
...
...
@@ -436,7 +438,10 @@ def write_OQ_input_file(in_df, filename, cols_order, writemode='w', sep=','):
for
i
in
range
(
0
,
in_df
.
shape
[
0
]):
out_str
=
[]
for
colname
in
cols_order
:
out_str
.
append
(
str
(
in_df
[
colname
].
values
[
i
]))
if
colname
.
lower
()
==
'lon'
or
colname
.
lower
()
==
'lat'
or
colname
.
lower
()
==
'longitude'
or
colname
.
lower
()
==
'latitude'
or
colname
.
lower
()
==
'number'
or
colname
.
lower
()
==
'structural'
or
colname
.
lower
()
==
'night'
:
out_str
.
append
(
'{:.5f}'
.
format
(
in_df
[
colname
].
values
[
i
]))
else
:
out_str
.
append
(
str
(
in_df
[
colname
].
values
[
i
]))
out_csv
.
write
(
sep
.
join
(
out_str
)
+
'
\n
'
)
out_csv
.
close
()
...
...
Cecilia Nievas
@cnievas
mentioned in issue
#11
·
Jun 04, 2021
mentioned in issue
#11
mentioned in issue #11
Toggle commit list
Write
Preview
Supports
Markdown
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