tsherwen / AC_tools

Module for working with global/regional Chemical Transport Model (CTM) output and observations
MIT License
12 stars 10 forks source link

re-write convert_to_netCDF to deal with directories with more that one file type #67

Closed tsherwen closed 7 years ago

tsherwen commented 7 years ago

Currently convert_to_netCDF will not work on directories that contain a mixture of timestptamp files (ts.bpch), ctm output (ctm.bpch or trac*), HEMCO etc. This should be updated to process only the file type that convert_to_netCDF is called for and have a option to process all output.

BenNewsome commented 7 years ago

I am not sure I follow.

Are you saying the convert_to_netCDF does not work if you have say 201202.bpch and a file called ctm.bpch in the same folder?

tsherwen commented 7 years ago

Yes. So I think using a glob.glob call to make lists of the difference file types would be a good idea. I think default behavior should be to process the file type called for (e.g. ctm.bpch), but an option should be there to try and process all file types.

On 10 November 2016 at 13:27, Ben Newsome notifications@github.com wrote:

I am not sure I follow.

Are you saying the convert_to_netCDF does not work if you have say 201202.bpch and a file called ctm.bpch in the same folder?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tsherwen/AC_tools/issues/67#issuecomment-259689459, or mute the thread https://github.com/notifications/unsubscribe-auth/AEeGjEX8w4focVs4zGKpYfSdF_dxeFBIks5q8xu8gaJpZM4KtgJI .

Dr Tomás Sherwen Postdoctoral Research Associate

Wolfson Atmospheric Chemistry Laboratories (WACL) Department of Chemistry, University of York Heslington, York, YO10 5DD Office phone (shared): +44(0)1904 324758 Homepage: https://www.york.ac.uk/chemistry/staff/resstaff/sherwent/ tomas.sherwen@york.ac.uk [image: tomas.sherwen] http://orcid.org/0000-0002-3006-3876 https://scholar.google.co.uk/citations?user=e3SmNJoAAAAJ&hl

BenNewsome commented 7 years ago

Updated to allow filetype to be specified (So you can do ' .ctm.bpch' or ' .bpch')

Not tested properly, but it should work with whatever format you like.