Skip to content

Commit

Permalink
Minor fixes for .all aeronet files
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanwp committed Jan 22, 2019
1 parent 91f740e commit 875c831
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 10 additions & 5 deletions cis/data_io/aeronet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

defaultdeletechars = """~!@#$%^&*=+~\|]}[{'; /?.>,<"""

AERONET_HEADER_LENGTH = {"AERONET-SDA/2" : 5, "AERONET/2" : 5, "MAN-SDA/2" : 5, "MAN/2" : 5,
"AERONET-SDA/3" : 7, "AERONET/3" : 7}
AERONET_MISSING_VALUE = {"AERONET-SDA/2" : 'N/A', "AERONET/2" :'N/A', "MAN-SDA/2" : -999.0, "MAN/2" : (-999.0, -10000),
"AERONET-SDA/3" : -999.0, "AERONET/3" : -999.0}
AERONET_HEADER_LENGTH = {"AERONET-SDA/2": 5, "AERONET/2": 5, "MAN-SDA/2": 5, "MAN/2": 5,
"AERONET-SDA/3": 7, "AERONET/3": 7}
AERONET_MISSING_VALUE = {"AERONET-SDA/2": 'N/A', "AERONET/2": 'N/A', "MAN-SDA/2": -999.0, "MAN/2": (-999.0, -10000),
"AERONET-SDA/3": -999.0, "AERONET/3": -999.0}

V2_HEADER = "Version 2 Direct Sun Algorithm"
V3_HEADER = "AERONET Version 3;"
V3_HEADER = "AERONET Version 3"

AERONET_COORDINATE_RENAME = {
"Date(dd:mm:yy)" : "date",
Expand All @@ -25,11 +25,15 @@
"Time_(hh-mm-ss)" : "time",
"Latitude" : "latitude",
"Longitude" : "longitude",
"Latitude(Degrees)": "latitude",
"Longitude(Degrees)": "longitude",
"Site_Latitude(Degrees)" : "latitude",
"Site_Longitude(Degrees)" : "longitude",
"Site_Elevation(m)" : "altitude",
"Elevation(m)": "altitude"
}


def get_slice_of_lines_from_file(filename, start, end):
"""Grab a subset of lines from a file, defined using slice-style start:end.
Expand All @@ -38,6 +42,7 @@ def get_slice_of_lines_from_file(filename, start, end):
with open(filename) as fileobj:
return list(islice(fileobj, start, end))


def get_aeronet_version(filename):
"""
Classifies the format of an Aeronet file based on it's header.
Expand Down
4 changes: 3 additions & 1 deletion cis/data_io/products/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def get_file_type_error(self, filename):

class Aeronet(AProduct):
def get_file_signature(self):
return [r'.*\.lev20', r'.*\.ONEILL_lev20', r'.*\.ONEILL_20', r'.*\.lev15', r'.*\.ONEILL_lev15', r'.*\.ONEILL_15', r'.*All_Sites_Times.*dat']
return [r'.*\.lev20', r'.*\.ONEILL_lev20', r'.*\.ONEILL_20', r'.*\.lev15',
r'.*\.ONEILL_lev15', r'.*\.ONEILL_15', r'.*All_Sites_Times.*dat',
r'.*\.all']

def _create_coord_list(self, filenames, data=None):
from cis.data_io.ungridded_data import Metadata
Expand Down

0 comments on commit 875c831

Please sign in to comment.