Usage
The DcpMessage Class can be used to get messages from LRGS server.
Example Script
The script below demonstrates an example of using dcpmessage.
Warning
Replace <USERNAME>, <PASSWORD>, and <DCP ADDRESS> with your actual NOAA LRGS credentials and DCP address.
# main.py
import logging
from dcpmessage import DcpMessage
logging.basicConfig(
level=logging.INFO,
format='[%(levelname)s]\t%(asctime)s\t[%(pathname)s]\t[%(lineno)s]\t"%(message)s"',
datefmt="%Y-%m-%dT%H:%M:%S%z",
)
if __name__ == "__main__":
messages = DcpMessage.get(
username="<USERNAME>", # <-- your NOAA LRGS username
password="<PASSWORD>", # <-- your NOAA LRGS password
search_criteria={
"DRS_SINCE": "now - 2 hour",
"DRS_UNTIL": "now",
"SOURCE": ["GOES_SELFTIMED", "GOES_RANDOM"],
"DCP_ADDRESS": ["<DCP ADDRESS>"], # <-- your DCP addresses
},
host="cdadata.wcda.noaa.gov",
)
for message in messages:
print(message)
Quick Test with uv
To quickly install dcpmessage in a temporary environment with uv and run the script above, follow these steps:
Install
uv- refer to theuvwebsite.Copy the example script to create
main.pyscriptRun the script using
uv
uv run --with dcpmessage ./main.py