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

Write output separately for each year #250

Open
133040028 opened this issue Feb 1, 2022 · 7 comments
Open

Write output separately for each year #250

133040028 opened this issue Feb 1, 2022 · 7 comments

Comments

@133040028
Copy link

Hi,
I am using MetSim to generate input files for VIC 5 image. It requires forcing yearwise. I could successfully run the MetSim package for my study region. However, the output is generated for entire 17 years which is my simulation period (which is a huge file!). Is there any way to write the output yearwise? I could see 'time_grouper:: str' in the documentation. I am not sure how to use it.

@arbennett
Copy link
Member

Hi! Sorry for the far delayed response, but yes you should be able to use the time_grouper configuration for this purpose. If you are using the YAML configuration style this would just appear like:

MetSim:
    # Other settings...
    time_grouper: '1AS'

The {x}AS syntax derives from older versions of Pandas groupby operations for yearly aggregation. Newer syntax such as doing something like time_grouper: '1year' may also work but this hasn't been tested.

@yzhou65jhu
Copy link

Hi! I'm trying to run metsim in bash and to use the time grouper in the configure file, but it doesn't seem to work. I just put "time_grouper = 1AS" under the 'MetSim' section, but metsim writes output for my entire period, which is 2 years.

@133040028
Copy link
Author

Hi,
For me, "out_freq = 1Y" worked. Can you please check if it works for you.

@yzhou65jhu
Copy link

Thanks @133040028 . It works! That just saved me a lot of time!

@dwoodson-usbr
Copy link

@arbennett Following up on this question - is there any way to specify multiple input forcing .nc files for MetSim? E.g. for running MetSim on daily data spanning 50-years, with 1 .nc for each year, it seems like all 50 .nc files must be stacked into one .nc file, then run through MetSim, is there any way to reference all 50 .nc files separately (or the directory they live in) as forcing inputs?

@arbennett
Copy link
Member

@dwoodson-usbr - you should be able to use the * notation in the input files. So if your data has a naming scheme like forcing_year.nc you should be able to give the forcing entry as forcing_*.nc in the configuration.

@dwoodson-usbr
Copy link

Makes sense, thanks @arbennett !

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

4 participants