Skip to content

m.prism.download

Downloads data from the PRISM Climate Group.

m.prism.download [-duf] [dataset=string [,string,...]] [start_date=string] [end_date=string] [separator=character] [--verbose] [--quiet] [--qq] [--ui]

Example:

m.prism.download dataset=string

grass.script.run_command("m.prism.download", dataset=None, start_date=None, end_date=None, separator="pipe", flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("m.prism.download", dataset="string")

Parameters

dataset=string [,string,...]
    Dataset index or ID
start_date=string
    Start date for search in YYYY-MM-DD (today for today; first for first date of first data year)
end_date=string
    End date for search in YYYY-MM-DD (today for today; first for last date of first data year)
separator=character
    Field separator
    Special characters: pipe, comma, space, tab, newline
    Default: pipe
-d
    List supported datasets and exit

-u
    List URLs only without downloading

-f
    List filenames only without downloading

--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

dataset : str | list[str], optional
    Dataset index or ID
start_date : str, optional
    Start date for search in YYYY-MM-DD (today for today; first for first date of first data year)
end_date : str, optional
    End date for search in YYYY-MM-DD (today for today; first for last date of first data year)
separator : str, optional
    Field separator
    Special characters: pipe, comma, space, tab, newline
    Used as: input, separator, character
    Default: pipe
flags : str, optional
    Allowed values: d, u, f
    d
        List supported datasets and exit

    u
        List URLs only without downloading

    f
        List filenames only without downloading

verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

m.prism.download downloads data from the PRISM Climate Group.

NOTES

This module anonymously logs in to their FTP server (HTTPS server for easier browsing) and download climate data for a specified time period.

EXAMPLES

List supported datasets and exit:

# use indices or datasets, but indices can change between module versions
m.prism.download -d

Download daily precipitation from 2020-01-01 to today:

# find the dataset name
m.prism.download -d | grep "daily" # found daily/ppt

# just list URLs for now
m.prism.download dataset=daily/ppt start_date=2020-01-01 end_date=today -u sep=newline

# actually download files
m.prism.download dataset=daily/ppt start_date=2020-01-01 end_date=today

# do something with the downloaded files
for file in $(m.prism.download dataset=daily/ppt start_date=2020-01-01 end_date=today -f sep=newline); do
    echo $file
    unzip $file
    # more tasks...
done

SEE ALSO

m.cdo.download, m.tnm.download

AUTHOR

Huidae Cho, New Mexico State University

SOURCE CODE

Available at: m.prism.download source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819