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

Plot bleaching estimates with correct time and/or per volume units #96

Open
talonchandler opened this issue Aug 16, 2023 · 2 comments
Open

Comments

@talonchandler
Copy link
Contributor

The current estimate-bleaching routine looks for Interval_ms metadata which is not always present.

I'll propose that we make two changes to fix this issue:

  • change estimate-bleaching to read time scale with units from the .zarr metadata
  • change the update-scale-metadata utility to modify the scales and units for TZYX instead of just ZYX

This will allow us enough flexibility to plot in units of "per second" or "per volume", and it does not depend on iohub correct passing to time metadata which is planned for after the universal API.

@ieivanov
Copy link
Collaborator

Makes sense to me

@edyoshikun
Copy link
Contributor

adding to this, I just realized that a failure mode fo this is when dt gets parsed as 0.0 from the plate metadata. The default behavior should be 1.0 so that T*dt can still generate the array. Otherwise we get the following:

try:
    dt = np.float32(plate_zattrs['Summary']['Interval_ms'] / MSECS_PER_MINUTE)
except Exception as e:
    print(e)
    dt = 1
    warnings.warn(f"WARNING: missing time metadata for p={well_name}")
times = np.arange(0, T * dt, step=dt)
output_file = os.path.join(output_dirpath, well_name)
os.makedirs(output_file, exist_ok=True)

ValueError: arange: cannot compute length

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

No branches or pull requests

3 participants