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

msnoise cc stack -m errors #320

Closed
asyates opened this issue Jan 24, 2024 · 2 comments
Closed

msnoise cc stack -m errors #320

asyates opened this issue Jan 24, 2024 · 2 comments

Comments

@asyates
Copy link
Contributor

asyates commented Jan 24, 2024

When running msnoise cc stack -m, i found it was trying to stack pairs that were not configured and therefore did not have 001 day files. For example, with:

components_to_compute                  | ZZ 
components_to_compute_single_station   | EN,EZ,NZ

i get the error as it tries to stack data between EN component of a station-pair:

2024-01-24 10:59:05.522355 msnoise [pid 151361][INFO]: There are STACKS jobs for some days to recompute for NZ.WIZ.10:NZ.WSRZ.10
2024-01-24 10:59:05.523885 msnoise [pid 151361][INFO]: Processing NZ.WIZ.10:NZ.WSRZ.10-EN-1
Traceback (most recent call last):
  File "/home/yatesal/.local/bin/msnoise", line 8, in <module>
    sys.exit(run())
  File "/home/yatesal/.local/lib/python3.8/site-packages/msnoise/scripts/msnoise.py", line 1519, in run
    cli(obj={})
  File "/home/yatesal/.local/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
    
    ...
    
     File "/home/yatesal/.local/lib/python3.8/site-packages/xarray/coding/times.py", line 240, in decode_cf_datetime
    dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar)
  File "/home/yatesal/.local/lib/python3.8/site-packages/xarray/coding/times.py", line 196, in _decode_datetime_with_pandas
    pd.to_timedelta(flat_num_dates.min(), delta) + ref_date
  File "/home/yatesal/.local/lib/python3.8/site-packages/numpy/core/_methods.py", line 45, in _amin
    return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Assume a relatively quick fix (i.e. to check components_to_compute parameter), but haven't had time to look at the code yet.

@asyates
Copy link
Contributor Author

asyates commented Jan 31, 2024

Okay, that error message was actually fixed following downgrading of pandas following #318 .

Re. 'processing' non-configured pairs, I guess this is actually expected behaviour since the loop in stacking procedure is using params.all_components, which includes both components_to_compute and components_to_compute_single_station. The non-configured components then just return an error due to missing data .

e.g. in code below, errors are thrown for non-configured pairs (ZZ for AC), with no error for cross-components:

2024-01-24 12:15:03.456764 msnoise [pid 154782][INFO]: Processing NZ.WIZ.10:NZ.WIZ.10-ZZ-1
2024-01-24 12:15:03.476378 msnoise [pid 154782][ERROR]: not enough data for mov_stack=5
2024-01-24 12:15:03.476483 msnoise [pid 154782][ERROR]: not enough data for mov_stack=10
2024-01-24 12:15:03.477680 msnoise [pid 154782][INFO]: Processing NZ.WIZ.10:NZ.WIZ.10-EN-2
2024-01-24 12:15:03.647373 msnoise [pid 154782][INFO]: Processing NZ.WIZ.10:NZ.WIZ.10-EZ-2

Similar errors at other stages:

2024-01-24 12:16:26.105068 msnoise [pid 154903][INFO]: *** Starting: Compute MWCS ***
2024-01-24 12:16:31.124267 msnoise [pid 154903][INFO]: There are MWCS jobs for some days to recompute for NZ.WIZ.10:NZ.WIZ.10
2024-01-24 12:16:45.651087 msnoise [pid 154903][ERROR]: FILE DOES NOT EXIST: STACKS2/01/005_DAYS/ZZ/NZ.WIZ.10_NZ.WIZ.10.nc, skipping
2024-01-24 12:16:45.651168 msnoise [pid 154903][ERROR]: FILE DOES NOT EXIST: STACKS2/01/010_DAYS/ZZ/NZ.WIZ.10_NZ.WIZ.10.nc, skipping
2024-01-24 12:17:03.108262 msnoise [pid 154903][ERROR]: FILE DOES NOT EXIST: STACKS2/02/005_DAYS/ZZ/NZ.WIZ.10_NZ.WIZ.10.nc, skipping
2024-01-24 12:17:03.108353 msnoise [pid 154903][ERROR]: FILE DOES NOT EXIST: STACKS2/02/010_DAYS/ZZ/NZ.WIZ.10_NZ.WIZ.10.nc, skipping

think i'll try make a small modification to make a check to not output errors for non-configured components, because it makes it pretty confusing (gave my impression that it wasn't functioning correctly).

@asyates asyates changed the title msnoise cc stack -m processing non-configured pairs msnoise cc stack -m processing errors Jan 31, 2024
@asyates asyates changed the title msnoise cc stack -m processing errors msnoise cc stack -m errors Jan 31, 2024
@ThomasLecocq
Copy link
Member

solved with #321 , thanks !

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

2 participants