Skip to content
Snippets Groups Projects
Commit 731e0925 authored by Christoph Knote's avatar Christoph Knote
Browse files

Aye

parent 3354d5db
No related branches found
No related tags found
No related merge requests found
.Phony: coverage
coverage:
coverage run --source=tests -m unittest discover && coverage report && coverage html
from .dataset import Dataset, SimpleNormalComments, StandardNormalComments
\ No newline at end of file
from .dataset import Dataset, StandardNormalComments
\ No newline at end of file
This diff is collapsed.
......@@ -8,6 +8,7 @@ def read(filename):
setup(name='icartt',
description='ICARTT format reader and writer',
long_description=read('README.rst') + '\n\n' + read('INSTALL.rst') + '\n\n' + read('CHANGES.rst'),
long_description_content_type='text/markdown',
version='1.0.1',
url='https://boxmodeling.meteo.physik.uni-muenchen.de',
author='Christoph Knote',
......@@ -30,4 +31,6 @@ setup(name='icartt',
],
keywords='',
packages=['icartt'],
test_suite = 'tests',
tests_require = [],
zip_safe=False)
68, 2110, V02_2016
MAHONEY, MJ
M/S 169-237; Jet Propulsion Laboratory; Pasadena, CA 91109-8099
MTP - Microwave Temperature Profiler
SEAC4RS
1, 1
2013, 08, 01, 2013, 08, 18
0, 0
Palt[], meters, Pressure_Altitude, Pressure_Altitude_array
Start_UTC, seconds, Time_Start, elapsed time from 0000 UTC
4
1.0, 1.0, 1.0, 1E+21
-99999, -99999, -99999, -99999
Temperature[], K, Temperature, Temperature_array
Temperture_SE[], K, Temperature_Standard_Error, Temperature_Standard_Error_array
Geometric_altitude[], meters, Geometric_Altitude, Geometric_Altitude_array
Molecular_air_density[], number_per_cubic_meter, Molecular_air_density, Molecular_air_density_array
17
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999
NZ, none, number_of_altitudes_in_data_record
Stop_UTC, seconds, Time_Stop, end of scan
Mid_UTC, seconds, Time_Mid, horizon location of scan
Zp, km, Pressure_altitude
Pitch, deg, Aircraft_Pitch
Roll, deg, Aircraft_Roll
OAT, K, Outside_air_temperature
Zt1, km, Tropopause_1_pressure_altitude
Zt2, km, Tropopause_2_pressure_altitude
PTt1, K, Potential_Temperature_tropopause_1
PTt2, K, Potential_Temperature_tropopause_2
Latitude, deg, Aircraft_Latitude
Longitude, deg, Aircraft_Longitude
LRac, K/km, Lapse_Rate_at_Flight_Level
MRI, none, Retrieval_quality_metric
Tcp, K, Cold_point_temperature
Zcp, km, Cold_point_pressure_altitude
1
*** Preliminary Data Preliminary Data Preliminary Data Preliminary Data Preliminary Data ***
19
Here's a brief free-form tutorial on how to decipher the MTP data:
Data groups consist of the following group of lines per 15-second observing cycle.
First line is: UTstart, number of retrieval levels, UTend, UTmid, Pressure Altitude, Pitch, Roll, Outside air temp (K), tropopause altitude #1 (km), tropopause altitude #2 (km) [if present], potential temperatures of tropopause #1 and #2, latitude, longitude, & lapse rate near flight level.
Remaining set of lines for each cycle consist of 5 columns: col#1 is pressure altitude (meters), col#2 is temperature from MTP (Kelvin), col#3 is temperature error estimate (K), col#4 is geometric altitude (meters), based on GPS altitude (meters), and col#5 is molecular air density [1E+21/m3].
PI_CONTACT_INFO: M/S 246-102; Jet Propulsion Laboratory; Pasadena, CA 91109- 8099; Michael.J.Mahoney@jpl.nasa.gov
PLATFORM: NASA Global Hawk 872
LOCATION: see http://espoarchive.nasa.gov/archive/info ASSOCIATED_DATA: See http://espoarchive.nasa.gov/archive/browse/attrex INSTRUMENT_INFO: See http://mtp.jpl.nasa.gov/
DATA_INFO: See text above
UNCERTAINTY: Contact PI
ULOD_FLAG: -7777
ULOD_VALUE: N/A
LLOD_FLAG: -8888
LLOD_VALUE: N/A
DM_CONTACT_INFO: M/S 169-237; Jet Propulsion Laboratory; Pasadena, CA 91109-8099; Michael.J.Mahoney@jpl.nasa.gov
PROJECT_INFO: SEAC4RS mission 01 August - 30 September 2013; DAOF and Ellington Field, Houston, Texas
STIPULATIONS_ON_USE: Use of these data should be done in consultation with the PI OTHER_COMMENTS:
REVISION: R0
R0: Preliminary Data
Start_UTC, NZ, Stop_UTC, Mid_UTC, Zp, Pitch, Roll, OAT, Zt1, Zt2, PTt1, PTt2, Latitude, Longitude, LRac, MRI, Tcp, Zcp, Palt[], Temperature[], Temperture_SE[], Geometric_altitude[], Molecular_air_density[]
77381, 0, 77394, 77386, 6.358, 15.8, -0.2, 261.9, -9999, -9999, -9999, -9999, 34.779, -118.165, -9999, 0.25, 200.66, 15.36
77394, 0, 77407, 77399, 6.618, 11.9, -0.6, 259.7, -9999, -9999, -9999, -9999, 34.792, -118.171, -9999, 0.17, 202.05, 15.62
77407, 13, 77420, 77412, 6.790, 6.1, 0.2, 258.2, 15.2, 99.9, 373.2, 999.9, 34.805, -118.177, -6.7, 0.21, 201.61, 15.79
13690, 208.0, 1.4, 14295, 5150
10790, 229.1, 1.0, 11364, 7387
9290, 241.3, 0.8, 9775, 8827
8390, 248.4, 0.7, 8816, 9799
7790, 252.3, 0.5, 8176, 10526
7290, 255.6, 0.4, 7643, 11160
6940, 257.9, 0.2, 7270, 11623
6640, 259.7, 0.3, 6950, 12035
6290, 262.3, 0.5, 6577, 12512
5790, 265.6, 0.8, 6045, 13239
5211, 269.0, 1.0, 5429, 14142
4343, 274.6, 1.0, 4506, 15559
1834, 288.6, 9.1, 1839, 20460
77621, 14, 77634, 77626, 10.279, 6.1, -0.1, 230.2, 15.0, 99.9, 386.7, 999.9, 35.058, -118.258, -5.1, 0.32, 210.34, 15.48
17179, 211.0, 1.3, 17650, 2929
14279, 213.0, 1.4, 14814, 4582
12779, 218.4, 1.1, 13314, 5662
11879, 221.8, 0.8, 12397, 6425
11279, 225.0, 0.5, 11776, 6963
10779, 228.1, 0.3, 11252, 7433
10429, 229.9, 0.2, 10885, 7789
10129, 231.3, 0.2, 10571, 8109
9779, 233.2, 0.3, 10206, 8485
9279, 236.2, 0.4, 9686, 9034
8679, 240.0, 0.6, 9062, 9720
7779, 246.8, 0.8, 8125, 10777
6279, 259.0, 0.9, 6554, 12691
3779, 279.4, 1.2, 3910, 16472
54, 2110
PI LastName, First Name
Code 916, Goddard Space Flight Center, Greenbelt, MD 20771
AROTAL
PAVE Mission
1, 1
2005, 02, 03, 2006, 01, 18
1
Altitude[], meters, Altitude_array
UTC, XX.XXXX_hours_from_0_hours_on_flight_date
7
0.1, 0.0001, 0.1, 0.01, 0.0001, 0.1, 0.0001
-9999, -999999, -999999, -999999, -999999, -99999, -999999
TempK[], K, Temperature_array
Log10_NumDensity[], part/cc, Log10_NumDensity_array
TempK_Err[], K, Temperature_error_array
AerKlet[], Klet, Aerosol_array
Log10_O3NumDensity[], part/cc, Log10_Ozone_NumDensity_array
O3_MR[], ppb, Ozone_mixing_ratio_array
Log10_O3NumDensity_Err[], part/cc, Log10_NumDensity_error_array
11
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999
NumAlts, none, Number_of_altitudes_reported
Year, UT
Month, UT
Day, UT
AvgTime, xxx.x_minutes, Averaging_time_of_presented_data
Latitude, degrees
Longitude, degrees
PAlt, meters, pressure_altitude
GPSAlt, meters, GPS_altitude
SAT, K, Static_air_temperature
SZA, degrees
0
18
PI_CONTACT_INFO: Enter PI Address here
PLATFORM: NASA DC8
LOCATION: Lat, Lon, and Alt included in the data records
ASSOCIATED_DATA: N/A
INSTRUMENT_INFO:N/A
DATA_INFO:N/A
UNCERTAINTY: Contact PI
ULOD_FLAG: -7777
ULOD_VALUE: N/A
LLOD_FLAG: -8888
LLOD_VALUE: N/A
DM_CONTACT_INFO: Enter Data Manager Info here
PROJECT_INFO: PAVE MISSION: Jan-Feb 2005
STIPULATIONS_ON_USE: Use of these data should be done in consultation with the PI
OTHER_COMMENTS: N/A
REVISION: R0;
R0: Version 2005-0: AROTAL T & O3 Rayleigh Retrievals. Further revisions may be needed to fine-tune aerosol characterization.
UTC, NumAlts, Year, Month, Day, AvgTime, Latitude, Longitude, PAlt, GpsAlt, SAT, SZA, Altitude[], TempK[], Log10_NumDensity[], TempK_Err[], AerKlet[], Log10_O3NumDensity[], O3_MR[], Log10_O3NumDensity_Err[]
54000, 9, 2005, 2, 3, 0, 42.308, -70.582, 6910, 6979, 242.5, 65.5
9154, -9999, -999999, -9999, -9999, 113178, 212, -999999
9304, -9999, -999999, -9999, -9999, 123353, 2250, -999999
9454, -9999, -999999, -9999, -9999, 123008, 2116, -999999
9604, -9999, -999999, -9999, -9999, 120933, 1337, -999999
9754, -9999, -999999, -9999, -9999, 119675, 1019, -999999
9904, -9999, -999999, -9999, -9999, 122655, 2061, -999999
10054, -9999, -999999, -9999, -9999, 124384, 3126, -999999
10204, -9999, -999999, -9999, -9999, 124632, 3371, -999999
10354, -9999, -999999, -9999, -9999, 121341, 1609, -999999
54001, 8, 2005, 02, 03, 0, 42.278, -70.613, 6978, 7043, 241.7, 65.5
10118, 9999, -999999, -9999, -9999, 124458, 3205, -999999
10268, -9999, -999999, -9999, -9999, 123160, 2421, -999999
10418, -9999, -999999, -9999, -9999, 121221, 1582, -999999
10568, -9999, -999999, -9999, -9999, 120950, 1523, -999999
10718, -9999, -999999, -9999, -9999, 117339, 680, -999999
10868, -9999, -999999, -9999, -9999, 122751, 2423, -999999
11018, -9999, -999999, -9999, -9999, 124230, 3491, -999999
11168, -9999, -999999, -9999, -9999, 124039, 3424, -999999
36, 1001
Brune, William
Penn State University
ATHOS - OH and HO2 concentrations using cryo water mix ratio data for quenching corrections
ICARTT_INTEX
1, 1
2004, 07, 12, 2005, 01, 12
0
Start_UTC, seconds
4
1, 1, 1, 1
-9999, -9999, -9999, -9999
Stop_UTC, seconds
Mid_UTC, seconds
OH_pptv, pptv
HO2_pptv, pptv
0
18
PI_CONTACT_INFO: Address: 503 Walker Building, University Park, PA 16802; email: brune@essc.psu.edu;
PLATFORM: NASA DFRC DC8 - sampling underneath aircraft forward cargo bay location
LOCATION: Aircraft location data in nav_dc8_20040712_R0.ict file
ASSOCIATED_DATA: see ftp://ftp-air.larc.nasa.gov/pub-air/INTEXNA/
INSTRUMENT_INFO: OH/HO2 LIF
DATA_INFO: Units are pptv.
UNCERTAINTY: The absolute accuracy is conservatively estimated to be +/- 32% at two sigma confidence
ULOD_FLAG: -7777
ULOD_VALUE: N/A
LLOD_FLAG: -8888
LLOD_VALUE: N/A
DM_CONTACT_INFO: Bob Lesher; Penn State University; blesher@psu.edu
PROJECT_INFO: INTEX Mission 26 June-14 August 2004; California, Illinois, and New Hampshire
STIPULATIONS_ON_USE: Use of these data requires prior approval from William Brune
OTHER_COMMENTS: N/A
REVISION: R0
R0: Final Data
Start_UTC, Stop_UTC, Mid_UTC, OH_pptv, HO2_pptv
55526, 55545, 55535, 0.171, 9.791
55546, 55565, 55555, 0.180, 9.218
55566, 55585, 55575, 0.186, 9.767
55586, 55605, 55595, 0.176, 9.996
55606, 55625, 55615, 0.192, 9.513
55626, 55645, 55635, 0.185, 9.798
55646, 55665, 55655, 0.160, 9.834
46, 2310
Williams, Eric
NOAA/Earth System Research Laboratory
Ozone number density profile from WP3 aircraft LIDAR
ICARTT_ITCT
1, 1
2004, 08, 30, 2009, 09, 04
1
Geo_Alt, meters, Geometric_altitude_of_observation
UT_TIME, seconds, Elapsed_time_from_0_hours_on_day_given_by_date
1 ;{Number of PRIMARY variables}
1.0e9
-9999
O3_NumDensity[], molecules/cc, Ozone_NumDensity_Array
9 ;{Number of AUXILIARY variable}
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999
Num_Altitudes, none, number_of_altitudes_at_current_time_mark
Geo_Alt_Begin, meters, geometric_altitude_at_which_data_begin
Alt_Increment, meters, altitude_increment_between_observations
Geo_Alt_Aircraft, meters, geometric_altitude_of_aircraft
UT_hour, hours
UT_min, minutes
UT_sec, seconds
Lon_aircraft, degrees_E
Lat_aircraft, degrees_N
0
18
PI_CONTACT_INFO: 325 Broadway, Boulder, CO 80305; 303-497-3226; eric.j.williams@noaa.gov
PLATFORM: NOAA WP3
LOCATION: Lat, Lon, and Alt data included in the data records
ASSOCIATED_DATA: N/A
INSTRUMENT_INFO: Differential absorption LIDAR. See Williams et al., BigScience, 42, p. 50-51, 2001
DATA_INFO: The units are number density (#/cc). The vertical averaging interval is 975 m at 1-7 km above the aircraft and 2025 m > 7 km above the aircraft. Horizontal averaging interval: 60 km.
UNCERTAINTY: Contact PI
ULOD_FLAG: -7777
ULOD_VALUE: N/A
LLOD_FLAG: -8888
LLOD_VALUE: N/A
DM_CONTACT_INFO: Contact PI
PROJECT_INFO: ICARTT study; 1 July-15 August 2004
STIPULATIONS_ON_USE: Use of these data requires PRIOR OK from the PI
OTHER_COMMENTS: N/A
REVISION: R0
R0: No comments for this revision.
UT_TIME, Num_Altitudes, Geo_Alt_Begin, Alt_Increment, Geo_Alt_Aircraft, UT_hour, UT_min, UT_sec, Lon_aircraft, Lat_aircraft, O3_NumDensity[]
30335, 26, 12819, 75, 10389, 8, 25, 35, -133.24, -9.45
1340, 1519, 1660, 1779, 1868, 1939, 1973, 1992, 1989, 1955, 1934, 1897, 1817, 1721, 1619, 1514, 1434, 1343, 1258, 1203, 1140, 1088, 1037, 956, 892, 878
30336, 22, 12819, 75, 10383, 8, 26, 0, -133.22, -9.93
1351, 1523, 1658, 1774, 1860,1930, 1962, 1974, 1966, 1932, 1909, 1877, 1803, 1706, 1600, 1493, 1407, 1310, -9999, -9999, 1094, 1045
41, 1001
Williams, Eric
Earth System Research Laboratory/NOAA
Nitric oxide and nitrogen dioxide mixing ratios from R/V Ronald H. Brown
ICARTT_NEAQS
1, 1
2004, 08, 30, 2004, 12, 25
0
Start_UTC, seconds, number_of_seconds_from_0000_UTC
9
1, 1, 1, 1, 1, 1, 1, 1, 1
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999
Stop_UTC, seconds
Mid_UTC, seconds
DLat, deg_N
DLon, deg_E
Elev, meters
NO_ppbv, ppbv
NO_1sig, ppbv
NO2_ppbv, ppbv
NO2_1sig, ppbv
0
18
PI_CONTACT_INFO: 325 Broadway, Boulder, CO 80305; 303-497-3226; email:eric.j.williams@noaa.gov
PLATFORM: NOAA research vessel Ronald H. Brown
LOCATION: Latitude, longitude and elevation data are included in the data records
ASSOCIATED_DATA: N/A
INSTRUMENT_INFO: NO: chemiluminescence; NO2: narrow-band photolysis/chemiluminescence
DATA_INFO: All data with the exception of the location data are in ppbv. All oneminute averages contain at least 35 seconds of data, otherwise missing.
UNCERTAINTY: included in the data records as variables with a _1sig suffix
ULOD_FLAG: -7777
ULOD_VALUE: N/A
LLOD_FLAG: -8888
LLOD_VALUE: N/A, N/A, N/A, N/A, N/A, 0.005, N/A, 0.025, N/A
DM_CONTACT_INFO: N/A
PROJECT_INFO: ICARTT study; 1 July-15 August 2004; Gulf of Maine and North Atlantic Ocean
STIPULATIONS_ON_USE: Use of these data requires PRIOR OK from the PI
OTHER_COMMENTS: N/A
REVISION: R0
R0: No comments for this revision.
Start_UTC, Stop_UTC, Mid_UTC, DLat, DLon, Elev, NO_ppbv, NO_1sig, NO2_ppv, NO2_1sig
43200, 43259, 43229, 41.00000, -71.00000, 15, 0.555, 0.033, 2.220, 0.291
43260, 43319, 43289, 41.01234, -71.01234, 15, 10.333, 0.522, 31.000, 0.375
import unittest
import os
import io
import sys
import icartt
def compare_files(str_in, str_out, diff=0):
str_out.seek(0)
str_in.seek(0)
input = str_in.readlines()
output = str_out.readlines()
str_in.close()
str_out.close()
if not len(input) == len(output):
raise Exception("Input ({:d}) and output ({:d}) do not have the same number of lines!".format(len(input), len(output)))
for i in range(len(input)):
inline = input[i].strip().replace(" ", "")
outline = output[i].strip().replace(" ", "")
if not inline == outline:
print("Line {:d} differs:".format(i))
print(" input: {:s}".format(inline))
print(" output: {:s}".format(outline))
return True
class DatasetTestCase(unittest.TestCase):
def test_simple_1001_NOx(self):
fn = 'tests/examples/NOx_RHBrown_20040830_R0.ict'
print(fn)
str_in = open(fn)
str_out = io.StringIO()
ict = icartt.Dataset(fn, loadData=False)
ict.read_data()
ict.write(str_out)
assert compare_files(str_in, str_out)
def test_simple_1001_HOx(self):
fn = 'tests/examples/HOX_DC8_20040712_R0.ict'
print(fn)
str_in = open(fn)
str_out = io.StringIO()
ict = icartt.Dataset(fn, loadData=False)
ict.read_data()
ict.write(str_out)
assert compare_files(str_in, str_out)
def test_simple_2110_AR(self):
fn = 'tests/examples/AR_DC8_20050203_R0.ict'
print(fn)
str_in = open(fn)
str_out = io.StringIO()
ict = icartt.Dataset(fn, loadData=False)
ict.read_data()
ict.write(str_out)
assert compare_files(str_in, str_out)
def test_simple_2110_AROTAL(self):
fn = 'tests/examples/AROTAL-RAY_DC8_20040715_R1.ict'
print(fn)
str_in = open(fn)
str_out = io.StringIO()
ict = icartt.Dataset(fn, loadData=False)
ict.read_data()
ict.write(str_out)
assert compare_files(str_in, str_out)
def suite():
suite = unittest.TestSuite()
suite.addTest( DatasetTestCase('test_simple_1001_NOx') )
suite.addTest( DatasetTestCase('test_simple_1001_HOx') )
suite.addTest( DatasetTestCase('test_simple_2110_AR') )
suite.addTest( DatasetTestCase('test_simple_2110_AROTAL') )
return suite
if __name__ == '__main__':
runner = unittest.TextTestRunner()
runner.run(suite())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment