Skip to content

Commit

Permalink
Update chirpstif.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyistanto authored Jul 21, 2023
1 parent 55f646b commit 4f8e613
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/chirpstif.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This script was tested using CHIRPS dekad data. Adjustment is needed if using ot
NCO (http://nco.sourceforge.net) must be installed before using this script
Modified by
Benny Istanto, UN World Food Programme, benny[email protected]
Benny Istanto, BIGC, benny@istan.to
-------------------------------------------------------------------------------------------------------------
"""

Expand All @@ -88,8 +88,9 @@ a = ds.ReadAsArray()
nlat,nlon = np.shape(a)

b = ds.GetGeoTransform() #bbox, interval
lon = np.arange(nlon)*b[1]+b[0]
lat = np.arange(nlat)*b[5]+b[3]
lon = np.arange(nlon)*b[1] + b[0] + (b[1]/2) # add half the x pixel size to the lon
lat = np.arange(nlat)*b[5] + b[3] + (b[5]/2) # add half the y pixel size to the lat
lat = np.flipud(lat) # flip the latitudes

basedate = dt.datetime(1980,1,1,0,0,0)

Expand Down Expand Up @@ -152,9 +153,9 @@ nco.comments = "time variable denotes the first day of the given dekad."
nco.website = "https://www.chc.ucsb.edu/data/chirps"
nco.date_created = "2021-01-25"
nco.creator_name = "Benny Istanto"
nco.creator_email = "benny[email protected]"
nco.institution = "UN World Food Programme"
nco.note = "The data is developed to support regular updating procedure for SPI analysis (https://github.com/bennyistanto/spi). This activities will support WFP to assess extreme dry and wet periods as part of WFP's Seasonal Monitoring"
nco.creator_email = "benny@istan.to"
nco.institution = "Benny Istanto Geospatial Consulting"
nco.note = "The data is developed to support regular updating procedure for SPI analysis (https://github.com/bennyistanto/spi). This activities will support me to assess extreme dry and wet periods as part of my Climate Social Responsibility"


# Write lon,lat
Expand Down Expand Up @@ -182,7 +183,7 @@ for root, dirs, files in os.walk('/path/to/directory/'):
print(pcp_path)
pcp=gdal.Open(pcp_path)
a=pcp.ReadAsArray() #data
pcpo[itime,:,:]=a
pcpo[itime,:,:]=np.flipud(a) # flip the data in y-direction
itime=itime+1

nco.close()
Expand Down Expand Up @@ -237,4 +238,4 @@ Make sure the file `java_cli_chirps_1months_1981_2020.nc` is available at `Input
![CHIRPS inputnc](./img/chirps-inputnc.png)
- You also can get this data: `java_cli_chirps_1months_1981_2020.nc` via this link [https://github.com/bennyistanto/spi/blob/master/example/Data/Input_nc/java_cli_chirps_1months_1981_2020.nc](https://github.com/bennyistanto/spi/blob/master/example/Data/Input_nc/java_cli_chirps_1months_1981_2020.nc)
- You also can get this data: `java_cli_chirps_1months_1981_2020.nc` via this link [https://github.com/bennyistanto/spi/blob/master/example/Data/Input_nc/java_cli_chirps_1months_1981_2020.nc](https://github.com/bennyistanto/spi/blob/master/example/Data/Input_nc/java_cli_chirps_1months_1981_2020.nc)

0 comments on commit 4f8e613

Please sign in to comment.