Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111283202
check_files.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Apr 30, 13:54
Size
1 KB
Mime Type
text/x-python
Expires
Fri, May 2, 13:54 (2 d)
Engine
blob
Format
Raw Data
Handle
25888344
Attached To
R8800 solar_potential
check_files.py
View Options
import
xarray
as
xr
import
sys
import
os
fileDir
=
sys
.
argv
[
1
]
batches
=
int
(
sys
.
argv
[
2
])
for
batch
in
range
(
batches
):
print
(
batch
)
poa_fp
=
os
.
path
.
join
(
fileDir
,
'poa_irradiance_
%d
.nc'
%
batch
)
irrad_fp
=
os
.
path
.
join
(
fileDir
,
'tilted_irrad_
%d
.nc'
%
batch
)
pvPot_fp
=
os
.
path
.
join
(
fileDir
,
'pv_potential_
%d
.nc'
%
batch
)
try
:
irrad
=
xr
.
open_dataset
(
irrad_fp
)
poa
=
xr
.
open_dataset
(
poa_fp
)
if
irrad
.
yearly_kWh_m2
.
sum
()
==
0
:
print
(
'ERROR in
%s
'
%
irrad_fp
)
irrad
.
close
()
poa
.
close
()
os
.
system
(
'python compute_tilted_irrad_batch.py
%s
%s
'
%
(
poa_fp
,
irrad_fp
))
except
:
print
(
'Cannot open
%s
or
%s
'
%
(
poa_fp
,
irrad_fp
))
continue
try
:
pvPot
=
xr
.
open_dataset
(
pvPot_fp
)
except
:
print
(
'Cannot open
%s
'
%
pvPot_fp
)
continue
if
pvPot
.
yearly_PV_kWh
.
sum
()
>
0
:
continue
print
(
'ERROR in
%s
'
%
pvPot_fp
)
pvPot
.
close
()
os
.
system
(
'python compute_PV_output_batch.py
%s
%s
'
%
(
irrad_fp
,
pvPot_fp
))
Event Timeline
Log In to Comment