Size Distribution #978
Replies: 4 comments 2 replies
-
|
Hi @vperraud-design , thanks for sharing the code and files used. I can take a look and see if I can find the issue. |
Beta Was this translation helpful? Give feedback.
-
|
I was able to reproduce the error, just trying to figure out the cause. I compared the time coordinates etc between datasets as well as the plotting variables, but so far can't find a difference between the working on non working datasets. Will keep digging. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Zach,
Thank you so much for taking the time to look at this for us!
Let me know if you need any other input.
Best,
Vero.
…On Tue, Jan 13, 2026 at 1:43 PM Zach Sherman ***@***.***> wrote:
I was able to reproduce the error, just trying to figure out the cause. I
compared the time coordinates etc between datasets as well as the plotting
variables, but so far can't find a difference between the working on non
working datasets. Will keep digging.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/ARM-DOE/ACT/discussions/978*discussioncomment-15489828__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!LSR1TWzwkt67U7-9dlaldY1Mu8omElJENwiTC9YNrV2llk6uOtUjYFKmua0j6fc3F74HZOrc9Xe1i6H6JJLff1Be$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/B4WJNSXFJS4LLJNFJGCR75L4GVRHVAVCNFSM6AAAAACRPSRFVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKNBYHE4DEOA__;!!CzAuKJ42GuquVTTmVmPViYEvSg!LSR1TWzwkt67U7-9dlaldY1Mu8omElJENwiTC9YNrV2llk6uOtUjYFKmua0j6fc3F74HZOrc9Xe1i6H6JHnBmqkx$>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
@vperraud-design I think I found the issue, I believe how we were handling times in distributiondisplay, we were removing times if a field value had a nan so when the plotting routine would retrieve the data using the index the times were being removed, however we wouldnt want to remove a time if we had nans in one field but not another. #979 should fix the issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have this code that extracts and plot 2D size distributions from the Bankhead National Forest Station dataset. It works really well for the BNF site, however, I systematically get an error when I try to apply it to a different sites (for example SGP or EPCAPE). Could you help with sourcing the problem? (Note: I am able to plot different plots from the SGP and EPCAPE site from that same smps file (like a time series), but somehow the time index is not computing for SGP and EPCAPE). I am posting the code below to help troubleshooting.
Code For BNF (works):
import matplotlib.pyplot as plt
import numpy as np
import act
""Read the smps data (I will have uploaded it to my directory)""
smps_ds = act.io.arm.read_arm_netcdf('bnfaossmpsM1.b1.20260101.000459.nc')
""Clean up the data""
smps_ds.clean.cleanup()
""Create a DistributionDisplay object""
display = act.plotting.DistributionDisplay(smps_ds, figsize=(10, 5))
""Create a size distribution plot at a specific time""
t_ind = np.datetime64('2026-01-01T00:00:00')
display.plot_size_distribution('dN_dlogDp', 'diameter_mobility', set_title='Size Distribution (Jan 01, 2026)', time=t_ind, subplot_index=(0,), label='00h00')
display.set_xrng([10,800])
plt.xscale('log')
plt.legend(loc="upper right")
Same code For SGP (but this time, it doesn't work):
import matplotlib.pyplot as plt
import numpy as np
import act
""Read the smps data (I will have uploaded it to my directory)""
smps_ds = act.io.arm.read_arm_netcdf('epcaossmpsM1.b1.20230501.000000.nc')
""Clean up the data""
smps_ds.clean.cleanup()
""Create a DistributionDisplay object""
display = act.plotting.DistributionDisplay(smps_ds, figsize=(10, 5))
""Create a size distribution plot at a specific time""
t_ind = np.datetime64('2023-05-01T00:00:00')
display.plot_size_distribution('dN_dlogDp', 'diameter_mobility', set_title='Size Distribution (May 01, 2023)', time=t_ind, subplot_index=(0,), label='00h00')
display.set_xrng([10,800])
plt.xscale('log')
plt.legend(loc="upper right")
=> Key error: "not all values found in index 'time'"
(time=t_ind seems to be the problem, but it works in the code above)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions