<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="Internal function used to perform the required spatial
processing on MODIS original hdf layers (reprojection, resizing, resampling,
mosaicing, computation of scaling factors). The function is based on the
use of gdal routines."><title>MODIStsp helper for processing original HDF layers — MODIStsp_process_bands • MODIStsp</title><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.2.2/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.2.2/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="MODIStsp helper for processing original HDF layers — MODIStsp_process_bands"><meta property="og:description" content="Internal function used to perform the required spatial
processing on MODIS original hdf layers (reprojection, resizing, resampling,
mosaicing, computation of scaling factors). The function is based on the
use of gdal routines."><meta property="og:image" content="https://docs.ropensci.org/MODIStsp/logo.png"><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--><!-- Matomo --><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css"><script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script><script src="https://ropensci.org/scripts/matomo.js"></script><noscript><p><img src="https://ropensci.matomo.cloud/matomo.php?idsite=1&amp;rec=1" style="border:0;" alt=""></p></noscript><!-- End Matomo Code --></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
    

    <nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
    <a href="https://ropensci.org" class="external-link"><img src="https://ropensci.org/img/icon_short_white.svg" id="hexlogo" alt="rOpenSci"></a>
    <a class="navbar-brand me-2" href="../index.html">MODIStsp</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">2.1.0</small>

    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="nav-item">
  <a class="nav-link" href="../index.html">
    <span class="fa fa-home"></span>
     
  </a>
</li>
      </ul><form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off"></form>

      <ul class="navbar-nav"><li class="nav-item dropdown">
  <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown--articles">
    <span class="fas fa fas fa-book"></span>
     
    Articles
  </a>
  <div class="dropdown-menu" aria-labelledby="dropdown--articles">
    <a class="dropdown-item" href="../articles/installation.html">Installation</a>
    <a class="dropdown-item" href="../articles/interactive_execution.html">Interactive Execution - the MODIStsp GUI</a>
    <a class="dropdown-item" href="../articles/noninteractive_execution.html">Non-Interactive Execution from within R</a>
    <a class="dropdown-item" href="../articles/standalone_execution.html">Standalone Execution and Scheduled Processing</a>
    <a class="dropdown-item" href="../articles/output.html">Outputs Format and Naming Conventions</a>
    <a class="dropdown-item" href="../articles/analyze.html">Accessing and Analyzing Processed Data from R</a>
    <a class="dropdown-item" href="../articles/products_list.html">Supported MODIS Products</a>
  </div>
</li>
<li class="nav-item">
  <a class="nav-link" href="../articles/faq.html">
    <span class="fa fa-question-circle-o"></span>
     
    faq
  </a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../news/index.html">
    <span class="fa fa-newspaper-o"></span>
     
    news
  </a>
</li>
<li class="active nav-item">
  <a class="nav-link" href="../reference/index.html">
    <span class="fa fa-file-code-o"></span>
     
    functions
  </a>
</li>
<li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/ropensci/MODIStsp/">
    <span class="fa fa-github fa-lg"></span>
     
    github
  </a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../articles/lorenzo.html">
    <span class="fa fa-cross"></span>
     
    dedication
  </a>
</li>
      </ul></div>

    
  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.png" class="logo" alt=""><h1>MODIStsp helper for processing original HDF layers</h1>
      <small class="dont-index">Source: <a href="https://github.com/ropensci/MODIStsp/blob/HEAD/R/MODIStsp_process_bands.R" class="external-link"><code>R/MODIStsp_process_bands.R</code></a></small>
      <div class="d-none name"><code>MODIStsp_process_bands.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>Internal function used to perform the required spatial
processing on MODIS original hdf layers (reprojection, resizing, resampling,
mosaicing, computation of scaling factors). The function is based on the
use of <code>gdal</code> routines.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">MODIStsp_process_bands</span><span class="op">(</span></span>
<span>  <span class="va">out_folder_mod</span>,</span>
<span>  <span class="va">modislist</span>,</span>
<span>  <span class="va">outproj_str</span>,</span>
<span>  <span class="va">mod_proj_str</span>,</span>
<span>  <span class="va">sens_sel</span>,</span>
<span>  <span class="va">band</span>,</span>
<span>  <span class="va">bandname</span>,</span>
<span>  <span class="va">date_name</span>,</span>
<span>  <span class="va">datatype</span>,</span>
<span>  <span class="va">nodata_in</span>,</span>
<span>  <span class="va">nodata_out</span>,</span>
<span>  <span class="va">full_ext</span>,</span>
<span>  <span class="va">bbox</span>,</span>
<span>  <span class="va">scale_val</span>,</span>
<span>  <span class="va">scale_factor</span>,</span>
<span>  <span class="va">offset</span>,</span>
<span>  <span class="va">out_format</span>,</span>
<span>  <span class="va">outrep_file</span>,</span>
<span>  <span class="va">compress</span>,</span>
<span>  <span class="va">out_res_sel</span>,</span>
<span>  <span class="va">out_res</span>,</span>
<span>  <span class="va">resampling</span>,</span>
<span>  <span class="va">nodata_change</span>,</span>
<span>  <span class="va">gui</span>,</span>
<span>  <span class="va">verbose</span>,</span>
<span>  <span class="va">parallel</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
    <dl><dt>out_folder_mod</dt>
