Command line tools

The faampy module provides a number of command line tools. All those commands are called via:

faampy SUBCOMMAND [OPTIONS] ARGUMENTS

A list of available subcommands is shown by just typing “faampy” on the command line.

nimrod_to_nc

This script converts the NIMROD weather radar data format into a netCDF with the dimensions:

  • Timestamp
  • Longitude
  • Latitude

The original array in the NIMROD data fits the OSGB 1936 spatial reference (EPSG:27700) system. However, to make the raster work with for example cis it is necessary to warp the array to WGS84 (EPSG:4326) so that longitude and latitude are available as dimensions.

The new netCDF results were tested with the cistools. If the netCDF stores more than one timestamp it is necessary to extract one layer using the subset command like this:

cis subset rain_intensity:nimrod.nc timestamp=['2012-03-04T00:50'] -o nimrod_20120304T0050.nc

The above command extracts the data for the timestamp ‘2012-03-04T00:50’ and writes a new netCDF with the filename “nimrod_20120304T0050.nc”.

In a next step it is possible to plot the data as a heatmap:

cis plot rain_intensity:nimrod_20120304T0050.nc

Maybe there is a way to skip the subset step but so far I have not found it.

usage: faampy nimrod_to_nc [-h] [-n NUMBER_OF_PROCESSES] [-o OUTPATH]
                           rain_radar_tar_file

Positional Arguments

rain_radar_tar_file
 MetOffice compressed rain radar file

Named Arguments

-n, --number_of_processes
 Number of processes that can be used.
-o, --outpath Directory where the netCDF file will be stored. Default: $HOME.

nc_to_gpx

Creates a gpx file from a FAAM core netcdf data file.

GPX files are a standard xml-format, which is understood by many programs. The gpx file from a flight can for example be used to georeference photographs taken during a flight (e.g. gpscorrelate).

The geotagged images can then in a next step be overlaid on maps using the GPS information from the image metadata.

usage: faampy nc_to_gpx [-h] ncfile [outpath]

Positional Arguments

ncfile input netCDF-file
outpath file name of output file

ge_avaps

ge_flight_track

ge_ncas_airquality

Script downloads the model output from the NCAS air quality model and creates a kmz file that is viewable in google-earth. This allows for example FAAM flight tracks to be overlaid on top of the model images.

usage: faampy ge_ncas_airquality [-h] [-o OUTPATH] [-d DATE] [-l LIMIT]

Named Arguments

-o, --outpath outpath
-d, --date date in the format: %Y-%m-%d
-l, --limit maximum number of model images to be processed

ge_nimrod_to_kmz

Extracts all rain radar data from the tar file and:

  • creates a 8bit png image file with a custom colour palette
  • convertes the png to a gtiff and adds the projection ESPG:27700=OSGB1936
  • warpes the gtiff image to EPSG:4326
  • creates one kmz file with a folder which contains all gtiff-4326 files as groundoverlays

The original UKMO nimrod data files can be downloaded from CEDA.

Note

The script is very wasteful in terms of disk space. The temporary folder that is created for storing the image files can grow to several GB. The script deletes the temporary folder by default.

usage: faampy ge_nimrod_to_kmz [-h] [-o OUTPATH] [-k] rain_radar_tar_file

Positional Arguments

rain_radar_tar_file
 MetOffice compressed rain radar file

Named Arguments

-o, --outpath Directory where the kmz file will be stored. Default: $HOME.
-k, --keep-folder
 If option is set the temporary directory will not be deleted. Default: False

ge_photo_album

Photo album creator for google-earth from georeferenced photos. Script produces a kmz files for google-earth with all the photos in the input folder. The images need to contain GPS location information. This kind of information can be added to the image files using a tool like gpscorrelate and a gpx file which contains the track of the flight.

usage: faampy ge_photo_album [-h] path outfile

Positional Arguments

path directory which holds the photographs. All photographs in the directory will be added to the photo album.
outfile outfile name

ge_ncvar_to_kml

Creates a profile plot for a specfic netCDF variable that is viewable in google-earth.

usage: faampy ge_ncvar_to_kml [-h] [--offset OFFSET]
                              [--scale_factor SCALE_FACTOR]
                              [--time_lag TIME_LAG] [--fltsumm FLTSUMM]
                              ncvar faam_core_netcdf outpath

Positional Arguments

ncvar FAAM core netCDF variable name used for the profile.
faam_core_netcdf
 FAAM core netCDF data file
outpath Path to where the kml file is written to.

Named Arguments

--offset Offset value. Value is removed from variable before profiles are created
--scale_factor Scaling factor, mulitplier for the netCDF variable.
--time_lag time lag between variable and GIN measurement caused by inlets
--fltsumm Path to flight summary file for the specific flight

ge_was_to_kmz

WAS (Whole Air Sample) log as google-earth overlay. The flight track covered during the time the bottle was filled is represented as a line.

usage: faampy ge_was_to_kmz [-h] was_log_file ncfile outpath

Positional Arguments

was_log_file Input WAS log file or folder which contains log files
ncfile input netCDF-file or path to netcdf files
outpath outpath for kmz file

sat_tracker

More satellite track information can be found at:

Popular platforms:

Platform Sensor ID
CALIPSO   29108
ISS CATS 25544
TERRA MODIS 25994
LANDSAT8   39084
SENTINEL-2A   40697
SENTINEL-3A   41335

Example:

faampy sat_tracker track --show_map "-38 35 -20 43" 39084 13-02-2017 17-02-2017 60

usage: faampy sat_tracker [-h] {sat_list,track} ...

Sub-commands:

sat_list

Undocumented

faampy sat_tracker sat_list [-h] [sat_name]
Positional Arguments
sat_name shows list of available satellites and their IDs

track

Undocumented

faampy sat_tracker track [-h] [-w] [-m [SHOW_MAP]]
                         [sat_id [sat_id ...]] start_time end_time timestep
Positional Arguments
sat_id Satellite ID(s). If more than one satellite track should be calculated the ids should be separated by commas
start_time date in the format DD-MM-YYYY or dd-mm-YYYYTHH:MM:SS
end_time date in the format DD-MM-YYYY or dd-mm-YYYYTHH:MM:SS
timestep Timestep in seconds
Named Arguments
-w, --write_to_file
 If flag is set the output is stored to a file in the $HOME directory. Default: False
-m, --show_map Boundary for the map in the form “left_longitude bottom_latitude right_longitude top_latitude”. The input has

plt_quicklooks

qa_report