|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
− | On this page, we list information about Python software packages that are being created for use with GEOS-Chem.
| + | #REDIRECT [[Python tools for use with GEOS-Chem]] |
− | | + | |
− | == Overview ==
| + | |
− | | + | |
− | Traditionally, GEOS-chem users have relied on IDL-based software, such as [http://acmg.seas.harvard.edu/gamap/ GAMAP], for data analysis and visualization. But to many GEOS-Chem user groups, the IDL software has become prohibitively expensive. Several members of the GEOS-Chem community have begun to develop file software programs in the Python language for reading, visualizing, and processing GEOS-Chem data. [http://www.python.org/ Python] is a free and open-source computer language that comes with several pre-packaged libraries for numerical computation and visualization.
| + | |
− | | + | |
− | Using Python software for visualizing/regridding/analyzing GEOS-Chem output also facilitates using GEOS-Chem in cloud-computing environments, such as the Amazon EC2 platform.
| + | |
− | | + | |
− | On this page we provide a list of Python software that is being developed for use with GEOS-Chem. For more information, please contact the individual authors listed below. If you are a GCHP user, see also the [[GEOS-Chem_HP_Output_Data#Data_Visualization_and_Post-Processing|GCHP data visualization and post-processing page]] for additional resources.
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:14, 24 April 2017 (UTC)
| + | |
− | | + | |
− | == Development Teams ==
| + | |
− | | + | |
− | Here is a list of Python visualizaton, file-management, and regridding software packages for GEOS-Chem. Some are still in a state of development, and as such, are not quite ready for widespread use yet.
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |- bgcolor="#CCCCCC" valign="top"
| + | |
− | !width="200px"|Developer
| + | |
− | !width="650px"|Packages/Description
| + | |
− | !width="250px"|Status
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |Jiawei Zhuang
| + | |
− | |Tutorial for using python with GEOS-Chem, including both binary and NetCDF output formats
| + | |
− | |[https://github.com/geoschem/GEOSChem-python-tutorial Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[[GEOS-Chem Support Team]]
| + | |
− | |[[#GCPy|GCPy]]: Benchmarking software for GEOS-Chem
| + | |
− | |[https://github.com/geoschem/gcpy Available on github] but not ready for deployment
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |Lizzie Lundgren
| + | |
− | |Example Jupyter notebooks that handle GCHP cubed sphere grid data using Jiawei Zhuang's [https://github.com/JiaweiZhuang/xESMF <tt>xESMF</tt>] and [https://github.com/JiaweiZhuang/cubedsphere cubedsphere] packages. Includes plotting and regridding both cubed sphere and lat-lon data.
| + | |
− | |[https://github.com/lizziel/geoschem_data_visualization Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[[User:darothen|Daniel Rothenberg]]
| + | |
− | |[[#xbpch|xbpch]]: Backend for reading bpch output into [http://xarray.pydata.org xarray]/[http://dask.pydata.org dask]
| + | |
− | |[https://github.com/darothen/xbpch Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[[User:barronh|Barron Henderson]]
| + | |
− | |Several software packages, including:
| + | |
− | #[[#PseudoNetCDF|PseudoNetCDF]]: a NetCDF like system including visualization (maps, profiles, timeseries, etc)
| + | |
− | #[[#Process analysis diagnostics|Process analysis diagnostics]]: A tool for examining the change in each species due to each process and reaction.
| + | |
− | |[https://github.com/barronh/pseudonetcdf Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[mailto:gerrit.kuhlmann@gmail.com Gerrit Kuhlmann]
| + | |
− | |[[#Gchem|Gchem]]: a reader/writer for bpch files
| + | |
− | |[https://github.com/gkuhl/gchem Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |Emanuel Mahieu<br>[mailto:bbovy@ulg.ac.be Benoit Bovy]
| + | |
− | |[[#PyGChem|PyGChem]] : a Python interface to GEOS-Chem (currently allows dataset handling using different backends - IO bpch/netCDF4, and will soon provide an interface to HEMCO).
| + | |
− | |[https://github.com/benbovy/PyGChem Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[mailto:frodre@gmail.com Andre Perkins]
| + | |
− | |[[#Python Ensemble Manager|Python Ensemble Manager]] for ensembles of GEOS-Chem adjoint simulations using MPI
| + | |
− | |[https://github.com/frodre/pyEnsemble Available on github]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | |[https://wacl.org.uk/students/ben-newsome/ Ben Newsome]
| + | |
− | |[[#Queuing script|Python script to split up GEOS-Chem simulations into smaller runs]]
| + | |
− | |[https://github.com/wacl-york/monthly_run Available on github]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | --[[User:Lizzie Lundgren|Lizzie Lundgren]] ([[User talk:Lizzie Lundgren|talk]]) 17:17, 31 August 2018 (UTC)
| + | |
− | | + | |
− | == Information about existing Python packages ==
| + | |
− | | + | |
− | === GCPy ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developers
| + | |
− | |width="600px"|'''Harvard:''' [[GEOS-Chem Support Team]], Sebastian Eastham, Jiawei Zhuang<br>'''MIT:''' Daniel Rothenberg<br>'''York:''' Killian Murphy, Tomás Sherwen<br>'''EPA:''' Barron Henderson
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Still in development, not quite ready for public consumption
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Description:'''''
| + | |
− | | + | |
− | The GEOS-Chem Support Team is developing the GCPy Python package for visualization and regridding of GEOS-Chem output in netCDF format. GCPy is being used to produce plots for the [[GEOS-Chem HP|GCHP]] benchmark simulations. GCPy development is still in the very early stages, and as such, it is not quite ready for public consumption. But we will be making improvements to GCPy in the near future and hope to have a more user-friendly version by the next GEOS-Chem public release. Stay tuned!!
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:46, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === xbpch ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developer
| + | |
− | |width="600px"|[[User:darothen|Daniel Rothenberg]] (MIT)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/darothen/xbpch <tt>https://github.com/darothen/xbpch</tt>]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Documentation
| + | |
− | |[http://xbpch.readthedocs.io/en/latest/ <tt>xbpch on readthedocs</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | | + | |
− | '''''Descripton:'''''
| + | |
− | | + | |
− | '''xbpch''' brings the power of a modern data analysis toolkit to bear on legacy GEOS-Chem output. Fundamentally, '''xbpch''' provides a backend to ingest bpch files via the [http://xarray.pydata.org xarray] package, an implementation of the NetCDF/Common Data Model for manipulating multi-dimensional array data in Python. By itself, xarray is a powerful tool for analyzing and manipulating the types of labeled datasets common in the geosciences. Additionally, '''xbpch''' wraps [http://dask.pydata.org dask], a flexible library for parallel computing. This combination of toolkits enables users to rapidly ingest, process, and visualize the largest model output datasets, even when they do not fit into memory on their laptop or cluster node.
| + | |
− | | + | |
− | Because bpch files are nearing their end-of-life, '''xbpch''' will not be expanded much further beyond:
| + | |
− | | + | |
− | * Enforcing CF-compliant metadata on ingested data
| + | |
− | * Incorporating command line utilities for high-performance conversion of bpch to NetCDF output
| + | |
− | | + | |
− | However, the advantage of having '''xbpch''' even in its current state is that users will be able to seamlessly shift between analyzing legacy GEOS-Chem output and new NetCDF output (in the near future) without changing more than a single line in their analysis pipeline or scripts.
| + | |
− | | + | |
− | Further documentation and examples will be added [http://xbpch.readthedocs.io/en/latest/ to the '''xbpch''' readthedocs page].
| + | |
− | | + | |
− | --[[User:Darothen|Darothen]] ([[User talk:Darothen|talk]]) 04:04, 25 April 2017 (UTC)
| + | |
− | | + | |
− | === PseudoNetCDF ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developer
| + | |
− | |width="600px"|[[User:barronh|Barron Henderson]] (US EPA, formerly U. Florida)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/barronh/pseudonetcdf <tt>https://github.com/barronh/pseudonetcdf</tt>]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Documentation
| + | |
− | |[https://github.com/barronh/pseudonetcdf/wiki/GC-Tutorials <tt>https://github.com/barronh/pseudonetcdf/wiki/GC-Tutorials</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Descripton:'''''
| + | |
− | | + | |
− | PseudoNetCDF supersedes the python bpch library. It has all the same functionality and much much more. There is a core library that can be used for all kinds of programming, and a series of utility scripts to make easy things easy. Evaluating GEOS-Chem against AQS observations, for example, takes three commands.
| + | |
− | | + | |
− | * Converts bpch to CF compliant NetCDF: <tt>pncgen -f bpch inpath outpath</tt>
| + | |
− | * View a lon/lat point: <tt>pncdump -f bpch --extract=-74,25 inpath</tt>
| + | |
− | * Make maps: <tt>pncmap.py -f bpch -r time,mean -s layer47,0 inpath outpath</tt>
| + | |
− | * Make profiles: <tt>pncvertprofile.py -f bpch -r time,mean -r latitude,mean -r longitude,mean inpath output</tt>
| + | |
− | * Evaluate against AQS: <tt>pncaqsraw4pnceval.py</tt> makes a netcdf file of AQS for comparison; <tt>pncgen -f bpch --extract file=aqs.nc</tt>
| + | |
− | * Create boundary conditions for CMAQ from GEOS-Chem output (i.e. supersedes the former <tt>pygeos2cmaq</tt> code)
| + | |
− | | + | |
− | The examples below use the benchmark run that was run for the [[GEOS-Chem_performance#7-day_time_tests|GEOS-Chem timing exercise]].
| + | |
− | | + | |
− | <tt>pncmap.py</tt> makes maps simply. Note that you can add states and counties or custom shapefiles.
| + | |
− | | + | |
− | $ pncmap.py -f "bpch,vertgrid='GEOS-5-NATIVE'" --norm="Normalize()" -v IJ-AVG-\$_O3 \
| + | |
− | -r time,mean -s layer72,0 trac_avg.geosfp_4x5_benchmark.201307010000 \
| + | |
− | pnc_trac_avg.geosfp_4x5_benchmark.20130701000_
| + | |
− | | + | |
− | [[Image:pnc_trac_avg.geosfp_4x5_benchmark.20130701000_IJ-AVG_O3.png|400px|pnc_trac_avg.geosfp_4x5_benchmark.20130701000_IJ-AVG_O3.png]]
| + | |
− | | + | |
− | <tt>pncvertprofile.py</tt> makes vertical profile plots and, optionally, can plot TES and/or OMI (not shown) for comparison. TES and/or OMI will be spatially subset automatically (good for ND51).
| + | |
− | | + | |
− | $ pncvertprofile.py -f "bpch,vertgrid='GEOS-5-NATIVE'" -v IJ-AVG-\$_O3 \
| + | |
− | -r time,mean trac_avg.geosfp_4x5_benchmark.201307010000 \
| + | |
− | --tes-paths=/path/to/tes/*.nc pnc_trac_avg.geosfp_4x5_benchmark.20130701000_pncprofile
| + | |
− | | + | |
− | [[Image:pnc_trac_avg.geosfp_4x5_benchmark.20130701000_pncprofile_IJ-AVG_O3.png|400px|pnc_trac_avg.geosfp_4x5_benchmark.20130701000_pncprofile_IJ-AVG_O3.png]]
| + | |
− | | + | |
− | Comparing GEOS-Chem to AQS observations (or other networks) can be done using three simple commands, you can evaluate GEOS-Chem against AQS observations
| + | |
− | | + | |
− | $ pncaqsraw4pnceval.py --param=44201 -s 2013-07-01 -e 2013-07-31 -r "1985-01-01 00:00:00" \
| + | |
− | --wktpolygon="POLYGON((-182.5 -90, 177.5 -90, 177.5 90, -182.5 90, -182.5 -90))"
| + | |
− | $ pncgen -O --extract-file="AQS_DATA_20130701-20130731.nc" -f "bpch,vertgrid='GEOS-5-NATIVE'" \
| + | |
− | -s layer72,0 trac_avg.geosfp_4x5_benchmark.201307010000 GC_AT_AQS.nc
| + | |
− | $ pnceval.py --funcs=MB,ME,NMB,NME -v Ozone -- -r time,mean AQS_DATA_20130701-20130731.nc \
| + | |
− | --sep --expr="Ozone=O3/1000." --rename=v,IJ-AVG-\$_O3,O3 GC_AT_AQS.nc
| + | |
− | | + | |
− | Note that <tt>pncaqsraw4pnceval.py</tt> will either use a pre-downloaded file or download it for you. You can substitute any other network that is in a text file using the <tt>pncgen -f csv,...</tt> command in place of <tt>pncaqsraw4pnceval.py</tt>. There are also many more statistical functions that can be used.
| + | |
− | | + | |
− | -- [[User:barronh|Barron H. Henderson]] May 16 2016<br>--[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:30, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === Process analysis diagnostics ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developer
| + | |
− | |width="600px"|[[User:barronh|Barron Henderson]] (US EPA, formerly U. Florida)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/barronh/pypa <tt>https://github.com/barronh/pypa</tt>]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Documentation
| + | |
− | |[[Process Analysis Diagnostics|See our ''Process Analysis Diagnostics'' wiki page]]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Descripton:'''''
| + | |
− | | + | |
− | Process-based Analysis examines the change in each species due to each process and reaction. Models predict atmospheric state, which in a time-series can be used to create net-change of each species. What this cannot tell us, is which processes led to that change. To supplement state (or concentration, GEOS-Chem has long archived emissions and employed advanced diagnostics to predict gross chemical production or loss. Process Analysis goes a step further archiving grid-cell budgets for each species, and decomposing gross production/loss into individual reaction contributions. Process Analysis extensions are currently available in CAMx, WRF-Chem, CMAQ, and now GEOS-Chem. This allows for direct comparisons of models at a fundamental, process level.
| + | |
− | | + | |
− | For more information, or to download the code, please see [[Process Analysis Diagnostics|our ''Process Analysis Diagnostics'' page on the GEOS-Chem wiki]].
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:50, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === Gchem ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developer
| + | |
− | |width="600px"|Gerrit Kuhlmann
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/gkuhl/gchem <tt>https://github.com/gkuhl/gchem</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Description:'''''
| + | |
− | | + | |
− | [https://github.com/gkuhl/gchem Gchem] is mainly a reader/writer for bpch files. To visualize data, you can use available libraries (Matplotlib and basemap).
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:52, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === PyGChem ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developers
| + | |
− | |width="600px"|Benoit Bovy and Emanuel Mahieu (U. Liege)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/benbovy/PyGChem/ <tt>https://github.com/benbovy/PyGChem/</tt>]
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Documentation
| + | |
− | |[http://nbviewer.ipython.org/github/benbovy/PyGChem_examples/blob/master/Index.ipynb <tt>http://nbviewer.ipython.org/github/benbovy/PyGChem_examples/blob/master/Index.ipynb</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Description:'''''
| + | |
− | | + | |
− | The [https://github.com/benbovy/PyGChem/ PyGChem] Python package aims to connect GEOS-Chem to the Python Scientific (SciPy) Stack, which consists of several core packages and many specialized packages for scientific computing. PyGChem is under active development. Currently, it allows reading GEOS-Chem datasets from both bpch and netCDF formats and handling it as [http://scitools.org.uk/iris/ Iris]'s cubes. Other dataset handling backends such as [https://github.com/xray/xray xray] will be added soon. An API for HEMCO is also under development ; it will allow users to dynamically read/write, create, edit, test, and visualize HEMCO configurations.
| + | |
− | | + | |
− | Preliminary documentation is available as [http://nbviewer.ipython.org/github/benbovy/PyGChem_examples/blob/master/Index.ipynb IPython notebooks].
| + | |
− | | + | |
− | --[[User:Benoît_Bovy|Benoit B.]] 10:45, 7 May 2015 (EDT)<br>--[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 16:56, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === Python Ensemble Manager ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developers
| + | |
− | |width="600px"|Andre Perkins (U. Wisconsin)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/frodre/pyEnsemble <tt>https://github.com/frodre/pyEnsemble</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Description:'''''
| + | |
− | | + | |
− | This code is useful for running ensembles of GEOS-Chem adjoint model simulations within an MPI environment. For more information about our Python Ensemble Manager, please see [https://github.com/frodre/pyEnsemble the source code on github].
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 17:00, 24 April 2017 (UTC)
| + | |
− | | + | |
− | === Queueing script ===
| + | |
− | | + | |
− | '''''Summary:'''''
| + | |
− | | + | |
− | {| border=1 cellspacing=0 cellpadding=5
| + | |
− | |-valign="top"
| + | |
− | !width="200px" bgcolor="#CCFFFF"|Developers
| + | |
− | |width="600px"|[https://wacl.org.uk/students/ben-newsome/ Ben Newsome] (U. York)
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Status
| + | |
− | |Available for download
| + | |
− | | + | |
− | |-valign="top"
| + | |
− | !bgcolor="#CCFFFF"|Latest version
| + | |
− | |[https://github.com/wacl-york/monthly_run <tt>https://github.com/wacl-york/monthly_run</tt>]
| + | |
− | | + | |
− | |}
| + | |
− | | + | |
− | '''''Description:'''''
| + | |
− | | + | |
− | I set up a python script for my group to split up long runs into smaller runs (Allow you to run a year simulation in a 4 hour queue by running 1 month at a time) that can auto submit the next timestep. The bottom of the script should easily be adaptable for use in alternate queue systems. If any information on it is needed then I can be [mailto:ben.newsome@york.ac.uk emailed] or an Issue can be raised on github.
| + | |
− | | + | |
− | --[[User:Melissa Payer|Melissa Sulprizio]] ([[User talk:Melissa Payer|talk]]) 17:33, 18 November 2016 (UTC)
| + | |
− | | + | |
− | == Python resources ==
| + | |
− | | + | |
− | *[http://www.python.org Python.org]: Main site for all things Python
| + | |
− | *[http://docs.python.org/2/tutorial/ Python.org Tutorial]
| + | |
− | *[http://wiki.python.org/moin/BeginnersGuide/Programmers PythonWiki.org: List of tutorials and resources]
| + | |
− | *[https://developers.google.com/edu/python/ Google's Python tutorial]
| + | |
− | | + | |
− | In this section we preserve information about Python software packages that have been made obsolete.
| + | |
− | | + | |
− | == Obsolete software packages ==
| + | |
− | | + | |
− | In this section we list Python software packages for GEOS-Chem that have been rendered obsolete by newer developments.
| + | |
− | | + | |
− | === bpchdump ===
| + | |
− | | + | |
− | [[Image:Obsolete.jpg]]
| + | |
− | | + | |
− | <span style="color:red">'''''This package seems to be no longer archived online.'''''</span>
| + | |
− | | + | |
− | '''''Author''''': Liang Feng (U. Edinburgh, UK)
| + | |
− | | + | |
− | Here are some screenshots of our '''bpchdump.py''' package, which allow you to browse the contents of a bpch file and plot them:
| + | |
− | | + | |
− | bpchdump.py GUI interface:
| + | |
− | | + | |
− | [[Image:bpchdump_gui.png]]
| + | |
− | | + | |
− | Sample plot generated with bpchdump.py:
| + | |
− | | + | |
− | [[Image:bpchdump_plot.png]]
| + | |
− | | + | |
− | --[[User:Bmy|Bob Y.]] 11:40, 28 May 2013 (EDT)
| + | |
− | | + | |
− | === bpch to netCDF converter ===
| + | |
− | | + | |
− | [[Image:Obsolete.jpg]]
| + | |
− | | + | |
− | <span style="color:red">'''''This functionality has been incorporated into [[#PseudoNetCDF|Barron Henderson's PseudoNetCDF package]]. We shall leave this information here for reference.'''''</span>
| + | |
− | | + | |
− | '''''Author''''': Barron Henderson (U. Florida)
| + | |
− | | + | |
− | '''''[mailto:barronh@ufl.edu Barron Henderson] wrote:'''''
| + | |
− | | + | |
− | :I wanted to clarify a little bit about my own project, which I have named simply bpch. bpch is registered with pypi (and installable with the command `pip install bpch`).
| + | |
− | | + | |
− | :bpch is netcdf-like reader for bpch files returns a netcdf-like object with CF-1.6 compliant meta-data. The interface for bpch mimics the netcdf4-python interface (the successor to SciPy.io.netcdf.netcdffile).
| + | |
− | | + | |
− | :If the bpch module is called from the command line (see below), it creates a netcdf file. If the module is used in a python program, then no netcdf file is created. At the command line, it also supports nco-like dimension and variable subsetting. Optionally, it can output figures and animations as well.
| + | |
− | | + | |
− | :Example command line:
| + | |
− | | + | |
− | $ python -m bpch ctm.bpch -o ctm.bpch.nc
| + | |
− | | + | |
− | :would create ctm.bpch.nc that is readable by Panoply. The output is not currently readable by IDV because of some dimension naming assumptions for vertical dimensions.
| + | |
− | | + | |
− | :In script form, the bpch module is simple a reader. The script below would simply print out some statistics twice. The first time demonstrates the netcdf3-classic style and the second demonstrates the netcdf4 style. The module uses numpy array structures, so it is fully compatible with matplotlib plotting functions.
| + | |
− | | + | |
− | #!/usr/bin/env python
| + | |
− | #--Begin Script--
| + | |
− | from bpch import bpch
| + | |
− | import numpy as np
| + | |
− |
| + | |
− | f = bpch('ctm.bpch')
| + | |
− | key = 'IJ-AVG-$_Ox'
| + | |
− | v = f.variables[key]
| + | |
− | print key
| + | |
− | print v.units, v.dimensions
| + | |
− | print 'Min, Median, Max, Mean, Std:', v[:].min(), np.median(v[:]), v[:].max(), v[:].mean(), v[:].std()
| + | |
− |
| + | |
− | group = 'IJ-AVG-$'
| + | |
− | key = 'Ox'
| + | |
− | v = f.groups[group].variables[key]
| + | |
− | print key
| + | |
− | print v.units, v.dimensions
| + | |
− | print 'Min, Median, Max, Mean, Std:', v[:].min(), np.median(v[:]), v[:].max(), v[:].mean(), v[:].std()
| + | |
− |
| + | |
− | #--End Script--
| + | |
− | | + | |
− | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 15:59, 24 April 2017 (UTC)
| + | |