Skip to content

Commit

Permalink
Change pull_ to request_
Browse files Browse the repository at this point in the history
  • Loading branch information
bpurinton committed Nov 25, 2024
1 parent 70bad09 commit af6ba6c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions asp_plot/altimetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def __init__(
self.atl06sr_processing_levels = atl06sr_processing_levels
self.atl06sr_processing_levels_filtered = atl06sr_processing_levels_filtered

# TODO: Implement alongside pull_atl03sr below
# TODO: Implement alongside request_atl03sr below
# if atl03sr is not None and not isinstance(atl03sr, gpd.GeoDataFrame):
# raise ValueError("ATL03 must be a GeoDataFrame if provided.")
# self.atl03sr = atl03sr

# TODO: Implement ATL03 pull, which needs to put in separate GDF; warning this is gonna be huge and only used for basic plots
# def pull_atl03sr(self, rgt, cycle, track, spot, save_to_parquet=False, filename="atl03sr_defaults"):
# def request_atl03sr(self, rgt, cycle, track, spot, save_to_parquet=False, filename="atl03sr_defaults"):
# region = Raster(self.dem_fn).get_bounds(latlon=True)

# parms = {
Expand All @@ -97,7 +97,7 @@ def __init__(

# return self.atl03sr

def pull_atl06sr_multi_processing(
def request_atl06sr_multi_processing(
self,
res=20,
len=40,
Expand Down
4 changes: 2 additions & 2 deletions asp_plot/cli/asp_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"--plot_icesat",
prompt=False,
default=True,
help="If True, plot an ICESat-2 difference plot with the DEM result. This requires internet connection to pull ICESat data. Default: True.",
help="If True, plot an ICESat-2 difference plot with the DEM result. This requires internet connection to request ICESat data. Default: True.",
)
@click.option(
"--report_filename",
Expand Down Expand Up @@ -161,7 +161,7 @@ def main(
if plot_icesat:
icesat = Altimetry(directory=directory, dem_fn=asp_dem)

icesat.pull_atl06sr_multi_processing(
icesat.request_atl06sr_multi_processing(
save_to_parquet=False,
)

Expand Down
46 changes: 23 additions & 23 deletions notebooks/icesat2_plots_wip.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
}
],
"source": [
"icesat.pull_atl06sr_multi_processing(\n",
"icesat.request_atl06sr_multi_processing(\n",
" save_to_parquet=True,\n",
")\n",
"\n",
"# icesat.pull_atl06sr_multi_processing(\n",
"# icesat.request_atl06sr_multi_processing(\n",
"# res=10,\n",
"# len=20,\n",
"# ats=20,\n",
Expand Down Expand Up @@ -573,28 +573,28 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" atl06sr = gpd.read_parquet(os.path.join(icesat_directory, \"atl06sr_defaults_all.parquet\"))\n",
" atl06sr_filtered = gpd.read_parquet(os.path.join(icesat_directory, \"atl06sr_defaults_filtered.parquet\"))\n",
"# try:\n",
"# atl06sr = gpd.read_parquet(os.path.join(icesat_directory, \"atl06sr_defaults_all.parquet\"))\n",
"# atl06sr_filtered = gpd.read_parquet(os.path.join(icesat_directory, \"atl06sr_defaults_filtered.parquet\"))\n",
"\n",
" icesat = Altimetry(\n",
" dem_fn=dem_fn, \n",
" aligned_dem_fn=aligned_dem_fn,\n",
" atl06sr=atl06sr,\n",
" atl06sr_filtered=atl06sr_filtered\n",
" )\n",
"except:\n",
" print(\"No existing ATL06 files found. You'll need to re-request\")\n",
" icesat = Altimetry(dem_fn=dem_fn, aligned_dem_fn=aligned_dem_fn)"
"# icesat = Altimetry(\n",
"# dem_fn=dem_fn, \n",
"# aligned_dem_fn=aligned_dem_fn,\n",
"# atl06sr=atl06sr,\n",
"# atl06sr_filtered=atl06sr_filtered\n",
"# )\n",
"# except:\n",
"# print(\"No existing ATL06 files found. You'll need to re-request\")\n",
"# icesat = Altimetry(dem_fn=dem_fn, aligned_dem_fn=aligned_dem_fn)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1030,14 +1030,14 @@
}
],
"source": [
"if icesat.atl06sr is None:\n",
" icesat.pull_atl06sr(\n",
" esa_worldcover=True,\n",
" filename=os.path.join(icesat_directory, \"atl06sr_defaults_all\"),\n",
" parms=None,\n",
" )\n",
"# if icesat.atl06sr is None:\n",
"# icesat.pull_atl06sr(\n",
"# esa_worldcover=True,\n",
"# filename=os.path.join(icesat_directory, \"atl06sr_defaults_all\"),\n",
"# parms=None,\n",
"# )\n",
"\n",
"icesat.atl06sr"
"# icesat.atl06sr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_altimetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def icesat(self):
directory="tests/test_data",
dem_fn="tests/test_data/stereo/date_time_left_right_1m-DEM.tif",
)
icesat.pull_atl06sr_multi_processing(
icesat.request_atl06sr_multi_processing(
filename="tests/test_data/icesat_data/atl06sr_",
)
return icesat
Expand Down

0 comments on commit af6ba6c

Please sign in to comment.