gscpy
latest
  • Installation
  • Examples
  • Technical documentation
    • Import Scripts
    • Database Related Modules
    • Download Related Modules
    • Pre-Processing Related Modules
    • Import Related Modules
    • Export Related Modules
    • Space Time Related Modules
gscpy
  • Docs »
  • Technical documentation »
  • Import Related Modules
  • Edit on GitHub

Import Related Modules¶

These modules are for importing data. Unlike the existing modules, they can import all files in a directory by considering a certain pattern. Moreover, it is possible to import these data in different mapsets. In addition, the module i_fr_import can import pyroSAR datasets in a directory based on their metadata.

The name of the modules was chosen to ensure conformity with the GRASS GIS conventions. The addition r stands for raster where the addition d and f stand for directory and finder respectively.

Note, it is important for the parameter `pattern` that the asterisk(‘*’) contains a dot (see examples).

class gscpy.i_import.i_dr_import.DirImport(input_dir, pattern=None, extension=None)[source]¶

Import data into a mapset from a file with considering certain patterns.

Parameters:
  • input_dir (str) – The directory where the files are located.
  • pattern (str, optional) – The pattern of file names. If not specified all files with selected extension will be imported.
  • extension ({'ENVI', 'GEOTIFF'}, optional) – Which extensions should be recognized? Default is ‘GEOTIFF’
input_dir¶
Type:str
extension¶
Type:str
filter_p¶

Combines pattern and extension.

Type:str
files¶

All detected files.

Type:list
import_products(reproject=False, link=False)[source]¶

Import detected files.

create_mapset(mapset, dbase=None, location=None)[source]¶

Create a new mapset.

print_products()[source]¶

Print all detected files.

Examples

The general usage is

$ i.dr.import [-r -l -c -p] input_dir=string [pattern=string] [extension=string] [mapset=string] [dbase=string] [location=string] [--verbose] [--quiet]

Import files that starts with ‘S1’ from a directory in current mapset and reproject it

$ i.dr.import -r input_dir=/home/user/data pattern=S1.*

Import files that starts with ‘S1’ from a directory in a new mapset and reproject it

$ i.dr.import -c -r input_dir=/home/user/data pattern=S1.* mapset=Goettingen

Notes

Note, it is important for the parameter pattern that the asterisk(‘*’) contains a dot (see examples).

Flags:
  • r : Reproject raster data (using r.import if needed).
  • l : Link raster data instead of importing.
  • c : Create a new mapset.
  • p : Print the detected files and exit.
create_mapset(mapset, dbase=None, location=None)[source]

Create a new mapset calling the module g.c.mapset.

Parameters:
  • mapset (str, optional) – Name of mapset.
  • dbase (str, optional) – Location of GRASS GIS database
  • mapset – Name of the mapset that will be created.
Returns:

Return type:

None

import_products(reproject=False, link=False)[source]

Import detected files.

Parameters:
  • reproject (bool) – Reproject raster data (using r.import if needed).
  • link (bool) – Link raster data instead of importing.
Returns:

Return type:

None

print_products()[source]

Print all detected files.

Returns:
Return type:None
Next Previous

© Copyright 2018, Ismail Baris, Nils v. Norsinski Revision 452e1bda.

Built with Sphinx using a theme provided by Read the Docs.