ExtractRamiFiles (version 1.0)
index
/mnt/data2/home/cajgfingert/DART/Scripts/ScriptsRami/ExtractRamiFiles.py

Functions to extract the BRF data and store them in the ROMC format

 
Modules
       
argparse
array
scipy.interpolate
math
xml.dom.minidom
numpy
os
random
shutil
struct
subprocess
sys
time

 
Functions
       
ExtractData(SimulationsFolder, ResultsFolder, SimulationName)
Extract and write the brf files (all, mlt,co_sgl and uc_sgl) of a simulation according to the ROMC format
Input:
------
arg:
  - SimulationsFolder: path to the simulation
  - ResultsFolder: folder where to store the results files
  - SimulationName: name of the simulation
ExtractDataInList(SimulationsFolder, SimulationsList, ResultsFolder)
Extract and write the brf files (all, mlt,co_sgl and uc_sgl) of a simulation according to the ROMC format for every simulation in the given list
Input:
------
arg:
  - SimulationsFolder: path to the simulation
  - SimulationsList: list of simulation names to treat
  - ResultsFolder: folder where to store the results files
getBrf(PathToBrfFile, band, AzimuthAngle)
Return the tables of BRF in the BRF file  along the given azimuth angle, for the sun principal plane and the opposite plane
Input:
------
arg:
  - PathToBrfFile: path to the BRF file to read
  - band: spectral band index to read
  - AzimuthAngle: wanted azimuth angle
    
Return:
-------
  - BrfInAzimuthPlaneRami: table of brf in the sun principal plane for angles from 1 to 75 in 2 degrees steps in the direct direction
  - BrfInAzimuthPlaneRamiPi: table of brf in the sun principal plane for angles from -75 to -1 in 2 degrees steps in the direct direction
  - BrfInOppositePlaneRami: table of brf in the sun opposite plane for angles from 1 to 75 in 2 degrees steps in the direct direction
  - BrfInOppositePlaneRamiPi: table of brf in the sun opposite plane for angles from -75 to -1 in 2 degrees steps in the direct direction
getBrfInPlane(BrfTab, AzimuthAngle)
Return the table of BRF in the BrfTab along the given azimuth angle
Input:
------
arg:
  - BrfTab: table with 3 columns: 
    View zenith angles (VZA)
    View Azimuth angles (VAA)
    BRF
  - AzimuthAngle: wanted azimuth angle
    
Return:
-------
  - VZABrfInAzimuthPlane: table of selected VZA
  - BrfInAzimuthPlane: table of selected BRF
getFirstOrder(PathToBRF)
Get the BRF first order iteration folder ORDER1. Return an error if non-existent
Input:
------
arg:
  - PathToBRF: path the the folder containing the BRF folders
    
Return:
-------
  - Name of the folder to use
getLastIter(PathToBRF)
Get the BRF last iteration folder ITERX. If non-existent, return the highest order, with a maximum at ITER100 
Input:
------
arg:
  - PathToBRF: path the the folder containing the BRF folders
    
Return:
-------
  - Name of the folder to use
writeRamiFile(FileName, ResultsFolder, data, dataPi, SZA, Plane)
Write the given brf in a file according to the ROMC specifications 
Input:
------
arg:
  - FileName: name of the results file to create
  - ResultsFolder: folder where to store the results file
  - data: table of brf in the direct direction to store (1 to 75)
  - dataPi: table of brf in the opposite direction to store (-75 to -1)  
  - SZA: solar azimuth angle
  - Plane: principal (0) or opposite (PI/2) plane

 
Data
        ModelName = 'dart'
RAMIAngles = [1.309, 1.27409, 1.23918, 1.20428, 1.16937, 1.13446, 1.09956, 1.06465, 1.02974, 0.994838, 0.959931, 0.925025, 0.890118, 0.855211, 0.820305, 0.785398, 0.750492, 0.715585, 0.680678, 0.645772, ...]
__author__ = 'Cajgfinger T.'
__credits__ = 'CESBIO'
__version__ = '1.0'
degToRad = 0.017453292519943295
radToDeg = 57.29577951308232
separator = '/'

 
Author
        Cajgfinger T.

 
Credits
        CESBIO