Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pyautoplot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Astronomy and Operations
SDC Operations
pyautoplot
Commits
ded40054
Commit
ded40054
authored
11 years ago
by
Michiel Brentjens
Browse files
Options
Downloads
Patches
Plain Diff
Added extra logging to map_casa_table()
parent
bb69e83f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyautoplot/utilities.py
+4
-2
4 additions, 2 deletions
pyautoplot/utilities.py
with
4 additions
and
2 deletions
pyautoplot/utilities.py
+
4
−
2
View file @
ded40054
import
os
,
sys
import
os
,
sys
from
numpy
import
isnan
,
concatenate
,
arange
from
numpy
import
isnan
,
concatenate
,
arange
import
ma
import
ma
import
logging
def
is_list
(
obj
):
def
is_list
(
obj
):
return
type
(
obj
)
==
type
([])
return
type
(
obj
)
==
type
([])
...
@@ -15,6 +16,7 @@ def set_nan_zero(data_array):
...
@@ -15,6 +16,7 @@ def set_nan_zero(data_array):
"""
"""
Set any NaN values in *data_array* to zero and return result. This function modifies *data_array*.
Set any NaN values in *data_array* to zero and return result. This function modifies *data_array*.
"""
"""
logging
.
debug
(
'
pyautoplot.utilities.set_nan_zero(%r)
'
,
data_array
.
shape
)
where_it_is_nan
=
isnan
(
data_array
)
where_it_is_nan
=
isnan
(
data_array
)
if
is_masked_array
(
data_array
):
if
is_masked_array
(
data_array
):
data_array
.
mask
[
where_it_is_nan
]
=
True
data_array
.
mask
[
where_it_is_nan
]
=
True
...
@@ -45,11 +47,11 @@ def map_casa_table(function, casa_table, column_name='DATA', flag_name='FLAG', c
...
@@ -45,11 +47,11 @@ def map_casa_table(function, casa_table, column_name='DATA', flag_name='FLAG', c
if
max_chunks
:
if
max_chunks
:
if
chunk
>=
max_chunks
:
if
chunk
>=
max_chunks
:
break
break
print
(
'
%d -- %d / %d
'
%
(
chunk
*
chunksize
+
1
,
(
chunk
+
1
)
*
chunksize
,
nrows
)
)
logging
.
info
(
'
%d -- %d / %d
'
,
chunk
*
chunksize
+
1
,
(
chunk
+
1
)
*
chunksize
,
nrows
)
results
+=
[
function
(
set_nan_zero
(
ma
.
array
(
selection
.
getcol
(
column_name
,
startrow
=
chunk
*
chunksize
,
nrow
=
chunksize
),
results
+=
[
function
(
set_nan_zero
(
ma
.
array
(
selection
.
getcol
(
column_name
,
startrow
=
chunk
*
chunksize
,
nrow
=
chunksize
),
mask
=
selection
.
getcol
(
flag_name
,
startrow
=
chunk
*
chunksize
,
nrow
=
chunksize
))))]
mask
=
selection
.
getcol
(
flag_name
,
startrow
=
chunk
*
chunksize
,
nrow
=
chunksize
))))]
if
max_chunks
is
None
or
(
chunk
==
max_chunks
-
1
):
if
max_chunks
is
None
or
(
chunk
==
max_chunks
-
1
):
print
(
'
%d -- %d / %d
'
%
(
complete_chunks
*
chunksize
+
1
,
nrows
,
nrows
)
)
logging
.
info
(
'
%d -- %d / %d
'
,
complete_chunks
*
chunksize
+
1
,
nrows
,
nrows
)
results
+=
[
function
(
set_nan_zero
(
ma
.
array
(
selection
.
getcol
(
column_name
,
startrow
=
complete_chunks
*
chunksize
,
nrow
=
lastset
),
results
+=
[
function
(
set_nan_zero
(
ma
.
array
(
selection
.
getcol
(
column_name
,
startrow
=
complete_chunks
*
chunksize
,
nrow
=
lastset
),
mask
=
selection
.
getcol
(
flag_name
,
startrow
=
complete_chunks
*
chunksize
,
nrow
=
lastset
))))]
mask
=
selection
.
getcol
(
flag_name
,
startrow
=
complete_chunks
*
chunksize
,
nrow
=
lastset
))))]
return
concatenate
(
results
,
axis
=
0
)
return
concatenate
(
results
,
axis
=
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment