API (List of modules and functions)

Code is divided into the following modules:

Gridder

calculate_gridcell_areas Calculates the area of each of the grid-cells in the domain (in km^2)
grid_merger Combines several gridded files into one
gridder Counts “pings” inside a grid-cell and computes “Ship minutes per km2”
mergedgrid_to_shp Converts a gridded file into a shapefile
grid_to_esriascii Writes ESRI ASCII file from gridded data
gridder.getWKT_PRJ Downloads and returns geospatial parameters given an epsg code
gridder.gridder_pingsPerCell Counts “pings” inside a gridcell and computes “No.

Mapper

make_basemap Makes a basemap
map_density Plots a map using a gridded (or merged) file
map_dots Creates a map of “pings” rather than gridded density
map_dots_one_ship Creates a map of “pings” (i.e.
save_basemap Saves basemap (and correspoding info.grid) to a pickle file
mapper.load_my_cmap Creates and loads custom colormap
mapper.define_path_to_map Figures out where is the .basemap and .grid files
mapper.make_legend_text Makes text for legend in left block of map

Info_Object

attrs_to_info Appends attributes to info object
data_to_info Reads metadata from data source (i.e.
info info class makes and ‘info object’ which contains all the metadata needed to run a project.
info_to_attrs Extracts attibutes from info object
load_info Loads “info” file
make_info_from_GridData Makes info object and populates its metadata from .basemap and .grid files
info_object.auto_update Updates some metadata in info file

Converters

bulk_convert_to_nc Converts ALL raw files in a directory into “Standard” .nc ship_mapper files
bulk_update_attributes Updates attributes in ALL files in a directory
convert_to_nc Import appropiate converter, which is a file in folder “converters” within this module, or a customade file in the “path” folder

Included converter files:

Utils

align_with_grid Finds which gridcell contains a given lat/lon point
checkDir Check if directory exists.
degrees_to_meters Converts degrees to meters
distance Estimates distance between 2 points on Earth.
elapsed_days Estimates elapsed days
estimate_velocity Estimates velocity (in knots) given seconds elapsed to cover a distance (in meters)
get_all_files Returns all files within a directory
get_filename_from_fullpath Returns the filename given a fullpath to a file
get_path_from_fullpath Returns the path to a file given a fullpath to the file
interp2d Interpolated between 2 points
make_mydirs Makes directories needed for project
spatial_filter Returns only the “pings” within a defined box.
stop Stop
write_info2data Writes metadata from info object to the attibutes section in the data

Oracle

oracle.download_vms Downloads VMS data from oracle database
oracle.filter_by_gear Filters data by gear type