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

Adding patch_inference.py #21

Merged
merged 2 commits into from
Aug 21, 2020
Merged

Adding patch_inference.py #21

merged 2 commits into from
Aug 21, 2020

Conversation

petzb
Copy link
Collaborator

@petzb petzb commented Aug 10, 2020

No description provided.

Copy link
Collaborator

@djgagne djgagne left a comment

Choose a reason for hiding this comment

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

The code generally looks good. One thing I would like to see included is reshaping the data into the GLM grid dimensions before outputting to CSV. The overall workflow would be:

  1. Extract ABI patches at each GLM grid cell at a given time and save those to netCDF.
  2. Feed the patches into the inference script and generate predictions for each patch that are then reshaped into the GLM grid dimension.
  3. Output the gridded predictions to netCDF.

print("Performing inference",flush=True)
y_hat = model.predict(abi_data)

y_hat = y_hat.reshape((len(y_hat),))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to reshape the predictions into the shape of the GLM grid the patches are derived from instead of leaving it as a 1D vector?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I've reshaped the output to match the dimensions and format of the GLM nc files.

Copy link
Collaborator

@djgagne djgagne left a comment

Choose a reason for hiding this comment

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

The new reshaping looks good. Merging.

@djgagne djgagne merged commit 56d5bea into master Aug 21, 2020
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.

2 participants