Coverage for runmacs/processor/fixmeta.py : 86%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- # Filename: fixmeta.py metadata additions for macsProcessor ====================================
This is part of the macsProcessor suite.
Copyright (C) 2014 Tobias Kölling
general metadata info ---------------------
Important user defined metadata may be:
* intent -> measurement intent * campaign * mountOptions -> e.g. servoCAT, macsDrive, HALO, CHB
Important autogenerated metadata may be:
* date/time * quality """
('nawdex_2016', '2016-09-10T00:00:00Z', '2016-10-20T23:59:59Z'), ('narval_ii_2016', '2016-08-01T00:00:00Z', '2016-09-01T23:59:59Z'), ('acridicon2014', '2014-08-21T00:00:00Z', '2014-10-05T23:59:59Z'), ('mlcirrus2014', '2014-02-21T00:00:00Z', '2014-04-20T23:59:59Z'), ('chb1_2014', '2014-01-16T00:00:00Z', '2014-02-14T23:59:59Z'), ('hopeMelpitz2013', '2013-09-10T00:00:00Z', '2013-09-22T23:59:59Z'), ('hopeJuelich2013', '2013-04-17T00:00:00Z', '2013-04-25T23:59:59Z'), ('acridiconZugspitze2012', '2012-09-27T00:00:00Z', '2012-10-03T23:59:59Z'), ]
('c++test', '2013-12-10T00:00:00Z', '2013-12-31T23:59:59Z'), ('cirrus', '2013-09-14T00:00:00Z', '2013-09-14T12:30Z'), #cirrus in melpitz ('cirrus', '2013-07-09T00:00:00Z', '2013-07-09T23:59:59Z'), ('halo', '2013-07-09T00:00:00Z', '2013-07-09T23:59:59Z'), ('cloudSides', '2013-07-24T00:00:00Z', '2013-08-05T23:59:59Z'), ('cloudSides', '2013-05-05T00:00:00Z', '2013-07-05T23:59:59Z'), ('grill', '2015-06-03T00:00:00Z', '2015-06-03T23:59:59Z'), ]
('nawdex_2016', ['cloudtop', '-narval_ii']), ('narval_ii_2016', ['cloudtop', '-narval_ii']), ('acridicon2014', ['cloudSides']), ('mlcirrus2014', ['cirrus']), ('chb1_2014', ['labCalibration']), ('hopeMelpitz2013', ['compareToACTOS', 'cloudSides']), ('hopeJuelich2013', ['cloudSides']), ]
('macsDrive', '2015-06-03T00:00:00Z', '2015-12-31T23:59:59Z'), ('macsDrive', '2015-01-01T00:00:00Z', '2015-03-24T23:59:59Z'), ('macsDrive', '2014-02-21T00:00:00Z', '2014-07-31T23:59:59Z'), ('servoCAT', '2011-01-01T00:00:00Z', '2013-12-31T23:59:59Z'), ]
('nawdex_2016', ['HALO']), ('narval_ii_2016', ['HALO']), ('acridicon2014', ['HALO']), ('chb1_2014', ['CHB']), ('hopeMelpitz2013', ['servoCAT']), ('hopeJuelich2013', ['servoCAT']), ('acridiconZugspitze2012', ['servoCAT']), ]
('plain', '2012-01-01T00:00:00Z', '2014-01-27T00:00:00Z'), ('baffle', '2014-01-27T00:00:00Z', '2018-12-31T23:59:59Z'), ]
#overwrites time ('nawdex_2016', 'plain+HALO_HSM'), ('narval_ii_2016', 'plain+HALO_HSM'), ('acridicon2014', 'baffle+HALO_SVP'), ]
l = [l] else: l.append(elem)
except AttributeError: userMeta = {}
#fix campaign for campaign, start, stop in campaignByTime: if campaign == userMeta['campaign'] and (date < start or date > stop): del userMeta['campaign'] break
#fix intent date, userMeta.get('campaign', None), intentByTime, intentByCampaign) #fix mountOptions date, userMeta.get('campaign', None), mountByTime, mountByCampaign) date, userMeta.get('campaign', None), opticsByTime, opticsByCampaign)
# special handling section --------- # bad wire on VNIR CameraLink Grabber. Only odd pixels are valid # end special handling section -----
del userMeta['optics']
""" merges attribute ``attr`` from dicts ``a`` and ``b`` to dict ``meta``. """ else: meta[attr] = a[attr] else: logger.warning('mergeUserMeta %s missmatch: %s != %s', attr, a[attr], b[attr])
|