-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from GAD-DIMNT-CPTEC/issuefix_27
Issuefix 27
- Loading branch information
Showing
64 changed files
with
9,181 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: readDiag | ||
name: readDiag.issuefix_27 | ||
channels: | ||
- conda-forge | ||
- pyviz | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,63 @@ | ||
#!/usr/bin/env python | ||
#-----------------------------------------------------------------------------# | ||
# Group on Data Assimilation Development - GDAD/CPTEC/INPE # | ||
#-----------------------------------------------------------------------------# | ||
#BOP | ||
# | ||
# !SCRIPT: | ||
# | ||
# !DESCRIPTION: | ||
# | ||
# !CALLING SEQUENCE: | ||
# | ||
# !REVISION HISTORY: | ||
# 24 Apr 2018 - J. G. de Mattos - Initial Version | ||
# | ||
# !REMARKS: | ||
# | ||
#EOP | ||
#-----------------------------------------------------------------------------# | ||
#BOC | ||
|
||
import csv | ||
import yaml | ||
from os import path | ||
|
||
def getVarInfo(kx,var,feature): | ||
|
||
class dataSourcesInfo: | ||
""" | ||
A class to parse and store information from a YAML file containing observations data. | ||
Attributes: | ||
tab (dict): A dictionary to store the parsed observations data. | ||
""" | ||
def __init__(self): | ||
""" | ||
The constructor for dataSourcesInfo class. Reads from a YAML file and initializes the 'tab' attribute. | ||
""" | ||
yaml_file = path.join(path.dirname(__file__), 'table.yml') | ||
|
||
with open(yaml_file, 'r') as file: | ||
self.data = yaml.safe_load(file) | ||
|
||
self.tab = {} | ||
for observation in self.data['observations']: | ||
kx = observation['kx'] | ||
self.tab[kx] = {} | ||
for detail in observation['details']: | ||
var = detail['var'] | ||
self.tab[kx][var] = detail | ||
|
||
|
||
def getVarInfo(kx, var, feature): | ||
""" | ||
Retrieves information for a specified feature based on the kx and variable. | ||
Args: | ||
kx (int): The kx value to look up. | ||
var (str): The variable to look up. | ||
feature (str): The specific feature to retrieve information about. | ||
Returns: | ||
The value of the requested feature if found, otherwise None. | ||
""" | ||
dataInfo = dataSourcesInfo() | ||
|
||
# | ||
# verify if request exist | ||
# | ||
# verify if request exists | ||
if kx in dataInfo.tab: | ||
if var in dataInfo.tab[kx]: | ||
if feature in dataInfo.tab[kx][var]: | ||
return dataInfo.tab[kx][var][feature] | ||
else: | ||
print('Invalid Feature request:',feature) | ||
print('try use:') | ||
print('Invalid Feature request:', feature) | ||
print('Try using one of:') | ||
for item in dataInfo.tab[kx][var]: | ||
print('\t*',item) | ||
print('\t*', item) | ||
else: | ||
print('Variable',var,'doesn\'t exist in kx',kx) | ||
print('try use:') | ||
print('Variable', var, 'doesn\'t exist in kx', kx) | ||
print('Try using one of:') | ||
for item in dataInfo.tab[kx]: | ||
print('\t*',item) | ||
print('\t*', item) | ||
else: | ||
print('Invalid kx request:', kx) | ||
print('try request:') | ||
print('Try using one of:') | ||
for item in dataInfo.tab: | ||
print('\t*',item) | ||
|
||
|
||
class dataSourcesInfo: | ||
|
||
def __init__(self): | ||
|
||
tableFile = path.join(path.dirname(__file__), 'table') | ||
|
||
with open(tableFile) as csv_data: | ||
reader = csv.reader(csv_data,skipinitialspace=True,delimiter=';') | ||
# eliminate blank rows if they exist | ||
rows = [row for row in reader if row] | ||
# rows.remove(['']) | ||
headings = rows[0] # get headings | ||
self.tab = {} | ||
for row in rows[1:]: | ||
kx = int(row[0]) | ||
dic = {row[1]:dict(zip(headings[2::],row[2::]))} | ||
if kx in self.tab: | ||
self.tab[kx].update(dic) | ||
else: | ||
self.tab.update({kx:dic}) | ||
|
||
|
||
|
||
#EOC | ||
#-----------------------------------------------------------------------------# | ||
print('\t*', item) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.