Saturday, August 11, 2018

Research Note #15 - Opening MODIS Sinusoidal Coordinate System Data Products with GrADS

In the previous post, I've described how to open a MODIS data which uses geographic lon-lat coordinates. The real problem is, most of MODIS products use sinusoidal coordinate system/projection, and of course, this will present a problem for tools such as GrADS which only supports gridded coordinates system. Well, this is quite tricky, but we actually can still open data with sinusoidal coordinate with GrADS, with a help from other tool. For this case, the help comes from MODIS Reprojection Tool (MRT).

The main reason to use MRT is simply straightforward: to convert the sinusoidal coordinates into geographic coordinates, hence enabling GrADS to open the data afterwards. The rest of the process is basically the same with opening MODIS data with geographic coordinates.  And of course, if you are confident, you can also convert the coordinate/projection by making a program with Fortran or C instead of using MRT.

Step 1: Downloading and Installing the MRT
You can get MRT freely from this website. Please be aware though, that you have to register/login to the website before downloading it. After logging in, download the installer package which is suitable for your platform/OS. For example, since I'm using Windows, I downloaded the Windows NT+32 bit package. 

I would not explain how to install it, thus don't forget to download and read the manual (it's on the same web page) because it covers every information you need to install and running the MRT. One of the most important thing is, you will need JAVA installed in your system before installing MRT. Also, if you update JAVA after installing MRT, you should modify the tool's path because the installer will need the exact path of current JAVA installation. Otherwise, you could also re-install MRT after  updating JAVA.

Step 2: Converting the data coordinates with MRT
Once you install the tool, run it, and open a MODIS data with sinusoidal projection. For this example, I will use MODIS Terra/Aqua combined Leaf Area Index/FPAR 8-daily with 500m spatial resolution, or in short, MCD15A2H. You will then see something like this:


Next, on 'Selected Bands', choose the variables you would like to save in the converted data (with geographic projection). For example, I chose Fpar_500m and Lai_500m only. Next, specify the out file name and location on 'Specify Output File' section e.g. 'test.hdf'. Then choose HDFEOS on 'Output File Type', Bilinear on 'Resampling Type', and Geographic on 'Output Projection Type'. Lastly, put 0.005 on 'Output Projection Type'. 


Once again, this is just an example and you can actually choose the options which meet your needs. For example, you want to use 'Nearest Neighbor Resampling' instead of 'Bilinear', or '0.05' instead of '0.005' for the output pixel, it's completely fine. The most important thing is, don't forget about your chosen output pixel size, in this case, 0.005 degree. Once you finish with the configurations, hit the 'Run' button.

A status window will then appear and show the progress of conversion process. Wait until it finished converting the data. Once finished, take a look at the status windows, especially for the 'Output Image Info' section, because that part contains the dimension of the new data with geographic projection which will be needed for creating GrADS ctl file.


Step 3. Creating GrADS ctl file and opening the data
Once you finish with the projection conversion, the next steps should be very easy, because you just have to open the new-created geographic projected data with GrADS, which has exactly the same procedure with what I have described in my previous post. This is an example of the GrADS ctl file based on the information we got from the MRT status window:

DSET ^test.hdf
title MODIS LAI
DTYPE hdfsds
OPTIONS yrev 
undef 255
XDEF 4420 linear 69.282032222000 0.005
YDEF 2000 linear 30.000000000000 0.005
ZDEF 1 linear 1 1
TDEF 100 linear 02dec2016 8dy
VARS 2
Fpar_500m=>fpar 0 y,x Fpar
Lai_500m=>lai 0 y,x lai 
ENDVARS  

Finally, open the data using GrADS, and you can expect something like this:

> open test.ctl
> set display color white
> clear
> set gxout shaded
> d fpar
> cbarn


It's not difficult, is it? Anyway, before working with any kinds of dataset, I suggest you to check the documentation of the data in order to understand the dimensions, variables and any parameters of the products.

No comments:

Post a Comment