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

output filename conform to DRS filename convention #69

Open
nilshempelmann opened this issue Jan 27, 2020 · 9 comments · Fixed by #86 or #104
Open

output filename conform to DRS filename convention #69

nilshempelmann opened this issue Jan 27, 2020 · 9 comments · Fixed by #86 or #104
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nilshempelmann
Copy link
Member

Set output filename

output is given as:
outputs/2f91fe3a-3f5d-11ea-a7e1-9cb6d08a53e7/out.nc'

Suggestion: use eggshell:
https://eggshell.readthedocs.io/en/latest/_modules/eggshell/nc/nc_utils.html#drs_filename

@nilshempelmann nilshempelmann added the enhancement New feature or request label Jan 27, 2020
@davidcaron davidcaron added this to the 0.4.0 milestone Feb 17, 2020
@davidcaron davidcaron self-assigned this Feb 17, 2020
@nilshempelmann
Copy link
Member Author

indices filename contains wrong frequency.
an indice calculated with frq='YS' should have _yr_ in the filename but finch keeps the original _day_.
related to:
#80
Ouranosinc/xclim#368

@nilshempelmann
Copy link
Member Author

driving model is repeated in filename:
_MPI-M-MPI-ESM-MRMPI-M-MPI-ESM-MR_

@nilshempelmann
Copy link
Member Author

rename indice file tg_mean to tg-mean. underscore is the seperator of the DRS elements

@davidcaron
Copy link
Collaborator

driving model is repeated in filename:
MPI-M-MPI-ESM-MRMPI-M-MPI-ESM-MR

Could you help me recreate this? I'm not sure in which case this can happen.

@nilshempelmann
Copy link
Member Author

It happened while calculating the indices:
In [44], In [45]. but its overwritten meanwhile.
https://github.com/nilshempelmann/NAP_Niger/blob/master/indices_calculation.ipynb

@davidcaron
Copy link
Collaborator

I'm not sure how it could do this in finch... unless I'm missing something, the only remaining way I see for this to happen is if this string is inside the source dataset's driving_model_id.

@nilshempelmann
Copy link
Member Author

it repeated the RCM as well:
e.g.:
prcptot_AFR-22_MPI-M-MPI-ESM-MRMPI-M-MPI-ESM-MR_historical_r1i1p1_ICTP-RegCM4-7-0ICTP-RegCM4-7_v0_day_19700101-20050101.nc

you are right: its an error of the file:
:driving_model_id = "MPI-M-MPI-ESM-MRMPI-M-MPI-ESM-MR"
:model_id = "ICTP-RegCM4-7-0ICTP-RegCM4-7"
made by: :contact = "Canadian Centre for Climate Services"

I ll check the other files where it happened and send you per mail.

@nilshempelmann
Copy link
Member Author

not receiving the DRS names for CMIP6 file outputs

data/indices/out.nc.
data/indices/out-1.nc.
data/indices/out-2.nc.
data/indices/out-3.nc.
data/indices/out-4.nc.
data/indices/out-5.nc.

@nilshempelmann nilshempelmann reopened this Jul 9, 2020
@aulemahal
Copy link
Collaborator

There are specific cases for CORDEX, EOBS and CMIP5. All other cases (including CMIP6), should be covered by

else:
params = [
variable,
ds.attrs.get("frequency"),
ds.attrs.get("model_id"),
ds.attrs.get("driving_model_id"),
ds.attrs.get("experiment_id", "").replace(",", "+"),
ds.attrs.get("driving_experiment_id", "").replace(",", "+"),
]
params = [k for k in params if k]
filename = "_".join(params)

But the filename defaults to out if there was an error. I think what is missing here is a warning about why an error was encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants