snowex_db.upload.rasters module#

class snowex_db.upload.rasters.UploadRaster(session, filename, epsg, use_s3=True, no_data=None, cog_dir='./snowex_cog_storage', doi=None, measurement_type=None, units=None, date=None, use_sso=True, **kwargs)[source]#

Bases: BaseUpload

Class for uploading a single tifs to the database. Utilizes the raster2pgsql command and then parses it for delivery via python.

TABLE_CLASS#

alias of ImageData

submit()[source]#

Submit the data to the db using ORM. This uses out_db rasters either locally or in AWS S3.

snowex_db.upload.rasters.ensure_sso_env(profile: str) dict[source]#

Ensure AWS_* environment vars are set using an SSO profile. Requires awscli v2 and that you’ve already done aws sso login –profile <profile> (this function can also try to call it). Returns the dict of vars it set.