2021

    April

    2020

    December

    October

    • Numpy mask for 3D array

      How to use np.where and mask on a 3D array? If I use normal operation, I received an error like this:

    September

    July

    • Battle 32: VS code keyboard shortcut in VNC

      Somehow in the VNC environment, the “u” becomes unknown when I was trying to set up the shortcut.

    • Battle 31: A flexible model configuration system

      CIME is a rather flexible case management system. When we design a system configuration subsystem, we want it to be flexible so we can set up a system without providing all the information. To do so, the case system should use a default configuration if possible.

    June

    • Battle 30: Naming system

      A typicl ELM history file variable has the following structure:

    • Battle 29: Github issue

      This post is trying to resolve some common issues in my Github usage:

    • Battle 28: redesign the plot libary

      I have developed a Python library for various projects. This library has many different features including the plotting functions. But I am not satisfied with the current strategy/structure of some components. For example, I somehow wrote a list of functions for a similar purpose. Now it is time to re-organize some functions.

    • Battle 27: Rename Excel sheet name

      Here is what I got from an Excel sheet name, there are some unexpected special characteristics. So I designed a simple method to resolve them.

    • Battle 26: Pandas Date

      The pandas date function seems to be very complex! For example:

    May

    • Battle 25: VTK visualization

      n my recent posts, I discussed how to generate 3D plots using MayaVi and PyVista, both of them works but not as great as I expected. MayaVi has issue with rendering using OpenCL PyVista does not expose enough APIs to control the plot So these are great tools to start with, but later on I decided to switch back to raw VTK. I used another package called PyeVTK (https://github.com/paulo-herrera/PyEVTK), it basically help you to export data into the VTK format.

    • Battle 24: Finding the perfect camera postion

      The question is how we can find a perfect camera position when plotting a 3D VTK object.

    April

    March

    • Battle 20: QGIS failed to define spatial reference

      I need to convert a raster file to global scale. Earlier I manually resmapled it using Python SciPy, but the result is not very nice. Later on, I used the GDAL Python API, the results is great. However, when I tried to compared the two rasters, QGIS failed to define the projection.

    February

    January

    • Mpi4py on cluster

      One of my Python scripts is taking too long to run, which exceeds the short queue. I decided to use MPI, and mpi4py seems to be a good choice. But there are many issue when I first used it.

    • Battle 10: USGS Python tool

      Lots of USGS data are distributed using web service. Earlier I have introduced how to download MODIS data in batch mode using wget. Recently I need to download USGS data in batch mode, so I collected some information I found online. In case someone might find it helpful.

    • Battle 9: x2go VNC connection issue

      VNC is very convenient for many reasons. Somehow my x2go failed to work after recent playing around.

    • Battle 8: Create a customized axis

      https://jakevdp.github.io/PythonDataScienceHandbook/04.08-multiple-subplots.html https://matplotlib.org/3.1.0/tutorials/toolkits/axes_grid.html

    • Battle 7: create a perfect Y axis

      The question is: how to create a “perfect” Y axis for a time series plot.

    2019

    December

    November

    October

    • Battle 2: Python submit SLURM job

      Programmers are supposed to be lazy, like Emacs user wants to do everything within Emacs because it can be an operating system.

    • Battle 1: MODFLOW-NWT output LMT

      While I was trying to run the MT3D, I received an error: Error Reading Flow-Transport Link File Possibly Caused by:

      1. Incompatible Styles of Unformatted Files Used by MODFLOW and MT3D-USGS, ensure usage of FREE in MT3D-USGS name file matches LMT;
      2. Unformatted Flow-Transport Link File Saved by Version 1 of LinkMT3D Package Which Is No Longer Supported by MT3D-USGS.