FlexTRKR / PyFLEXTRKR

PyFlexTRKR
Other
72 stars 22 forks source link

GPM IMERG #84

Closed feng045 closed 8 months ago

feng045 commented 8 months ago

This PR is based on #81 with the following major updates:

  1. A new approach of movement direction (in movement_speed.py) was implemented by @feliperiosg. Now 0/360 (degrees) is for north, 90 for east, 180 for south, and 270 for west. When computing x-y vectors from this angles, sines are cosines work just fine. If the pf/feature is not moving, the angle/direction is nan (that is, when the movement speed is zero). also the speed now is not interpolated (which previously caused having unrealistic zero or nan speeds).
  2. Corrected a bug in /pyflextrkr/movement_speed.py where the last track movement calculation is missing.
  3. Added movement calculation to Tb-only MCS tracking using tracked Tb field (in runscripts/run_mcs_tb.py).
  4. Added parameters in config/config_himawari_mcs_example.yml for calculating movements, and updated config/demo_mcs_himawari.sh to include downloading example Himawari data.
  5. Added an input argument (--figname_type) in /Analysis/plot_subset_tbpf_mcs_tracks_demo.py to control the output image naming format. By default, this argument is set to ‘date_time’, which uses date_time as image output names. Setting this argument to ‘sequence’ will use ordinal pattern (e.g., figbasename00001.png) as output names.
  6. Added an option in Analysis/plot_subset_tb_mcs_tracks_demo.py to auto determine figure aspect ratio if map_extent is specified.
  7. Added Notebooks/plot_himawari_single_track_stats.ipynb to demonstrate plotting a single MCS track statistics from Himawari Tb-only MCS tracking.

The following changes were implemented by @feliperiosg:

  1. README.md now offers an alternative on how to install PyFLEXTRKR via conda from the requirements.txt file.
  2. Explicit 'utf-8' encoding in the setup.py file.
  3. Instances (only in GPM IMERG-related files) of 'dims' in xarray objects, e.g., "ds_in.dims[...]" were replaced to "ds_in.sizes[...]", avoiding the "FutureWarning: The return type of Dataset.dims will be...". (PyFLEXTRKR also runs in python=3.11.7 (both Linux and Windows). This might enable too supporting later versions of xarray, which was probably the cause of the aforementioned warning.) the "UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision..." was also taken care of. (basetime[:nfiles].astype("datetime64[ns]") in line 611 of gettracks.py)
  4. How the coordinates are arranged at the end of function "subset_ds_geolimit" (in ft_utilities.py) allows now to simply apply (and rightly retrieve the lat-lon order) of land-sea masks downloaded from GES DISC. (as it was before, PyFLEXTRKR crashed in pf-rain fraction over land and sea, because the "shape" of the numpy, i.e., lat-lon was transposed).