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

Import example chamber data #404

Merged
merged 9 commits into from
Nov 22, 2023
Merged

Import example chamber data #404

merged 9 commits into from
Nov 22, 2023

Conversation

Gorkowski
Copy link
Collaborator

@Gorkowski Gorkowski commented Nov 21, 2023

Fixes #403

  • add data filtering
  • relative time calc

@Gorkowski Gorkowski marked this pull request as draft November 21, 2023 01:54
Copy link

github-actions bot commented Nov 21, 2023

PR Preview Action v1.4.4
🚀 Deployed preview to https://uncscode.github.io/particula/pr-preview/pr-404/
on branch gh-pages at 2023-11-22 15:19 UTC

@Gorkowski Gorkowski marked this pull request as ready for review November 22, 2023 01:40
@Gorkowski
Copy link
Collaborator Author

@ngmahfouz part 1 of chamber analysis done.
Load and clean the data notebook.

Copy link
Collaborator

@ngmahfouz ngmahfouz left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks! I left some minor comments, but we can address them later. Thanks for adding the tests :)

Two more general thoughts for later:

  • We probably should make use of pandas or xarray for these time analyses at some point in the future; we can assess later
  • We should likely a plotting class or functionality at some point as well

particula/util/convert.py Show resolved Hide resolved
docs/examples/chamber_smps_data.ipynb Outdated Show resolved Hide resolved
@Gorkowski
Copy link
Collaborator Author

Interesting this doesn't happen automatically... I thought it would

me too. I just asked gpt, and numpy only will auto add the dim to the left. "For example, if you have a 2D array A with shape (3,4) and you want to multiply it by a 1D array B with shape (4,), NumPy will automatically broadcast B to have a shape of (1,4), and then stretch it to match the shape of A for the multiplication."

If A has a shape of (3, 50) and B has a shape of (3,), NumPy broadcasting will not be able to automatically align and broadcast these arrays for element-wise operations like multiplication, because their dimensions do not align properly according to the broadcasting rules.

In broadcasting, the trailing dimensions of the arrays are compared, and one of the dimensions has to be 1 for broadcasting to occur. In this case:

A has a shape of (3, 50).
B has a shape of (3,).
When attempting to align these shapes, we get:

(3, 50)
(3, )
The last dimensions (50 from A and the implicit 1 from B) are not compatible because neither is 1 nor are they equal. Therefore, a broadcasting error will occur if you try to directly multiply A and B.

To perform element-wise multiplication between A and B, you would need to reshape B so that it has a compatible shape. For instance, if you want to multiply each row of A by B, you can reshape B to have a shape of (3, 1).

@Gorkowski Gorkowski added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit 69466c4 Nov 22, 2023
10 checks passed
@Gorkowski Gorkowski deleted the Gorkowski/issue403 branch November 22, 2023 15:20
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.

Import example chamber data
2 participants