In [2]:
import numpy as np
import csv 
import math
import rasterio as rio
import affine

In [4]:
profile = {
    'crs': 'EPSG:4326',
    'nodata': -9999,
    'dtype': rio.float32,
    'height': 1800,
    'width': 3600,
    'count': 1,
    'driver':"GTiff",
    'transform': affine.Affine(0.1, 0, -180, 
              0, -0.1, 90)}

In [5]:
vessel_days = np.load("../../data/density/density2015.npy")

out_tif = "../../data/density/density_2015.tiff"

with rio.open(out_tif, 'w', **profile) as dst:
    dst.write(np.flipud(vessel_days).astype(profile['dtype']), indexes=1)

In [7]:
vessel_days = np.load("../../data/density/density_fishing2015.npy")

out_tif = "../../data/density/density_2015_fishing.tiff"

with rio.open(out_tif, 'w', **profile) as dst:
    dst.write(np.flipud(vessel_days).astype(profile['dtype']), indexes=1)

In [8]:
vessel_days = np.load("../../data/density/density2015_1000pings.npy")

out_tif = "../../data/density/density_2015_1000pings.tiff"

with rio.open(out_tif, 'w', **profile) as dst:
    dst.write(np.flipud(vessel_days).astype(profile['dtype']), indexes=1)

In [ ]: