|
13 | 13 | "metadata": {},
|
14 | 14 | "outputs": [],
|
15 | 15 | "source": [
|
| 16 | + "import os\n", |
| 17 | + "os.environ['ISISROOT'] = '/usr/local/Caskroom/miniconda/base/envs/isis-prod'\n", |
| 18 | + "os.environ['ISISDATA'] = '/Volumes/usgs-data/isis-data'\n", |
| 19 | + "import urllib.request\n", |
| 20 | + "\n", |
16 | 21 | "import ale\n",
|
17 |
| - "from ale.drivers.messenger_drivers import MessengerMdisPds3NaifSpiceDriver\n", |
| 22 | + "from ale.drivers.mess_drivers import MessengerMdisPds3NaifSpiceDriver\n", |
18 | 23 | "from ale.formatters.usgscsm_formatter import to_usgscsm\n",
|
19 | 24 | "import json\n",
|
20 | 25 | "import os\n",
|
21 |
| - "from pysis import isis\n", |
| 26 | + "import kalasiris as isis\n", |
22 | 27 | "import pvl\n",
|
23 | 28 | "import numpy as np\n",
|
24 | 29 | "import knoten\n",
|
25 | 30 | "import csmapi\n",
|
26 |
| - "from knoten import csm" |
| 31 | + "from knoten import csm\n", |
| 32 | + "\n", |
| 33 | + "ale.spice_root = '/Volumes/usgs-data/spice-data'" |
27 | 34 | ]
|
28 | 35 | },
|
29 | 36 | {
|
30 | 37 | "cell_type": "code",
|
31 | 38 | "execution_count": 2,
|
32 | 39 | "metadata": {},
|
33 |
| - "outputs": [ |
34 |
| - { |
35 |
| - "name": "stdout", |
36 |
| - "output_type": "stream", |
37 |
| - "text": [ |
38 |
| - "cassini: data/cassini/kernels/mk/\n", |
39 |
| - "dawn: spice/dawn-m_a-spice-6-v1.0/dawnsp_1000/extras/mk\n", |
40 |
| - "kaguya: spice/SELENE/kernels/mk/\n", |
41 |
| - "lro: spice/lro-l-spice-6-v1.0/lrosp_1000/extras/mk/\n", |
42 |
| - "mdis: spice/mess-e_v_h-spice-6-v1.0/messsp_1000/extras/mk\n", |
43 |
| - "mro: spice/mro-m-spice-6-v1.0/mrosp_1000/extras/mk\n", |
44 |
| - "spice_root: spice/\n", |
45 |
| - "\n", |
46 |
| - "MDIS spice directory: spice/mess-e_v_h-spice-6-v1.0/messsp_1000/extras/mk\n" |
47 |
| - ] |
48 |
| - } |
49 |
| - ], |
| 40 | + "outputs": [], |
50 | 41 | "source": [
|
51 | 42 | "# printing config displays the yaml formatted string\n",
|
52 |
| - "print(ale.config)\n", |
| 43 | + "# print(ale.config) Gone?\n", |
53 | 44 | "\n",
|
54 | 45 | "# config object is a dictionary so it has the same access patterns \n",
|
55 |
| - "print('MDIS spice directory:', ale.config['mdis'])\n", |
| 46 | + "# print('MDIS spice directory:', ale.config['mdis'])\n", |
56 | 47 | "\n",
|
57 | 48 | "# updating config for new MDIS path in this notebook \n",
|
58 | 49 | "# Note: this will not change the path in `.ale/config.yml`. This change only lives in the notebook.\n",
|
|
64 | 55 | "execution_count": 3,
|
65 | 56 | "metadata": {},
|
66 | 57 | "outputs": [],
|
| 58 | + "source": [ |
| 59 | + "# https://pdsimage2.wr.usgs.gov/Messenger/MSGRMDS_1001/DATA/2015_114/\n", |
| 60 | + "# https://d3fhgbbgskqro0.cloudfront.net/MSGRMDS_1001/DATA/2015_114/EN1072174528M.IMG\n", |
| 61 | + "\n", |
| 62 | + "imgurl = 'https://d3fhgbbgskqro0.cloudfront.net/MSGRMDS_1001/DATA/2015_114/EN1072174528M.IMG'\n", |
| 63 | + "image_dir = 'data'\n", |
| 64 | + "EN1072174528M = os.path.join(image_dir, 'EN1072174528M.IMG')\n", |
| 65 | + "downloader = urllib.request.URLopener()\n", |
| 66 | + "if not os.path.isfile(EN1072174528M):\n", |
| 67 | + " downloader.retrieve(imgurl, EN1072174528M)" |
| 68 | + ] |
| 69 | + }, |
| 70 | + { |
| 71 | + "cell_type": "code", |
| 72 | + "execution_count": 6, |
| 73 | + "metadata": {}, |
| 74 | + "outputs": [ |
| 75 | + { |
| 76 | + "ename": "AttributeError", |
| 77 | + "evalue": "'FrameChain' object has no attribute 'find_child_frame'", |
| 78 | + "output_type": "error", |
| 79 | + "traceback": [ |
| 80 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 81 | + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", |
| 82 | + "Cell \u001b[0;32mIn[6], line 9\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m MessengerMdisPds3NaifSpiceDriver(fileName) \u001b[38;5;28;01mas\u001b[39;00m driver:\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# Get rotation from target_frame to j2000\u001b[39;00m\n\u001b[1;32m 8\u001b[0m j2000 \u001b[38;5;241m=\u001b[39m driver\u001b[38;5;241m.\u001b[39mframe_chain\n\u001b[0;32m----> 9\u001b[0m target_frame \u001b[38;5;241m=\u001b[39m \u001b[43mj2000\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfind_child_frame\u001b[49m(driver\u001b[38;5;241m.\u001b[39mtarget_frame_id)\n\u001b[1;32m 10\u001b[0m rotation \u001b[38;5;241m=\u001b[39m target_frame\u001b[38;5;241m.\u001b[39mrotation_to(j2000)\n\u001b[1;32m 12\u001b[0m \u001b[38;5;66;03m# Apply rotation to sensor position and velocity\u001b[39;00m\n", |
| 83 | + "\u001b[0;31mAttributeError\u001b[0m: 'FrameChain' object has no attribute 'find_child_frame'" |
| 84 | + ] |
| 85 | + } |
| 86 | + ], |
67 | 87 | "source": [
|
68 | 88 | "# change to desired PDS3 image path \n",
|
69 |
| - "fileName = 'EN1072174528M.IMG'\n", |
| 89 | + "fileName = EN1072174528M\n", |
70 | 90 | "\n",
|
71 | 91 | "# metakernels are furnsh-ed when entering the context (with block) with a driver instance\n",
|
72 | 92 | "# most driver constructors simply accept an image path \n",
|
|
322 | 342 | "name": "python",
|
323 | 343 | "nbconvert_exporter": "python",
|
324 | 344 | "pygments_lexer": "ipython3",
|
325 |
| - "version": "3.7.3" |
| 345 | + "version": "3.12.4" |
326 | 346 | }
|
327 | 347 | },
|
328 | 348 | "nbformat": 4,
|
|
0 commit comments