Skip to content
Snippets Groups Projects

Pixel Times for GOES-R ABI L1B

Source Code for ABI Pixel Times

File pixel_time_module.f90 contains a function ABI_pixel_time(), which generates the pixel time values.

File pixel_time.f90 is a simple example of using Pixel_Time_module. It runs tests to compare pixel time values from ABI_pixel_time() to the reference values in the .nc files. Section Testing the Pixel Time Code has instructions on how to acquire the reference files and run the validation tests.

Using Pixel_Time Module as a Submodule

Submodules allow you to keep Pixel_Time repository as a subdirectory of another Git repository.

Starting with a Pixel_Time submodule

To add the Pixel_Time submodule to your git repository, use the git submodule add command with the URL of the Pixel_Time module:

$ git submodule add git@gitlab.ssec.wisc.edu:satlib/Pixel_Time.git

After that, the new .gitmodules file stores the mapping between the Pixel_Time submodule’s URL and the local subdirectory you’ve pulled it into:

$ cat .gitmodules 
[submodule "Pixel_Time"]
	path = Pixel_Time
        url = git@gitlab.ssec.wisc.edu:satlib/Pixel_Time.git

File .gitmodules is version controlled with your other files. Therefore, it is pushed and pulled with the rest of your project.

By default, submodules will add the Pixel_Time submodule into a directory named the same as the repository, in this case Pixel_Time:

$ ls Pixel_Time/
Makefile  pixel_time.f90  pixel_time_module.f90  README.md

Cloning a Project with a Pixel_Time Submodule

When you clone a project with the Pixel_Time submodule in it, by default you get the Pixel_Time directory that contains the submodule, but none of the files within them yet.

You could run two commands: git submodule init to initialize your local configuration file, and git submodule update to fetch all the data from Pixel_Time and check out the appropriate files.

However, there is simpler way to do this. If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository.

Working on a Project with a Pixel_Time Submodule

If you want to check for new work in the Pixel_Time submodule, you can run git submodule update --remote, Git will go into your submodules and fetch and update for you:

$ git submodule update --remote
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From gitlab.ssec.wisc.edu:jmielikainen/Pixel_Time
   6fddc5d..5a9abd9  master     -> origin/master
Submodule path 'Pixel_Time': checked out '5a9abd97483023fe68d11e32103dbde645152e3c'

Now, if you go back into the main project and run git diff --submodule you can see that the submodule was updated and get a list of commits that were added to it.

$ git diff --submodule
Submodule Pixel_Time 6fddc5d..5a9abd9:
  > Added instructions to how to use the module as a submodule

If you commit at this point then you will lock the submodule into having the new code when other people update.

Switching git branches with a Pixel_Time Submodule in Them

If you create a new branch, add a submodule there, and then switch back to a branch without a Pixel_Time submodule, you still have the submodule directory as an untracked directory. As an example we could have a pixel_time branch of Geocat with a Pixel_Time submodule and master branch of Geocat without a Pixel_Time submodule:

$ git checkout pixel_time 
Switched to branch 'pixel_time'

$ git submodule status
+8ba2ac3653c021c7e2c2ee32ed589d86465e0e20 Pixel_Time (remotes/origin/HEAD)

$ git checkout master
warning: unable to rmdir Pixel_Time: Directory not empty
Switched to branch 'master'

$ git status 
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	Pixel_Time/

$ git submodule status

Reference Implementation

The reference netCDF data files were created by an IDL implementation of GOES-R ABI L1B pixel time LUT/tools. The IDL source code is "for internal test only currently." The code was written by haifeng.qian@noaa.gov based on ABI Scan Time ATBD.

ABI Scan Time Code from GOES-R CWG:

/magma/mpav/abi_time/data/data135/hqian/share/ABI/pixel_time/src

Testing the Pixel Time Code

Run

make

to compile the pixel time module pixel_time_module.f90 and link it with the test code `pixel_time.f90'.

The makefile uses shell variables SSEC_NETCDF4_INC and SSEC_NETCDF4_LIB to locate NETCDF-4 include and library directories, respectively.

The test program uses the reference pixel time data in following directory for comparisons:

/magma/mpav/abi_time/data/data135/hqian/share/ABI/pixel_time/pixel_time_LUT/

The program assumes that the reference data is located in the directory ./pixel_time_LUT/.

Either copy the data into directory ./pixel_time_LUT/:

cp -r /magma/mpav/abi_time/data/data135/hqian/share/ABI/pixel_time/ pixel_time

or set a symbolic link ./pixel_time_LUT/ to point to the data directory:

ln -s pixel_time /magma/mpav/abi_time/data/data135/hqian/share/ABI/pixel_time/pixel_time_LUT/

Execution of the test program:

./pixel_time

is expected to produce the following output:

 Checking pixel time values from ABI_pixel_time() vs. reference values in the .nc files
 ----------------------------------------------------------------------------------------
 MESO, M3, 0.5km - band 2                   
 PASS

 MESO, M6F, 0.5km - band 2                   
 PASS

 CONUS, M3, 0.5km - band 2                   
 PASS

 CONUS, M6F, 0.5km - band 2                   
 PASS

...


 Checking strided pixel time values for 1 km resolution vs. band offset time corrected values for 2 km resolution
 ----------------------------------------------------------------------------------------------------------------
 MESO, M3, 1.0 km (band 1) scaled to 2.0 km (band 4)
 PASS

 CONUS, M3, 1.0 km (band 1) scaled to 2.0 km (band 4)
 PASS

 Done.

Future Improvements

At the moment, the software computes pixel times for ABI modes 3, 4, 6F and 6M. In the future, pixel times for other instruments could be added.