<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FArctos</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FArctos"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FArctos"/>
	<updated>2026-05-26T14:47:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=8830</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=8830"/>
		<updated>2009-05-17T21:40:29Z</updated>

		<summary type="html">&lt;p&gt;⚠️Arctos: /* MODIS Aqua */ Specified input file assumption&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.fem-environment.eu/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Terra ==&lt;br /&gt;
&lt;br /&gt;
MODIS on Terra provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://gis.fem-environment.eu/modis-lst&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MODIS Aqua ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_sst.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
* Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data.&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alternatively the USGS/NASA's [https://lpdaac.usgs.gov/lpdaac/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) for Level 3 data or [https://lpdaac.usgs.gov/lpdaac/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data can be used to create a GeoTiff.&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a XY location, clean it up, then copy into a lat/lon location. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
'&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
* Create a simple XY GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
* Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data.&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
* Create a simple XY GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use i.rectify to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the &amp;lt;tt&amp;gt;i.group&amp;lt;/tt&amp;gt; module. Run &amp;lt;tt&amp;gt;i.target&amp;lt;/tt&amp;gt; and select a lat/lon location. The idea here is to run i.rectify with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use &amp;lt;tt&amp;gt;i.points&amp;lt;/tt&amp;gt; or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run i.rectify to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;/div&gt;</summary>
		<author><name>⚠️Arctos</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Map_Reprojection&amp;diff=3931</id>
		<title>Map Reprojection</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Map_Reprojection&amp;diff=3931"/>
		<updated>2007-03-15T21:04:45Z</updated>

		<summary type="html">&lt;p&gt;⚠️Arctos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Q:''' How to change map/image projections, datums, etc in GRASS GIS?&lt;br /&gt;
&lt;br /&gt;
'''A:'''&lt;br /&gt;
&lt;br /&gt;
# create an import location in the projection and datum of the map/image you want to import&lt;br /&gt;
# import the map/image into the location&lt;br /&gt;
# create a destination location in the projection and datum you want to reproject the map/image into&lt;br /&gt;
# working in the destination location, use r.proj or v.proj (depending on whether the map/image is raster or vector) to reproject the map/image from the import location to the destination location.&lt;br /&gt;
&lt;br /&gt;
If your raster data set is too big (i.e, 2 gb or so), r.proj will crash. Instead, export as a geotif, use gdalwarp to change the project and then import the new geotif file. If you have installed gdal, you almost certainly have gdalwarp as well. Directions for gdalwarp are at http://www.remotesensing.org/gdal/gdalwarp.html. The options for gdalwarp are a bit confusing. Here is an example of projecting a geotif based on srtm elevation data to utm 37N. -t_srs is the output file projection. AfricaHornElev.tif is the input file, AfricaHornElev37n.tif is the output file.&lt;br /&gt;
&lt;br /&gt;
gdalwarp -t_srs '+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' -rcs AfricaHornElev.tif AfricaHornElev37n.tif&lt;br /&gt;
&lt;br /&gt;
Another (similar) strategy frequently needed when maps need to be imported using, e.g. v.in.ogr or r.in.ogr, is to tell these programs to create a new location (argument &amp;quot;location&amp;quot;). If the imported data contains proper PROJ_INFO files, they can be reprojected into the current mapset, using the the projection in the current location/mapset.&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>⚠️Arctos</name></author>
	</entry>
</feed>