Skip to content

Commit

Permalink
refactor - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Jul 26, 2024
1 parent 0b78ac9 commit 35fe4ad
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion blue_geo/.abcli/catalog/browse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function blue_geo_catalog_browse() {
local catalog=$(abcli_option "$options" $blue_geo_catalog_list firms)

abcli_log "@catalog: browsing $catalog ..."
blue_geo_catalog_${catalog}_browse "${@:2}"
blue_geo_catalog_browse_${catalog} "${@:2}"
}

abcli_source_path - caller,suffix=/browse
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#! /usr/bin/env bash

function blue_geo_datacube_firms_browse() {
function blue_geo_catalog_firms_browse() {
local options=$1

if [ $(abcli_option_int "$options" help 0) == 1 ]; then
options="|map_key|area"
abcli_show_usage "@datacube browse firms$ABCUL$options" \
abcli_show_usage "@catalog browse firms$ABCUL$options" \
"browse firms."
return
fi

local do_map_key=$(abcli_option_int "$options" map_key 0)
local do_area_api=$(abcli_option_int "$options" area 0)
local api=$(abcli_option_choice "$options" area area)

local url="https://firms.modaps.eosdis.nasa.gov/"
[[ "$do_map_key" == 1 ]] &&
url="https://firms.modaps.eosdis.nasa.gov/api/map_key/"
[[ "$do_area_api" == 1 ]] &&
url="https://firms.modaps.eosdis.nasa.gov/api/area/"
[[ -z "$api" ]] &&
url="https://firms.modaps.eosdis.nasa.gov/api/$api/"

abcli_browse $url
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function blue_geo_catalog_ingest_firms() {
if [ $(abcli_option_int "$options" help 0) == 1 ]; then
options=$blue_geo_datacube_ingest_options
"$EOP~copy_template,dryrun,$EOPE"
abcli_show_usage "blue_geo ingest firms$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL" \
abcli_show_usage "@catalog ingest firms$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL" \
"firms -ingest-> <object-name>."
return
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function blue_geo_catalog_query_firms() {
local options=$1

if [ $(abcli_option_int "$options" help 0) == 1 ]; then
options="dryrun"
options="area,dryrun"

local date=$(abcli_string_timestamp_short \
--include_time 0 \
Expand All @@ -21,19 +21,21 @@ function blue_geo_catalog_query_firms() {

local args="[--date $date]$ABCUL[--depth 1]$ABCUL[--area $area]$ABCUL[--source $source]$ABCUL[--log 1]"

abcli_show_usage "@datacube query firms_area$ABCUL[$blue_geo_catalog_query_options]$ABCUL[-|<object-name>]$ABCUL[$options]$ABCUL$args" \
abcli_show_usage "@catalog query firms$ABCUL[$blue_geo_catalog_query_options]$ABCUL[-|<object-name>]$ABCUL[$options]$ABCUL$args" \
"firms -query-> <object-name>."
return
fi

local do_dryrun=$(abcli_option_int "$options" dryrun 0)
local api=$(abcli_option_choice "$options" area area)

local object_name=$(abcli_clarify_object $2 -)

abcli_eval dryrun=$do_dryrun \
python3 -m blue_geo.datacube.firms \
query \
--object_name $object_name \
--api $api \
"${@:3}"

return 0
Expand Down
2 changes: 1 addition & 1 deletion blue_geo/.abcli/catalog/query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function blue_geo_catalog_query() {
fi
if [[ $(abcli_option_int "$options" help 0) == 1 ]]; then
blue_geo_catalog_${catalog}_query "${@:2}"
blue_geo_catalog_query_${catalog} "${@:2}"
return
fi
Expand Down
2 changes: 1 addition & 1 deletion blue_geo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DESCRIPTION = f"{ICON} AI for precise geospatial data analysis and visualization."

VERSION = "4.146.1"
VERSION = "4.147.1"

REPO_NAME = "blue-geo"

Expand Down
2 changes: 1 addition & 1 deletion notebooks/firms-area-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# FIRMS Area API\n",
"\n",
"https://github.com/kamangir/blue-geo/blob/main/blue_geo/.abcli/datacube/firms/README.md"
"https://github.com/kamangir/blue-geo/blob/main/blue_geo/.abcli/catalog/firms/README.md"
]
},
{
Expand Down

0 comments on commit 35fe4ad

Please sign in to comment.