Skip to content
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

Merged
merged 29 commits into from
Oct 4, 2022
Merged

Gb/bc #96

merged 29 commits into from
Oct 4, 2022

Conversation

grantbuster
Copy link
Member

No description provided.

… active domain to alleviate the nearest neighbor seams
@grantbuster grantbuster requested a review from bnb32 October 4, 2022 14:54
Distance in decimal degrees from coord to bias gid
"""
d, i = self.bias_tree.query(coord)
bias_gid = self.bias_gid_raster.flatten()[i]
Copy link
Collaborator

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?

Copy link
Member Author

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.

Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope its infinite haha

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lol


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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit for local method

Copy link
Member Author

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
Copy link
Collaborator

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.

Copy link
Member Author

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

Copy link
Collaborator

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)
Copy link
Collaborator

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

Copy link
Member Author

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

Copy link
Collaborator

@bnb32 bnb32 left a 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

@grantbuster grantbuster merged commit bf15a24 into main Oct 4, 2022
github-actions bot pushed a commit that referenced this pull request Oct 4, 2022
@grantbuster grantbuster deleted the gb/bc branch October 27, 2022 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants