Skip to main content

A python wrapper on RFa for FA files using Xarray

Project description

PyFa-tool

Python wrapper on Rfa using Xarray. The goal of this package is to import FA files into Xarray and provide basic and user friendly commands for inspecting FA files.

Required software and install

This package is developed for Linux distributions with a Python3 installation. In addition, R should be installed and the Rfa library as well.

For the most stable versions use the github main, or use the version on PyPI. Install this with:

pip install PyFa-tool --upgrade

Setup

There are two ways to use the PyFa package:

  • Use this as a python package to convert FA to Xarray, and make your own analysis
  • Use this as backand for shell commands to make some basic visualisations.

Python package usage

To use PyFa as a package, import it and try the available functions:

import pyfa_tool as pyfa

# Get available fields
fielddf = pyfa.get_fields(fa_filepath=path_to_fa_file)
print(fielddf) #Note that not all rows are printed (default pandas settings).


# convert to an Xarray.DataArray
dxr = pyfa.FA_to_Xarray(fa_filepath=path_to_fa_file,
                 fieldname='SURFTEMPERATURE',
                 target_crs='EPSG:4326')
# info and plotting:
print(dxr) #Don' panic if you see Nan's in the data, this is often so for the corners because of reprojecting.
dxr.plot() #Matplotlib backend

Setup the shell commands

To use this package as a shell command, execute following python code only once:

import pyfa_tool as pyfa
pyfa.setup_shell_command()

Restart a terminal, and you are ready to go. This file will add the pyfa alias to your ~\.bashrc file, and will propagate arguments to the python package.

Shell Usage

The FA file, and some settings are given throug arguments ex.:

pyfa FA_file --print_fields --proj=EPSG:4326 --save

To see all possible arguements run pyfa -h. (Don't forget to setup the shell commands first)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfa_tool-0.0.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfa_tool-0.0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pyfa_tool-0.0.1.tar.gz.

File metadata

  • Download URL: pyfa_tool-0.0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.18 Linux/5.15.0-89-generic

File hashes

Hashes for pyfa_tool-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7ba3cc37155ededc317190be4b7b80f99f5b9662a1b1b2eb61d3a0b79f8da1d3
MD5 d75d6c1725e2acd159fe05e3f1fa2f32
BLAKE2b-256 a1c7ec768d16d97c5aaef3149ed510c3375b2248820010a374883f3d889fdb39

See more details on using hashes here.

File details

Details for the file pyfa_tool-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyfa_tool-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.18 Linux/5.15.0-89-generic

File hashes

Hashes for pyfa_tool-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2fc6d4dd11d3da4bf4cc525d8db9d41f9a48f04ca046b30e219ac5c912727c0
MD5 ef25622f1c5fa2f9af8de9d20b123284
BLAKE2b-256 2c30cc2d0e29132ab1039ac46c48ff91194ad1889effd52bb62b86bd12b9a5c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page