Skip to content
Snippets Groups Projects
Unverified Commit 5f9b83f2 authored by Jacob Cain's avatar Jacob Cain Committed by GitHub
Browse files

Small fixes (#79)

* updated links/extentions, removed jupyter cell with username

* fix css errors for neoteroi cards

* align

* banished completely grammatical semicolon
parent 777e0092
No related branches found
No related tags found
No related merge requests found
.nt-cards {
&.nt-grid {
.nt-cards.nt-grid {
display: grid;
grid-auto-columns: 1fr;
gap: 0.5rem;
// the following 3 rules are for mobile devices, to avoid
// the grid forcing the width of the page
/* the following 3 rules are for mobile devices, to avoid */
/* the grid forcing the width of the page */
max-width: 100vw;
overflow-x: auto;
padding: 1px;
}
&.cols-1 {
@media only screen and (min-width: 701px) {
.nt-cards.nt-grid.cols-1 {
grid-template-columns: repeat(1, 1fr);
}
&.cols-2 {
.nt-cards.nt-grid.cols-2 {
grid-template-columns: repeat(2, 1fr);
}
&.cols-3 {
.nt-cards.nt-grid.cols-3 {
grid-template-columns: repeat(3, 1fr);
}
&.cols-4 {
.nt-cards.nt-grid.cols-4 {
grid-template-columns: repeat(4, 1fr);
}
&.cols-5 {
.nt-cards.nt-grid.cols-5 {
grid-template-columns: repeat(5, 1fr);
}
&.cols-6 {
.nt-cards.nt-grid.cols-6 {
grid-template-columns: repeat(6, 1fr);
}
}
@media only screen and (min-width: 501px) and (max-width: 700px) {
.nt-cards.nt-grid.cols-3 {
grid-template-columns: repeat(2, 1fr);
}
.nt-cards.nt-grid.cols-4 {
grid-template-columns: repeat(2, 1fr);
}
.nt-cards.nt-grid.cols-5 {
grid-template-columns: repeat(2, 1fr);
}
.nt-cards.nt-grid.cols-6 {
grid-template-columns: repeat(2, 1fr);
}
}
// for small devices
/* for small devices */
@media only screen and (max-width: 400px) {
// force one card per line
/* force one card per line */
.nt-cards.nt-grid {
grid-template-columns: repeat(1, 1fr) !important;
}
......
%% Cell type:markdown id:a117baed-ab98-4499-832c-8c73a8606cc0 tags:
# Tutorial: Instantiating a CSM Camera Model from Image
%% Cell type:markdown id:3602c014-53bc-4330-a9b0-0848d4927458 tags:
Lessons learned in this tutorial:
* How to generate Image Support Data (ISD) for an image
* instantiate a CSM camera model
* Perform a simple ground to image call
### 1. Prerequisites, Install Knoten
The `knoten` installation may take a little longer than usual due to the many dependencies (including ALE) involved.
%% Cell type:markdown id:ffeccab3-0d5d-4609-9c7f-871bdb69f17a tags:
```
conda install -c conda-forge knoten=0.2.1
```
%% Cell type:markdown id:faed4a43-cd06-45c7-bfa1-793978d41486 tags:
### 2. Generate an ISD from a Cube
We will use MRO data located in the `data/image_to_ground` folder containing a cube and necessary kernels for ISD (Image Support Data) generation.
*Note*: If your cube already has attached spice data, do you not have to specify kernels in the `props` param and can pass in an empty dict `{}` instead.
%% Cell type:code id:7f58cb34-d27f-456d-bfb5-f9075ca575b3 tags:
``` python
import ale
import json
import knoten
import os
# Set local data directory and paths
data_dir = '../data/image_to_ground'
cube_file = os.path.join(data_dir, 'B10_013341_1010_XN_79S172W.cub')
isd_file = os.path.join(data_dir, 'isd_file.json')
# Set local kernel paths
props = {
'kernels': [
os.path.join(data_dir, 'B10_013341_1010_XN_79S172W_0.bsp'),
os.path.join(data_dir, 'B10_013341_1010_XN_79S172W_1.bsp'),
os.path.join(data_dir, 'mro_ctx_v11.ti'),
os.path.join(data_dir, 'mro_sc_psp_090526_090601_0_sliced_-74000.bc'),
os.path.join(data_dir, 'mro_sc_psp_090526_090601_1_sliced_-74000.bc'),
os.path.join(data_dir, 'mro_sclkscet_00082_65536.tsc'),
os.path.join(data_dir, 'mro_v16.tf'),
os.path.join(data_dir, 'naif0012.tls'),
os.path.join(data_dir, 'pck00008.tpc')
]
}
# Generate the ISD string from the cube's label
isd_str = ale.loads(
label=cube_file,
formatter="ale",
props=props,
indent=2,
verbose=False,
only_isis_spice=False,
only_naif_spice=False
)
# Write the ISD string to file 'isd_file.json'
with open(isd_file, "w") as file:
file.write(isd_str)
```
%% Output
/Users/chkim/mambaforge3/envs/test/lib/python3.12/site-packages/osgeo/gdal.py:287: FutureWarning: Neither gdal.UseExceptions() nor gdal.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.
warnings.warn(
%% Cell type:markdown id:4ed327aa-bffc-4316-b42f-496d9e07465e tags:
### 3. Create a Community Sensor Model
We will use Knoten's implementation of CSM as the library supports line scanner types of sensor models in the usgscsm library.
%% Cell type:code id:0c4dbf84-2986-495b-9e4a-da4c77059e7e tags:
``` python
sensor_model = knoten.csm.create_csm(isd_file, verbose=False)
```
%% Cell type:markdown id:d6973fe3-9d4a-4408-9310-50334a52ff58 tags:
### 4. Convert image coordinates into ground coordinates
%% Cell type:code id:d8f2b155-9803-4a6b-a967-bca1ef35860f tags:
``` python
# Create an image coordinate at line = 206 and sample = 206
image_coord = knoten.csmapi.ImageCoord(206, 206)
# Convert the image coordinates to ground coordinates with desired precision of 0.0
ground_coord = sensor_model.imageToGround(image_coord, 0.0)
# Output the ground coordinates
ground_coord.x, ground_coord.y, ground_coord.z
```
%% Output
(-572485.2147483829, -79884.88742005036, -3326939.6184008163)
%% Cell type:markdown id:bf87c5a5-b26c-4168-9324-ce5b0004cc7c tags:
### 5. Convert ground coordinates into image coordinates
%% Cell type:code id:0edc0b6d-cdbe-46a8-9fdc-4ebdc4570f1a tags:
``` python
# Convert the image coordinates to ground coordinates with desired precision of 0.0
image_coord = sensor_model.groundToImage(ground_coord, 0.0)
# Output the image coordinates
image_coord.line, image_coord.samp
```
%% Output
(205.99991086761267, 206.00000010379927)
......
......@@ -45,9 +45,13 @@ When creating a new getting-started tutorial, first you need to make sure what y
Concrete things your tutorial needs:
- [ ] If your tutorial requires installing software, list what software and their versions and clear instructions on how to install them. Feel free to point to other points of the doc that already have boilerplate info like "Go here to read on how to set up a custom ISISPreferences file".
- [ ] If your tutorial has data, use generative data or data that is in the repo. Avoid external data dependencies. Before data is committed into the repo, check if [existing data can be re-used](./data/). If new data needs to be committed, make sure it is small so as not to increase the data burden.
- [ ] Make sure to make the lesson clear in the title. Also, make it clear in the tutorial with something like "Lessons learned in this tutorial:".
- [ ] If your tutorial requires software, list the software with versions and installation instructions. Feel free to link to existing docs with boilerplate info, for example:
```
See [User Preferences File](../concepts/isis-fundamentals/preference-dictionary.md#user-preference-file)
or [Project Preference File](../concepts/isis-fundamentals/preference-dictionary.md#project-preference-file)
for more info on custom ISISPreferences files.
```
- [ ] If your tutorial has data, use generative data or data that is in the repo. Avoid external data dependencies. Before data is committed into the repo, check if [existing data can be re-used](https://github.com/DOI-USGS/asc-public-docs/tree/main/docs/assets). If new data needs to be committed, minimize the size so as not to increase the data burden.
- [ ] Make the objectives clear in the title. Also, clarify the tutorial with a summary of objectives.
See the [git repo](https://code.usgs.gov/astrogeology/asc-public-docs) for more in-depth info on how to contribute new docs.
......@@ -7,33 +7,26 @@ hide:
# Software Manuals
::cards:: cols=3 image-bg
[
{
"title": "ISIS",
"content": "Integrated Software for Imagers and Spectrometers",
"url" : https://isis.astrogeology.usgs.gov/,
"image" : "https://raw.githubusercontent.com/DOI-USGS/ISIS3/dev/rtd_docs/ISIS_Logo.svg"
},
{
"title": "USGSCSM",
"content": "USGS Community Sensor Models",
"url" : ./usgscsm/,
"image" : "https://raw.githubusercontent.com/DOI-USGS/usgscsm/main/docs/USGSCSM_Logo.svg"
},
{
"title": "ALE",
"content": "Abstraction Library for Ephemerides",
"url" : ./ale/,
"image" : "https://raw.githubusercontent.com/DOI-USGS/ale/main/docs/ALE_Logo.svg"
},
{
"title": "PLIO",
"content": "Planetary Input/Output Library",
"url" : ./plio/,
"image" : https://raw.githubusercontent.com/DOI-USGS/plio/main/docs/PLIO_Logo.svg
},
]
::cards:: cols=4 image-bg
- title: ISIS
content: Integrated Software for Imagers and Spectrometers
url: https://isis.astrogeology.usgs.gov/
image: https://raw.githubusercontent.com/DOI-USGS/ISIS3/dev/rtd_docs/ISIS_Logo.svg
- title: USGSCSM
content: USGS Community Sensor Models
url: ./usgscsm/
image: https://raw.githubusercontent.com/DOI-USGS/usgscsm/main/docs/USGSCSM_Logo.svg
- title: ALE
content: Abstraction Library for Ephemerides
url: ./ale/
image: https://raw.githubusercontent.com/DOI-USGS/ale/main/docs/ALE_Logo.svg
- title: PLIO
content: Planetary Input/Output Library
url: ./plio/
image: https://raw.githubusercontent.com/DOI-USGS/plio/main/docs/PLIO_Logo.svg
::/cards::
......@@ -170,8 +170,8 @@ markdown_extensions:
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.snippets:
auto_append:
- definitions.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment