Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
a01a3491
Commit
a01a3491
authored
4 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
removed directory function calls from factory.py
parent
05683532
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
237 additions
and
459 deletions
+237
-459
pynemo/nemo_bdy_ncgen.py
pynemo/nemo_bdy_ncgen.py
+224
-452
pynemo/nemo_bdy_ncpop.py
pynemo/nemo_bdy_ncpop.py
+2
-2
pynemo/reader/directory.py
pynemo/reader/directory.py
+1
-0
pynemo/reader/factory.py
pynemo/reader/factory.py
+10
-5
No files found.
pynemo/nemo_bdy_ncgen.py
View file @
a01a3491
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_ncpop.py
View file @
a01a3491
...
...
@@ -18,8 +18,8 @@ def write_data_to_file(filename, variable_name, data):
ncid
=
Dataset
(
filename
,
'a'
,
clobber
=
False
,
format
=
'NETCDF4'
)
count
=
data
.
shape
three_dim_variables
=
[
'votemper'
,
'vosaline'
,
'N1p'
,
'N3n'
,
'N5s'
,
'
thetao'
,
'so'
,
'uo'
,
'vo'
,
'
vobtcrtx'
,
'vozocrtx'
,
'vobtcrty'
,
'vomecrty'
]
two_dim_variables
=
[
'sossheig'
,
'iicethic'
,
'ileadfra'
,
'isnowthi'
,
'zos'
]
three_dim_variables
=
[
'votemper'
,
'vosaline'
,
'N1p'
,
'N3n'
,
'N5s'
,
'vobtcrtx'
,
'vozocrtx'
,
'vobtcrty'
,
'vomecrty'
]
two_dim_variables
=
[
'sossheig'
,
'iicethic'
,
'ileadfra'
,
'isnowthi'
]
if
variable_name
in
three_dim_variables
:
if
len
(
count
)
==
3
:
...
...
This diff is collapsed.
Click to expand it.
pynemo/reader/directory.py
View file @
a01a3491
'''
This is an abstraction for the data repository
@author: Mr. Srikanth Nagella
NOTE: this script is no longer used/supported by PyNEMO, reading directories for data files requires an NCML file.
'''
from
os
import
listdir
import
numpy
as
np
...
...
This diff is collapsed.
Click to expand it.
pynemo/reader/factory.py
View file @
a01a3491
...
...
@@ -9,7 +9,7 @@ import os
#Local Imports
from
pynemo.reader.ncml
import
Reader
as
NcMLReader
from
pynemo.reader.ncml
import
NcMLFile
from
pynemo.reader.directory
import
Reader
as
DirectoryReader
#
from pynemo.reader.directory import Reader as DirectoryReader
import
logging
from
netCDF4
import
Dataset
...
...
@@ -20,14 +20,19 @@ def GetReader(uri, t_adjust, reader_type=None):
if
uri
.
endswith
(
".ncml"
):
reader_type
=
"NcML"
elif
os
.
path
.
isdir
(
uri
):
reader_type
=
"Directory"
# directory reading directly is no longer supported please use NCML file to define directory
#reader_type = "Directory"
logger
.
error
(
"Directory Reading is no longer supported without using NCML file to define location"
)
raise
Exception
(
"Directory Reading is no longer supported without using NCML file to define location"
)
else
:
print
(
"Error input should be a NcML file
or URL or a Local directory
"
)
r
eturn
None
logger
.
error
(
"Error input
:
should be a NcML file"
)
r
aise
Exception
(
"Error input: should be a NcML file"
)
if
reader_type
==
"NcML"
:
return
NcMLReader
(
uri
,
t_adjust
)
else
:
return
DirectoryReader
(
uri
,
t_adjust
)
logger
.
error
(
"Directory Reading is no longer supported without using NCML file to define location"
)
raise
Exception
(
"Directory Reading is no longer supported without using NCML file to define location"
)
#return DirectoryReader(uri, t_adjust)
class
NetCDFFile
(
object
):
...
...
This diff is collapsed.
Click to expand it.
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