Changeset 8417 for mauRepo/HPFos
- Timestamp:
- 27/06/12 16:49:04 (9 years ago)
- Location:
- mauRepo/HPFos/trunk/src/HPFos
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/HPFos/trunk/src/HPFos/ceda_guid.py
r8348 r8417 1 1 ''' 2 BSD Licence 3 Copyright (c) 2012, Science & Technology Facilities Council (STFC) 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without modification, 7 are permitted provided that the following conditions are met: 8 9 * Redistributions of source code must retain the above copyright notice, 10 this list of conditions and the following disclaimer. 11 * Redistributions in binary form must reproduce the above copyright notice, 12 this list of conditions and the following disclaimer in the documentation 13 and/or other materials provided with the distribution. 14 * Neither the name of the Science & Technology Facilities Council (STFC) 15 nor the names of its contributors may be used to endorse or promote 16 products derived from this software without specific prior written permission. 17 18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 23 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2 28 Created on 13 Apr 2012 3 29 -
mauRepo/HPFos/trunk/src/HPFos/moles3epb.py
r8406 r8417 148 148 @return: a list of CEDA_ObservationCollections or None if empty 149 149 """ 150 150 151 collections = self._session.query(CEDA_ObservationCollection).all() 152 ''' 153 for item in self._session.query(CEDA_ObservationCollection): 154 collections.append(self.searchSelectiveLoadByInstance(item, \ 155 ['identifier', 'geographicExtent'])) 156 ''' 151 157 if bbox == None: 152 158 return collections … … 160 166 161 167 def searchEager(self, clazz, inst_id): 162 return EPB.searchEager(clazz, inst_id )168 return EPB.searchEager(clazz, inst_id, self._session) 163 169 164 170 def persistInstance(self, instance): -
mauRepo/HPFos/trunk/src/HPFos/osImpl/myimpl.py
r8406 r8417 55 55 BBOX = 'box' 56 56 57 CEDA_TITLE = 'ceda_title' 58 57 59 def calculateStep(**kwargs): 58 60 step = 20 … … 175 177 for subresult in subresults: 176 178 #Here could loop over results 177 ititle = Title(Info.TEXT_TYPE, subresult.title) 178 icontent = Content(Info.HTML_TYPE, '<b> Search Feed </b> \ 179 <ul> <li> Title: ASAR Image Mode source packets Level 0 (ASA_IM__0P) </li> \ 180 The ASAR Image Mode source packets Level 0 data product offers Level 0 data for possible images processing on an other processing site. It includes some mandatory information for SAR processing. The Image Mode Level 0 product consists of time-ordered Annotated Instrument Source Packets (AISPs) collected while the instrument is in Image Mode. The echo samples contained in the AISPs are compressed to 4 bits/sample using Flexible Block Adaptive Quantisation (FBAQ). This is a high-rate, narrow swath mode so data is only acquired for partial orbit segments and may be from one of seven possible image swaths. The Level 0 product is produced systematically for all data acquired within this mode. This product provides a continuation of the ERS-SAR_RAW product.<li> Abstract: The ASAR Image Mode source packets Level 0 data product offers Level 0 data for possible images processing on an other processing site. It includes some mandatory information for SAR processing. The Image Mode Level 0 product consists of time-ordered Annotated Instrument Source Packets (AISPs) collected while the instrument is in Image Mode. The echo samples contained in the AISPs are compressed to 4 bits/sample using Flexible Block Adaptive Quantisation (FBAQ). This is a high-rate, narrow swath mode so data is only acquired for partial orbit segments and may be from one of seven possible image swaths. The Level 0 product is produced systematically for all data acquired within this mode. This product provides a continuation of the ERS-SAR_RAW product. </li><li> Subject: Radar Imagery, Solid Earth (Tectonics/Seismic Activity), Water (Water Management), Natural Disasters (Oil Slick), Land (Topography/Mapping,Soil,Vegetation) Ocean and Coast (Ocean Currents and Topography,Ocean Waves,Coastal Geomorphology) </li> \ 181 <li> Date: 2002-10-18 to 2012-03-29 \ 182 </li> <li> Number of Records: 15945 </ul>') 179 ititle = Title(Info.HTML_TYPE, subresult.title) 180 icontent = Content(Info.HTML_TYPE, subresult.description) 183 181 entry = Entry(path + subresult.id + '/' + self.extension, \ 184 182 ititle.buildElement(), \ … … 267 265 268 266 def _packResult(self, results, **kwargs): 269 270 267 filtered = self._filterResults(results, **kwargs) 271 268 … … 273 270 for result in filtered: 274 271 result_guid = kwargs['moles3EPB'].retrieveGUIDFromInstance(result) 275 item = Subresult(result_guid.id, "title", datetime.now().isoformat()) 272 ititle = self._extractTitle(result) 273 item = Subresult(result_guid.id, ititle, result.description, datetime.now().isoformat()) 276 274 subresults.append(item) 277 275 278 276 return Result(len(results), subresult = subresults) 279 277 278 def _extractTitle(self, cedaObj): 279 if hasattr(cedaObj, 'identifier'): 280 for ident in cedaObj.identifier: 281 if ident.authority.title == CEDA_TITLE: 282 return ident.code 280 283 281 284 def doSearch(self, **kwargs): … … 296 299 297 300 results = kwargs['moles3EPB'].getObservationCollections(bbox = ibbox) 298 299 300 301 301 302 return self._packResult(results, **kwargs) 302 303 … … 312 313 if observation: 313 314 observation = kwargs['moles3EPB'].searchSelectiveLoadByInstance(observation, 'result') 314 315 print observation316 '''317 subresults = []318 for result in obs_coll.member:319 result_guid = kwargs['moles3EPB'].retrieveGUIDFromInstance(result)320 item = Subresult(result_guid.id, "title", datetime.now().isoformat())321 subresults.append(item)322 323 result = Result(id = kwargs['params_values'][COLLECTION], subresult = subresults)324 return result325 '''326 315 return None 327 316 328 317 class Result(object): 329 def __init__(self, totalResults, i d = None, title = "Discovery feed for Search Services", updated = datetime.now().isoformat(), subresult = []):318 def __init__(self, totalResults, iid = None, title = "Discovery feed for Search Services", updated = datetime.now().isoformat(), subresult = []): 330 319 ''' 331 320 Constructor … … 336 325 ''' 337 326 self.totalResult = totalResults 338 self.id = i d327 self.id = iid 339 328 self.title = title 340 329 self.updated = updated … … 343 332 344 333 class Subresult(object): 345 def __init__(self, i d, title, updated):334 def __init__(self, iid, title, description, updated): 346 335 ''' 347 336 Constructor … … 350 339 @param updated: the last time the record was updated 351 340 ''' 352 self.id = i d341 self.id = iid 353 342 self.title = title 343 self.description = description 354 344 self.updated = updated
Note: See TracChangeset
for help on using the changeset viewer.