Catalog PyPI
PACKAGE EXPLORERView in registry

a5py

PyPI

a5 hydrometeorologic database management system

Versions collected1
Direct dependencies7From release 0.1.4
Last observed20 Oct, 16:44 UTC

README

Version 0.1.4 documentation

a5py

a5 hydrometeorologic database management system

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
# instala versión correspondiente de gdal para python
python scripts/pre_install.py
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

Credits

Instituto Nacional del Agua

Ezeiza, Buenos Aires, Argentina

2024

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.429 Jan 20257

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
jbianchi81/a5_client

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:44 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:eee77be905ba7981c5abc238f6c69c3ce7d77c00fc026dceb51d6e2a1f5b8930