-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gb/bc #96
Gb/bc #96
Conversation
…simple integration into the forward pass
… active domain to alleviate the nearest neighbor seams
…d into fwp and qa
…n for new bc and windstats modules
Distance in decimal degrees from coord to bias gid | ||
""" | ||
d, i = self.bias_tree.query(coord) | ||
bias_gid = self.bias_gid_raster.flatten()[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a check that the index is in the raster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no distance threshold on this method so i
should always be in the gid raster. I don't include a distance threshold because this is just a convenience method for debugging and investigation, not used in the actual bc module in a pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no default threshold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope its infinite haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh lol
sup3r/bias/bias_transforms.py
Outdated
|
||
def local_linear_bc(input, feature_name, bias_fp, lr_padded_slice, | ||
out_range=None): | ||
"""Bias correct data using a simple global *scalar +adder method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit for local method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like site-by-site, right? yes, good catch
except Exception as e: | ||
msg = ('Sup3r ForwardPass chunk failed!') | ||
logger.exception(msg) | ||
raise RuntimeError(msg) from e | ||
|
||
@classmethod | ||
def run(cls, strategy, node_index): | ||
"""This routine runs forward passes on all spatiotemporal chunks for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we lost part of the doc string here think. *for the given node index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh man oops, either a merge conflict or me fat fingering with vim haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol no prob
v_true = self.source_handler.data[..., v_idf] | ||
u_true = self.bias_correct_source_data(u_true, u_feat) | ||
v_true = self.bias_correct_source_data(v_true, v_feat) | ||
data_true = np.hypot(u_true, v_true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always learn about new numpy methods reading your code lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like this one even though it seems trivial, avoids silly errors like a single * instead of power **. I also thought you showed me this but maybe not haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of good work here
No description provided.