<dd><p><code>character</code> Output folder for original HDF storage.
If <code>"$tempdir"</code> (default), a temporary directory is used.</p></dd>


<dt>modislist</dt>
<dd><p><code>character array</code> List of MODIS images to be downloaded for
the selected date (as returned from <code>get_mod_filenames</code>). Can be a single
image, or a list of images in case different tiles are needed!</p></dd>


<dt>outproj_str</dt>
<dd><p><code>character</code> EPSG or WKT of output projection.</p></dd>


<dt>mod_proj_str</dt>
<dd><p><code>character</code> EPSG or WKT of MODIS projection.</p></dd>


<dt>sens_sel</dt>
<dd><p><code>character ["terra" | "aqua"]</code> Selected sensor.</p></dd>


<dt>band</dt>
<dd><p><code>numeric</code> band number corresponding to the HDF layer to be
processed</p></dd>


<dt>bandname</dt>
<dd><p><code>character</code> Name of the HDF layer to be processed.</p></dd>


<dt>date_name</dt>
<dd><p><code>character</code> Date of acquisition of the images to be
downloaded.</p></dd>


<dt>datatype</dt>
<dd><p><code>character</code> Datatype to the HDF layer to be processed.</p></dd>


<dt>nodata_in</dt>
<dd><p><code>numeric</code> Original nodata value to the HDF layer to be
processed.</p></dd>


<dt>nodata_out</dt>
<dd><p><code>numeric</code> Output nodata value to the HDF layer to be
processed.</p></dd>


<dt>full_ext</dt>
<dd><p><code>logical</code> If TRUE, process full tiles, if FALSE, process
bbox</p></dd>


<dt>bbox</dt>
<dd><p><code>numeric(4)</code> Output bounding box (xmin, ymin, xmax, ymax) in
out_proj coordinate system. Ignored if spatmeth == "tiles", Default: NULL</p></dd>


<dt>scale_val</dt>
<dd><p><code>logical</code> If TRUE,  scale and offset are applied to
original MODIS layers, and Spectral Indexes are saved as floating point. If
FALSE, no rescaling is done and Spectral Indexes are saved as integer, with a
10000 scaling factor.</p></dd>


<dt>scale_factor</dt>
<dd><p><code>numeric</code> Scale factor to be applied to the HDF layer
to be processed (Ignored if <code>scale_val</code> == FALSE).</p></dd>


<dt>offset</dt>
<dd><p><code>numeric</code> Offset to be applied to the HDF layer
to be processed (Ignored if <code>scale_val</code> == FALSE).</p></dd>


<dt>out_format</dt>
<dd><p><code>character ["ENVI" | "GTiff"]</code> Desired output format.</p></dd>


<dt>outrep_file</dt>
<dd><p><code>character</code> Full path of the file where results of the
processing are to be stored (created in <code>MODIStsp_process</code>)</p></dd>


<dt>compress</dt>
<dd><p><code>character ["None" | "PACKBITS" | "LZW" | "DEFLATE"]</code>
Compression method for GTiff outputs (Ignored if <code>out_format == ENVI</code>)</p></dd>


