a5 hydrometeorologic database management system
Project description
modis
Instalación
# instala dependencias
sudo apt update
sudo apt install postgresql postgresql-contrib gdal-bin python3-gdal libgdal-dev postgis postgresql-16-postgis-3
# crea ambiente de python e instala
python -m venv myenv
source myenv/bin/activate
pip install .
# asigna variables de ambiente (editar de ser necesario)
DBNAME=modis
DBUSER=modis
DBPASSWORD=modis
DBHOST=localhost
DBPORT=5432
# crea base de datos (necesita loguearse como superusuario)
createdb -h $DBHOST -p $DBPORT $DBNAME
psql $DBNAME -c "CREATE USER $DBUSER WITH SUPERUSER PASSWORD '$DBPASSWORD';" -h $DBHOST -p $DBPORT
psql $DBNAME -c "CREATE EXTENSION postgis" -h $DBHOST -p $DBPORT
psql $DBNAME -c "CREATE EXTENSION postgis_raster" -h $DBHOST -p $DBPORT
psql $DBNAME -c "ALTER DATABASE $DBNAME SET postgis.gdal_enabled_drivers TO 'ENABLE_ALL';"
sudo service postgresql restart
# configura
a5py_config
nano $HOME/.a5py.ini
# crea tablas
a5py create_tables -u "postgresql://$DBUSER:$DBPASSWORD@$DBHOST:$DBPORT/$DBNAME"
Configuración
# genera archivo de configuración
a5py_config
# editar los parámetros de conexión a la base de datos (db_params) y otros parámetros
nano $HOME/a5py.ini
Uso
# create schema
a5py create_tables -u postgresql://modis:modis@localhost:5432/a5_test
# insert serie rast
a5py create -m SerieRast '{"id":19, "fuentes_id":40}' -u postgresql://modis:modis@localhost:5432/a5_test
# insert rast
python we2db.py -r $HOME/modis/output -D postgresql://modis:modis@localhost:5432/a5_test -o /tmp/inserted_rast.json -i 19
# insert area
a5py create -m Area $HOME/Downloads/area_138.json -g -u postgresql://modis:modis@localhost:5432/a5_test
# insert serie areal
a5py create -m SerieAreal '{"id":1,"area_id":138, "var_id": 30, "proc_id": 5, "unit_id": 14, "fuentes_id": 40, "nombre:"Picasa - we"}' -u postgresql://modis:modis@localhost:5432/a5_test
# rast2areal
a5py rast2areal 19 138 2009-01-25 2009-02-10 -a mean -i -s 1 -o /tmp/obs_areal.json -u postgresql://modis:modis@localhost:5432/a5_test
# exporta raster de base de datos a geotiff
a5py export 2009-02-10 modis_we_20090210.tif
Todos los comandos y sus opciones
TODO
- import gdal
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
a5py-0.1.tar.gz
(27.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
a5py-0.1-py3-none-any.whl
(24.3 kB
view details)
File details
Details for the file a5py-0.1.tar.gz.
File metadata
- Download URL: a5py-0.1.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abafc4d30dfc087eee3447e8e34014edb12becff7fe5bcc6ce7b962140506061
|
|
| MD5 |
523dea548b71ea4ec2002b9b9a95cbcf
|
|
| BLAKE2b-256 |
20c29ff407f71e6a8ebebeec034a5e5d94ee51ddd61996f41761d5f5e70b0a52
|
File details
Details for the file a5py-0.1-py3-none-any.whl.
File metadata
- Download URL: a5py-0.1-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cf9746e557e4e54d9a253304061cc101269855cb36ca4da500b32e3954d7e9a
|
|
| MD5 |
1c2747ab898ece28c8b6a0d5a36f1265
|
|
| BLAKE2b-256 |
d16a82d8d9da67082b499e30b07b36e2ca78ec2c8dc3085fef67a967f56e4c3f
|