Beispiel #1
0
    def get(self):
        #print(subprocess.check_output('ls',shell=True))
        # do stuff
        maap = MAAP('./search/maap-py/maap.cfg')
        #maap = MAAP('/home/ubuntu/extensions/search/search/maap-py/maap.cfg')

        query_result = ''

        try:
            kw = self.get_argument('keyword', '')
            results = maap.searchCollection(keyword=kw)
            query_result = self.printResultsToString(results)
            # query_result = results
        except:
            kw = ''


        try:
            instr = self.get_argument('instrument', '')
            results = maap.searchCollection(instrument=instr)
            url_list = ''
            for res in results:
                url_list = url_list + res.getDownloadUrl() + '\n'
            query_result = url_list
        except:
            instr = ''


        #results = maap.searchCollection(keyword='precipitation')
        #granules = maap.searchGranule(short_name='MOD11A1')
        self.finish({"collections_found": query_result})
Beispiel #2
0
    def get(self):
        maap = MAAP(PATH_TO_MAAP_CFG)
        json_obj = self.get_argument('json_obj', '')
        print("json obj", json_obj)

        query_string = maap.getCallFromEarthdataQuery(json_obj)
        print("Response is: ", query_string)
        self.finish({"query_string": query_string})
Beispiel #3
0
    def setUpClass(cls):
        config_file_path = "./maap.cfg"

        cls.maap = MAAP()

        cls._test_instrument_name_uavsar = 'UAVSAR'
        cls._test_instrument_name_lvis= 'lvis'
        cls._test_track_number = '001'
        cls._test_ur = 'uavsar_AfriSAR_v1-cov_lopenp_14043_16008_140_001_160225-geo_cov_4-4.bin'
        cls._test_site_name = 'lope'
Beispiel #4
0
def searth_atl08():
    maap = MAAP()                    
    parser = getparser()
    args = parser.parse_args()
                        
    if args.data_dir is None or args.bbox is None:
        print("Needs a data dir and a bounding box. Exiting")
        os._exit(1)
    
    existingfiles = [file for file in os.listdir(args.data_dir)]
    
    s=maap.searchGranule(collection_concept_id="C1200116818-NASA_MAAP", bounding_box=args.bbox, limit=args.gran_limit)
    
    for f in range(len(s)):
        ID = s[f]['Granule']['DataGranule']['ProducerGranuleId']
       if ID in existingfiles:
        print('file exists...')
       else:                        
        s[f].getLocalPath(args.data_dir)
Beispiel #5
0
    def get(self):
        maap = MAAP()
        cmr_query = self.get_argument('cmr_query', '')
        limit = str(self.get_argument('limit', ''))
        query_type = self.get_argument('query_type', 'granule')
        print("cmr_query", cmr_query)

        query_string = maap.getCallFromCmrUri(cmr_query, limit=limit, search=query_type)
        print("Response is: ", query_string)
        self.finish({"query_string": query_string})
Beispiel #6
0
    def get(self):

        maap = MAAP(PATH_TO_MAAP_CFG)
        json_obj = self.get_argument('json_obj', '')
        print("json obj", json_obj)

        query_string = maap.getCallFromEarthdataQuery(json_obj)
        granules = eval(query_string)
        query_result = self.printUrls(granules)
        print("Response is: ", query_result)
        self.finish({"granule_urls": query_result})
Beispiel #7
0
    def get(self):

        maap = MAAP()
        cmr_query = self.get_argument('cmr_query', '')
        limit = str(self.get_argument('limit', ''))
        print("cmr_query", cmr_query)

        query_string = maap.getCallFromCmrUri(cmr_query, limit=limit)
        granules = eval(query_string)
        query_result = self.printUrls(granules)
        try:
            print("Response is: ", query_result)
        except:
            print("Could not print results")
        self.finish({"granule_urls": query_result})
Beispiel #8
0
    def get(self):
        #print(subprocess.check_output('ls',shell=True))
        # do stuff
        maap = MAAP('./search/maap-py/maap.cfg')
        #maap = MAAP('/home/ubuntu/extensions/search/search/maap-py/maap.cfg')

        query_result = ''

        try:
            instr = self.get_argument('instrument', '')
            site = self.get_argument('sitename', '')
            granules = maap.searchGranule(sitename=site, instrument=instr)
            # print(granules)
            # url_list = ''
            # for res in granules:
            #     url_list = url_list + res.getDownloadUrl() + '\n'
            query_result = self.printUrls(granules)
        except:
            instr = ''


        #results = maap.searchCollection(keyword='precipitation')
        #granules = maap.searchGranule(short_name='MOD11A1')
        self.finish({"granule_urls": query_result})
Beispiel #9
0
    def setUpClass(cls):
        config_file_path = "./maap.cfg"

        cls.maap = MAAP()
Beispiel #10
0
    def setUpClass(cls):
        config_file_path = "./maap.cfg"

        cls.maap = MAAP()

        cls._test_job_id = "a80434cc-3d63-4059-9ba6-2cd5ddb7d5ef"