Vous regardez une version antérieure (v. /display/EDDSDLTEL/RPN+Python) de cette page.

afficher les différences afficher l'historique de la page

« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 6) afficher la version suivante »

General information

RPNPy is a Python module which can read and write records of RPN files. It contains wrappers for librmn’s main fstd98 and convip C functions along with helper functions.

You can get the official description by clicking on the following link: RPNPy Reference

Note: The RPN functions read and write only one record at the time, not the whole file at once like the NetCDF functions. You need to loop over all the records you want to read or write.

To get access to this module in Python you have to acquire it before opening Python. For example for Python3 with

module  load  python3/miniforge3  python3/python-rpn  python3/outils-divers
source  activate  base_plus

In your Python script you can then import the module with, for example:

import rpnpy.librmn.all as rmn             # Module to read RPN files

List information about module

In python you can get information about the module with...

List general information with

     help (rmn)

List fst-functions

     help (rmn.fstd98)

List basic functions

     help (rmn.base)

Get information about a specific function

For example:

     help (rmn.fstd98.fstlir)
     help (rmn.base.newdate)

List of main functions

Main fst-functions

   fstopt(optName, optValue, setOget=0) 
       Set or print FST option. Use to suppress excessive "talking" of the following fst-functions.

   fstopenall(paths, filemode='RND+R/O', verbose=None) 
        Open all fstfiles found in path

   fstcloseall(iunit, verbose=None) 
        Close all files associated with provided file unit number.

   fstlir(iunit, datev=-1, etiket=' ', ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ', dtype=None, rank=None, dataArray=None) 
        Reads the next record that matches the research keys

   fstlirx(key, iunit, datev=-1, etiket=' ', ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ', dtype=None, rank=None, dataArray=None) 
        Reads the next record after 'key' that matches the research keys

   fstlis(iunit, dtype=None, rank=None, dataArray=None) 
        Reads the next record that matches the research criterias

   fstinf(iunit, datev=-1, etiket=' ', ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ')
        Locates the next record that matches the research keys

   fstinfx(key, iunit, datev=-1, etiket=' ', ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ') 
        Locates the next record after 'key' that matches the research keys

   fstinl(iunit, datev=-1, etiket=' ', ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ', nrecmax=-1)
        Locate all the records matching the research keys

   fstluk(key, dtype=None, rank=None, dataArray=None) 
        Read the record at position given by key/handle found by 'fstinf', 'fstinfx', or 'fstinl'

   fstprm(key) 
        Get all the description parameters of the record needed for 'fstecr'

   fstecr(iunit, data, meta=None, rewrite=True) 
        Writes record to file previously opened with fnom+fstouv

Other fst-functions

   fst_edit_dir(key, datev=-1, dateo=-1, deet=-1, npas=-1, ni=-1, nj=-1, nk=-1, ip1=-1, ip2=-1, ip3=-1, typvar=' ', nomvar=' ', etiket=' ', grtyp=' ', ig1=-1, ig2=-1, ig3=-1, ig4=-1, datyp=-1, keep_dateo=False)
   fst_version()
   fsteff(key)
   fstfrm(iunit)
   fstlnk(unitList)
   fstnbr(iunit)
   fstnbrv(iunit)
   fstouv(iunit, filemode='RND+R/W')
   fstsui(iunit)
   fstvoi(iunit, options=' ')

Basic RPN functions






  • Aucune étiquette