Apply current workspace changes

This commit is contained in:
2026-04-22 01:52:21 +08:00
parent cf34b9a8ed
commit cb518b431f
449 changed files with 92252 additions and 321 deletions
@@ -0,0 +1,635 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Quickstart for AutoGACOS\n",
"\n",
"**AutoGACOS** is a Python library for automatically submitting and downloading GACOS data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import gacos"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"path = \"/Volumes/Data/Hyp3/descending_roi\"\n",
"ds = gacos.HyP3Dataset(path)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"check all acquisition dates in Hyp3 dateset"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"DatetimeIndex(['2015-11-12 23:26:31', '2015-12-06 23:26:31',\n",
" '2015-12-30 23:26:30', '2016-01-23 23:26:29',\n",
" '2016-02-16 23:26:28', '2016-03-11 23:26:28',\n",
" '2016-04-04 23:26:29', '2016-04-28 23:26:30',\n",
" '2016-05-22 23:26:34', '2016-06-15 23:26:36',\n",
" ...\n",
" '2023-01-10 23:27:15', '2023-01-22 23:27:15',\n",
" '2023-02-03 23:27:15', '2023-02-15 23:27:14',\n",
" '2023-02-27 23:27:15', '2023-03-11 23:27:14',\n",
" '2023-03-23 23:27:14', '2023-04-04 23:27:15',\n",
" '2023-08-14 23:27:22', '2023-09-07 23:27:23'],\n",
" dtype='datetime64[ns]', length=204, freq=None)\n",
"Index(['20151112', '20151206', '20151230', '20160123', '20160216', '20160311',\n",
" '20160404', '20160428', '20160522', '20160615',\n",
" ...\n",
" '20230110', '20230122', '20230203', '20230215', '20230227', '20230311',\n",
" '20230323', '20230404', '20230814', '20230907'],\n",
" dtype='object', length=204)\n",
"['23:25' '23:26' '23:27']\n"
]
}
],
"source": [
"print(ds.date_times)\n",
"print(ds.dates)\n",
"print(ds.times)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Submit GACOS requests automatically"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bf9575b9deea497089cc8167b8c8a438",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/3 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a9dafb6856a5407da0dbf6b965189f73",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/1 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 25, 'date': '20161007\\n20161031\\n20161124\\n20161218\\n20170111\\n20170204', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
" sleeping for 546 seconds...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8fd9eb9543774f3b87058eef331792df",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/6 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20151112\\n20151206\\n20151230\\n20160123\\n20160216\\n20160311\\n20160404\\n20160428\\n20160522\\n20160615\\n20160709\\n20160802\\n20160826\\n20160919\\n20170222\\n20170318\\n20170330', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20170411\\n20170423\\n20170505\\n20170517\\n20170529\\n20170610\\n20170622\\n20170704\\n20170716\\n20170728\\n20170809\\n20170821\\n20170902\\n20170914\\n20171008\\n20171020\\n20171101', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20171113\\n20171125\\n20171207\\n20171219\\n20171231\\n20180112\\n20180124\\n20180205\\n20180217\\n20180301\\n20180313\\n20180325\\n20180406\\n20180418\\n20180430\\n20180512\\n20180524', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20180605\\n20180617\\n20180629\\n20180711\\n20180723\\n20180804\\n20180816\\n20180921\\n20181003\\n20181015\\n20181027\\n20181108\\n20181120\\n20181202\\n20181214\\n20181226\\n20190107', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20190119\\n20190131\\n20190212\\n20190224\\n20190308\\n20190320\\n20190401\\n20190413\\n20190425\\n20190507\\n20190519\\n20190531\\n20190612\\n20190624\\n20190706\\n20190718\\n20190730', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 26, 'date': '20190811\\n20190823\\n20190904\\n20191221\\n20200102\\n20200114\\n20200126\\n20200207\\n20200219\\n20200302\\n20200314\\n20200326\\n20200407\\n20200419\\n20200501\\n20200513', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
" sleeping for 288 seconds...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4aa82286c5414723adcddcc8d864c133",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/5 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 27, 'date': '20190916\\n20190928\\n20191010\\n20191022\\n20191103\\n20191115\\n20191127\\n20191209\\n20200525\\n20200606\\n20200618\\n20200630\\n20200712\\n20200724\\n20200805\\n20200817\\n20200829\\n20200910\\n20200922\\n20201004', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 27, 'date': '20201016\\n20201028\\n20201109\\n20201121\\n20201203\\n20201215\\n20201227\\n20210108\\n20210120\\n20210201\\n20210213\\n20210225\\n20210309\\n20210321\\n20210402\\n20210414\\n20210426\\n20210508\\n20210520\\n20210601', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 27, 'date': '20210613\\n20210625\\n20210707\\n20210719\\n20210731\\n20210812\\n20210824\\n20210905\\n20210917\\n20210929\\n20211011\\n20211023\\n20211104\\n20211116\\n20211128\\n20211210\\n20211222\\n20220103\\n20220115', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 27, 'date': '20220127\\n20220208\\n20220220\\n20220304\\n20220316\\n20220328\\n20220409\\n20220421\\n20220503\\n20220515\\n20220527\\n20220620\\n20220702\\n20220714\\n20220726\\n20220807\\n20220819\\n20220831\\n20220912', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
">>> succeed post: {'N': 39.16527884776772, 'W': 98.34602960014247, 'S': 38.52041942953548, 'E': 99.41788862899489, 'H': 23, 'M': 27, 'date': '20220924\\n20221006\\n20221018\\n20221030\\n20221111\\n20221123\\n20221205\\n20221217\\n20221229\\n20230110\\n20230122\\n20230203\\n20230215\\n20230227\\n20230311\\n20230323\\n20230404\\n20230814\\n20230907', 'type': '2', 'email': 'fanchengyan2020@126.com'}\n",
" sleeping for 743 seconds...\n"
]
}
],
"source": [
"# initialize a submitter with the dataset and your email\n",
"submitter = gacos.Submitter(ds, email=\"your_email@xxx.com\")\n",
"\n",
"# submit all gacos requests for acquisitions in the Hyp3 dataset\n",
"submitter.post_requests()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# check the status of all requests\n",
"print(f\"Successfully submitted requests: \\n{submitter.succeed}\")\n",
"print(f\"Failed to submit requests: \\n{submitter.failed}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Retrieve GACOS results urls from your email automatically"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "667dccc73a434102a87226ebcb453389",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Retrieving GACOS urls: 0%| | 0/240 [00:00<?, ? emails/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"output_file = \"/Volumes/Data/Hyp3/descending_gacos/gacos_urls.csv\"\n",
"\n",
"email = gacos.GACOSEmail(\n",
" username=\"your_email\",\n",
" password=\"password_of_your_email\",\n",
" host=\"imap.xxx.com\", # imap server of your email\n",
" start_date=\"2023-11-01\", # only download gacos results for the email after this date\n",
")\n",
"email.retrieve_gacos_urls(output_file)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Download GACOS results using the urls "
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b99066adfc1c4f24aa2164540cd03ce7",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/24 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ed443926d42e480ca0d5d835ee23b377",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T010337VzTsCTN1h.tar.gz: 0%| | 0.00/15.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a40ea2c7a8da49eebc8dcb46d6e528ae",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011307V7OXOyZBe.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "478bae1d3f9545e7936e0436e21f48f3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011337VC4LikOAs.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "35e60690588147028abbc997e1b0fdf6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011408V6h3BniJT.tar.gz: 0%| | 0.00/41.1M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b5797b66e4044865acac24bb6bdbe4bc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011237Vy7m1l2al.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ab235b358f7d477c9a8f367b1c969e04",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011738Vniy7uNPV.tar.gz: 0%| | 0.00/51.2M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "edd581a5a24049cfa884c7d47ff5fd6c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011808VcEaTHazf.tar.gz: 0%| | 0.00/48.8M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f4501c922a984f8e890e2196c8717742",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T011838VJaHXOaZJ.tar.gz: 0%| | 0.00/48.8M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "025da6a325394f6195555963ebc48f30",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T142253VdcxwhZjh.tar.gz: 0%| | 0.00/15.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1e10f5c2420047dd9a20476e990be884",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T142324VXIAESwIW.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7f048fd91a7246f1adaa81de3c33a6f8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T142354VQj8kS9I0.tar.gz: 0%| | 0.00/43.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b819434541c540898948615a24650eab",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T142424VMFCCq5W7.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9b2abbf34daf4b12b44a44dc6b902ed2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T144425VSlcfYAm2.tar.gz: 0%| | 0.00/15.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "89261f821810404281862ba336f56eb6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T144455VCncFDojU.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d55f37d845454a0d90254ab82686b5d0",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T144525VisGJO2bU.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "75bd725bd9bf43b0bfe03682db91c6a2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T144555VcE1J5wo4.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "53773e7ba770412da3b45fb63d014a98",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T145756VCHtI731i.tar.gz: 0%| | 0.00/15.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b7848836c32244759118c616b458a3c4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T145827VhbjZbz5b.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f4f396e98e134ea08c8b6f5f9aa6138f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T145857VUeNu4WnY.tar.gz: 0%| | 0.00/43.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7ef6ff94335c4db38c7f4d20a07d9f29",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T145927V2I8j7eo6.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1979604e57d3473b9ea7af1cd2e112bb",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T151057VQMukfvJ5.tar.gz: 0%| | 0.00/15.6M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7fcd89254e0e4335a20440b2cff80bcc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T151158Vx3KrT8Va.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7550835c8d834f8895efea89ede2d308",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T151228VcpWSrjqg.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d42edcb7dfd546aca10f4cd4635e3cc1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"20231116T151258VfhhwgAli.tar.gz: 0%| | 0.00/43.7M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"url_file = output_file\n",
"output_dir = \"/Volumes/Data/Hyp3/descending_gacos\"\n",
"\n",
"gacos_dl = gacos.Downloader(url_file, output_dir, time=23.43)\n",
"gacos_dl.download()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "geo",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}