Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
UW-Glance
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eva Schiffer
UW-Glance
Commits
9579c4fd
Commit
9579c4fd
authored
9 years ago
by
Eva Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
fixing an bug with how errors propagate from problems in image creation
parent
df9b361f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyglance/glance/figures.py
+2
-2
2 additions, 2 deletions
pyglance/glance/figures.py
pyglance/glance/io.py
+5
-4
5 additions, 4 deletions
pyglance/glance/io.py
pyglance/glance/plot.py
+8
-4
8 additions, 4 deletions
pyglance/glance/plot.py
with
15 additions
and
10 deletions
pyglance/glance/figures.py
+
2
−
2
View file @
9579c4fd
...
...
@@ -78,8 +78,8 @@ def _make_range(data_a, valid_a_mask, num_intervals, offset_to_range=0.0, data_b
minVal
=
min
(
delta
.
min_with_mask
(
data_b
,
valid_b_mask
),
minVal
)
maxVal
=
max
(
delta
.
max_with_mask
(
data_b
,
valid_b_mask
),
maxVal
)
minVal
=
minVal
-
offset_to_range
maxVal
=
maxVal
+
offset_to_range
minVal
-
=
offset_to_range
maxVal
+
=
offset_to_range
return
np
.
linspace
(
minVal
,
maxVal
,
num_intervals
)
...
...
This diff is collapsed.
Click to expand it.
pyglance/glance/io.py
+
5
−
4
View file @
9579c4fd
...
...
@@ -420,11 +420,9 @@ class nc (object):
# get our raw data and scaling info
variable_object
=
self
.
get_variable_object
(
name
)
#print ("*** opened variable: " + name)
"""
# This scaling code is no longer required because the library automatically handles scaling
raw_data_copy = variable_object[:]
# load the scale factor and add offset
temp = self.attributeCache.get_variable_attributes(name)
if SCALE_FACTOR_STR in temp.keys() :
scale_factor = temp[SCALE_FACTOR_STR]
...
...
@@ -443,8 +441,11 @@ class nc (object):
# create the scaled version of the data
scaled_data_copy = np.array(raw_data_copy, dtype=data_type)
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] * scale_factor) + add_offset #TODO, type truncation issues?
"""
return
scaled_data_copy
scaled_data_copy
=
np
.
array
(
variable_object
[:],
dtype
=
data_type
)
return
scaled_data_copy
# TODO, this hasn't been supported in other file types
def
close
(
self
)
:
...
...
This diff is collapsed.
Click to expand it.
pyglance/glance/plot.py
+
8
−
4
View file @
9579c4fd
...
...
@@ -329,10 +329,14 @@ def plot_and_save_comparison_figures (aData, bData,
# only plot the compared images if we aren't short circuiting them
if
(
outputInfoList
is
not
compared_images
)
or
(
not
shortCircuitComparisons
)
:
_log_spawn_and_wait_if_needed
(
figLongDesc
,
childPids
,
figFunction
,
outputPath
,
figFileName
,
makeSmall
,
doFork
,
shouldClearMemoryWithThreads
,
fullDPI
=
fullDPI
,
thumbDPI
=
thumbDPI
)
# if we made an attempt to make the file, hang onto the name
outputInfoList
.
append
(
figFileName
)
try
:
_log_spawn_and_wait_if_needed
(
figLongDesc
,
childPids
,
figFunction
,
outputPath
,
figFileName
,
makeSmall
,
doFork
,
shouldClearMemoryWithThreads
,
fullDPI
=
fullDPI
,
thumbDPI
=
thumbDPI
)
# if we made an attempt to make the file, hang onto the name
outputInfoList
.
append
(
figFileName
)
except
ValueError
,
ve
:
LOG
.
warn
(
"
Unable to create
"
+
figDesc
+
"
figure for
"
+
variableDisplayName
+
"
:
"
+
str
(
ve
))
# now we need to wait for all of our child processes to terminate before returning
if
(
isParent
)
:
# just in case
...
...
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