<dt>out_res_sel</dt>
<dd><p><code>character ["Native", "User Defined</code>]. If "Native", the
outputs keep the original resolution of MODIS HDF images. Otherwise, the value
set in "out_res" is used.</p></dd>


<dt>out_res</dt>
<dd><p><code>float</code> Output resolution (in output projection measurement
unit). Ignored if out_res_sel == "Native".</p></dd>


<dt>resampling</dt>
<dd><p><code>character ["near" | "bilinear" | "cubic" | "cubicspline", |lanczos"|, "average"|, "mode", |"max"|, |"min"|, |"q1"|, |"q3"|, |"sum"|]</code>
Resampling method to be used by <code>gdalwarp</code>.</p></dd>


<dt>nodata_change</dt>
<dd><p><code>logical</code> if TRUE, NoData values are set to the max value
of the datatype of the layer on the MODIStsp output rasters. NOTE: If multiple
nodata values are reported for a layer, all are reset to the new value.</p></dd>


<dt>gui</dt>
<dd><p><code>logical</code> if TRUE: the GUI is opened before processing. If FALSE:
processing parameters are retrieved from the provided <code>opts_file</code>
argument), Default: TRUE</p></dd>


<dt>verbose</dt>
<dd><p><code>logical</code> If FALSE, suppress processing messages, Default: TRUE</p></dd>


<dt>parallel</dt>
<dd><p><code>logical</code> If TRUE, the function is run using parallel
processing, to speed-up the computation for large rasters (with a maximum
of 8 cores).
The number of cores is automatically determined; specifying it is also
possible (e.g. <code>parallel = 4</code>). In this case, more than 8 cores can be
specified. If FALSE (default), single core processing is used.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    

<p>The function is called for its side effects</p>
    </div>
    <div class="section level2">
    <h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
    <p>Lorenzo Busetto, phD (2014-2017)</p>
<p>Luigi Ranghetti, phD (2015)</p>
    </div>

  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside></div>


    <footer><!-- begin footer --><div class="footer">
    <div class="container">
        <div class="row start top-4 bottom-8">
            <div class="col-2"> <img id="footerlogo" src="https://ropensci.org/img/icon_short_white.svg"></div>
            <div class="col-10">
                <div class="row">
                    <div class="col-md-4 col-xs-6">
                        <a href="https://github.com/ropensci" target="_blank" class="external-link"><div class="icon fab fa-github"></div></a>
                        <a href="https://github.com/ropenscilabs" target="_blank" class="external-link"><div class="icon fa fa-flask"></div></a>
                        <a href="https://hachyderm.io/@ropensci" target="_blank" class="external-link"><div class="icon fab fa-mastodon"></div></a>
                        <a href="https://vimeo.com/ropensci" target="_blank" class="external-link"><div class="icon fab fa-vimeo"></div></a>
                    </div>
                </div>
                <div class="row top-4">
                    <div class="col-md-2 col-sm-4">
                        <ul><h5 class="bottom-2">About</h5>
                            <li><a href="https://ropensci.org/about" class="external-link">About rOpenSci</a></li>
                            <li><a href="https://ropensci.org/software-review" class="external-link">Software Review</a></li>
                            <li><a href="https://ropensci.org/about#team" class="external-link">Our Team</a></li>
                            <li><a href="https://ropensci.org/careers" class="external-link">Jobs</a></li>
                            <li><a href="https://ropensci.org/donate" class="external-link">Donate</a></li>
                            <li><a href="https://ropensci.org/contact" class="external-link">Contact Us</a></li>
                        </ul></div>
                    <div class="col-md-3 col-sm-4">
                        <ul><h5 class="bottom-2">Community</h5>
                            <li><a href="https://ropensci.org/community/" class="external-link">Our Community</a></li>
                            <li><a href="https://ropensci.org/commcalls/" class="external-link">Community calls</a></li>
                            <li><a href="https://ropensci.org/events/" class="external-link">Events</a></li>
                            <li><a href="https://discuss.ropensci.org/" class="external-link">Join the Discussion</a></li>
                            <li><a href="https://ropensci.org/code-of-conduct" class="external-link">Code of conduct</a></li>
                        </ul></div>
                    <div class="col-md-2 col-sm-4">
                        <ul><h5 class="bottom-2">Resources</h5>
                            <li><a href="https://ropensci.org/packages/" class="external-link">Packages</a></li>
                            <li><a href="https://ropensci.org/usecases/" class="external-link">Use Cases</a></li>
                            <li><a href="https://ropensci.org/talks-papers/" class="external-link">Talks &amp; Publications</a></li>
                            <li><a href="https://docs.ropensci.org/" class="external-link">Documentation</a></li>
                            <li><a href="https://ropensci.org/news/" class="external-link">Newsletter</a></li>
                            <li><a href="https://ropensci.org/how-to-cite-ropensci/" class="external-link">Cite rOpenSci</a></li>
                        </ul></div>
                    <div class="col-md-4 col-xs-12">
                        <h5 class="bottom-2"></h5>

                        <p>rOpenSci is a fiscally sponsored project of <a href="http://numfocus.org" class="external-link">NumFOCUS</a>.</p>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- / end footer -->


    </footer></div>

  

  

  </body></html>

