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

Fix preprocess_interpolate_nc_to_bc.py #780

Open
veenstrajelmer opened this issue Feb 8, 2024 · 0 comments
Open

Fix preprocess_interpolate_nc_to_bc.py #780

veenstrajelmer opened this issue Feb 8, 2024 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Feb 8, 2024

The below code raises "OutOfRangeError: requested tstop 2012-04-01 12:00:00 outside of available range 2012-01-16 12:00:00 to 2012-03-16 12:00:00.". The timestep is available in the original dataset, but there is some odd timestepping (daily, but alternating midnight and midday). Either way, the time slicing is too tight for this usecase and it would be nice to resolve this to be backwards compatible.

MWE:

import os
import dfm_tools as dfmt

file_pli = r'p:\archivedprojects\11208054-004-dcsm-fm\models\model_input\bnd_cond\pli\DCSM-FM_OB_all_20181108.pli'
tstart = '2012-01-16 12:00'
tstop = '2012-04-01 12:00'
dir_sourcefiles_waq = r'p:\archivedprojects\11206304-futuremares-rawdata-preps\python_scripts\ocean_boundaryCMEMS\data_monthly'
dir_pattern = os.path.join(dir_sourcefiles_waq,'cmems_mod_glo_bgc_my_0.25_P1M-m_{ncvarname}_*.nc') 

#open regulargridDataset and do some basic stuff (time selection, renaming depth/lat/lon/varname, converting units, etc)
data_xr_vars = dfmt.open_dataset_extra(dir_pattern=dir_pattern, quantity='tracerbndNO3',
                                       tstart=tstart, tstop=tstop)

This issue might be related to #797

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

1 participant