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

Create a script or function to remove timeseries #7

Open
MartinDix opened this issue Oct 28, 2024 · 2 comments
Open

Create a script or function to remove timeseries #7

MartinDix opened this issue Oct 28, 2024 · 2 comments
Assignees

Comments

@MartinDix
Copy link
Contributor

Mule has problems reading timeseries in fieldsfiles. Would be better to have a separate function to remove these?

Something similar to um_fields_subset.py or something mule_based (if the read error can be trapped and handled).

@leoberhelman leoberhelman self-assigned this Oct 29, 2024
@leoberhelman
Copy link
Contributor

leoberhelman commented Oct 30, 2024

@MartinDix I am having a look at where using mule in perturbIC specifically would fail and the error could be caught for if someone doesn't remove the timeseries, with the goal to try to catch the error if someone attempts to use this code with out stripping the timeseries data.
ifile is the rstart file
ff = mule.FieldsFile.from_file(args.ifile)
for ifield, field in enumerate(ff.fields):
#Find surface temp
if field.lbuser4 == 24:
print(field.get_data())

The warning is
Incorrect dataset_type (found 1, should be one of (3,))
warnings.warn(msg)
I see that this warning traces back to the same error that Martin got in Issue #8

leoberhelman added a commit that referenced this issue Oct 31, 2024
Currently is producing a validation error attached to Issue #7 #8 I have implemented mule here with the intention of adding a pre-step to strip out the time series
@MartinDix
Copy link
Contributor Author

Demo script https://github.com/ACCESS-NRI/umfile_utils/blob/7-remove-timeseries/src/remove_timeseries_demo.py

When run with /g/data/vk83/configurations/inputs/access-esm1p5/modern/pre-industrial/restart/atmosphere/PI-02.astart-01010101 it removes the timeseries ok but writing the new file fails because of validation of the river fields #8

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