Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post SIM-5 changes #31

Merged
merged 60 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d2e1949
feat(image_requests.py): Added to status enum.
rbeyer Oct 16, 2023
7e962e9
feat(ptu_records.py): Added tables for PTU data.
rbeyer Oct 16, 2023
9bcd17d
feat(image_tags.py): Added "missing row(s)" tag.
rbeyer Oct 16, 2023
0bf321b
feat(pano_records.py & create_pano.py): Various updates to better sup…
rbeyer Oct 17, 2023
869c676
feat(nss_simulator.py): Update to nodata values.
rbeyer Oct 17, 2023
b09bd8a
feat(image_statistics.py): Added additional stats.
rbeyer Oct 24, 2023
092fec7
feat(get_position.py): Added.
rbeyer Oct 25, 2023
8903691
feat(image_requests.py): Added NOT_OBTAINABLE value to enum.
rbeyer Oct 25, 2023
a4b239a
feat(anom_pixel.py): Added.
rbeyer Oct 25, 2023
126104e
Bump version: 0.6.1 → 0.7.0-dev
rbeyer Oct 25, 2023
ef4ba49
feat(anom_pixel.py): Added command-line tolerance specifier.
rbeyer Oct 25, 2023
8816a95
feat(image_statistics.py): Added pprint() function.
rbeyer Oct 27, 2023
7353113
fix(image_records.py): Was not handling a SLoG pid on __init__() corr…
rbeyer Oct 27, 2023
29b8f19
fix(create_image.py): Needed a session.commit() to ensure INSERT on t…
rbeyer Oct 27, 2023
8b4b715
feat(create_vis_dbs.py): Now handles spatialite databases.
rbeyer Oct 27, 2023
142593a
feat(create_raw.py): Added capability to report data quality and obse…
rbeyer Oct 27, 2023
7286f16
style(various): lint updates.
rbeyer Oct 27, 2023
ba7b247
style(various): mypy updates.
rbeyer Oct 28, 2023
a6f43c2
refactor(xml.py): Moved the find_text() convenience function out of i…
rbeyer Nov 2, 2023
ce8fd00
feat(create_raw.py): Changed the "raw" collection name to its proper …
rbeyer Nov 2, 2023
8009534
feat(labelmaker & bundle_install): Added these to the repo.
rbeyer Nov 9, 2023
4c14cb1
feat(image_records.py): Added Purpose Enum and verification_purpose c…
rbeyer Nov 9, 2023
812c4db
feat(nss_modeler.py): The write_tiff method now returns the path wher…
rbeyer Nov 23, 2023
4180199
refactor(pds.__init__.py and various): Created a top-level Purpose En…
rbeyer Nov 23, 2023
e6a3680
feat(pano_records.py): Set start time from source products when possi…
rbeyer Nov 23, 2023
29aa87a
feat(create_pano.py): Added mechanism to extract times and purposes f…
rbeyer Nov 23, 2023
24f754c
feat(pano_check.py): Now properly ignores stereo pairs if left and ri…
rbeyer Nov 25, 2023
8cb5d53
feat(create_pano.py): Can now be given a directory to prepend to inpu…
rbeyer Nov 25, 2023
7b15d3d
feat(template_test.py): Removed, labelmaker generic does this work now.
rbeyer Nov 25, 2023
8a47e31
refactor(pds/__init__.py and create_raw.py): Consolidated some fucnti…
rbeyer Nov 27, 2023
d74e3c7
refactor(pano_records.py): label_dict function is really for making P…
rbeyer Nov 27, 2023
a5710ac
feat(create_pano_product.py): Added.
rbeyer Nov 27, 2023
684ba95
refactor(create_pano.py and pds/__init__.py): Lint cleanup
rbeyer Nov 27, 2023
67b4d92
feat(create_pano.py): Removed vestigal components for when this modul…
rbeyer Nov 29, 2023
c326c26
test(various): Added a bunch of new tests.
rbeyer Nov 30, 2023
1d8ec99
fix(bundle_install.py): Subdirectories in source collections will now…
rbeyer Nov 30, 2023
7b2d72f
chore(.gitignore): Ignore PyCharm .idea directory.
rbeyer Dec 1, 2023
e0c8b5d
feat(image_statistics.py): Added central_clear metric and experimenta…
rbeyer Dec 5, 2023
eb0d8f0
fix(anom_pixel.py): Previously, the difference math was being done wi…
rbeyer Dec 11, 2023
5fc3967
feat(create_raw.py vis/pds/__init__.py pds/labelmaker/__init__.py): O…
rbeyer Dec 15, 2023
004a366
feat(create_mmgis_pano.py): Added.
rbeyer Dec 29, 2023
2a65b08
feat(image_requests.py): Added asdict() method.
rbeyer Dec 29, 2023
ff4ce72
feat(pano-template.xml and raw-template.xml): Updated to PDS informat…
rbeyer Dec 29, 2023
ad01c7f
fix( raw-template.xml): Apparently you can only have one img:Image_Fi…
rbeyer Dec 29, 2023
6e8fc52
fix(create_image.py and create_raw.py): Deal with the fact that an 8-…
rbeyer Dec 29, 2023
9ed33a1
fix(create_pano_product.py): Source lidvids need to be FULL lidvids. …
rbeyer Dec 29, 2023
0009fe6
fix(test_create_raw.py and test_labelmaker.py): Updated tests for rec…
rbeyer Dec 29, 2023
2b4b5b3
refactor(create_mmgis_pano.py): lint cleanup
rbeyer Dec 29, 2023
93ae983
refactor(various): more lint cleanup
rbeyer Dec 29, 2023
cf873d1
refactor(pds/__init__.py and create_pano_product): Switch testing PDS…
rbeyer Dec 30, 2023
879e3d5
feat(image_records.py): If the captureId is larger than 16 bits, then…
rbeyer Jan 10, 2024
5feccc6
feat(create_raw.py): Changes to enable operation on sqlite databases.
rbeyer Jan 10, 2024
944dff5
fix(pds/__init__.py): The instrument context is "viper.vis" not "spac…
rbeyer Jan 12, 2024
65ab004
feat(bundle_install.py): Made this more flexible for lidvid_reference…
rbeyer Jan 12, 2024
70542fb
feat(create_browse.py and others): Added create_browse
rbeyer Jan 12, 2024
cde0d76
refactor(util.py and others): Created centralized function that takes…
rbeyer Jan 12, 2024
df1975b
fix(create_image.py): Adapted the write_tiff() function to handle boo…
rbeyer Jan 25, 2024
83d51e6
fix(image_requests.py): Added rover_wait_for column.
rbeyer Jan 25, 2024
591a938
fix(requirements.txt): Forgot that you import yaml, but pip install
rbeyer Jan 25, 2024
d63ce63
test(python-test.yml): Removed the 3.7 tests as Python 3.7 is EoL.
rbeyer Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']

env:
SPATIALITE_LIBRARY_PATH: 'mod_spatialite'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ ENV/
env.bak/
venv.bak/

# PyCharm
.idea

# Spyder project settings
.spyderproject
.spyproject
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,39 @@ Changed
vice-versa).
- junc_image_req_ldst.py got some additional columns to manage the Science Team
evaluation of images acquired from Image Requests.
- create_pano.py's make_pano_product() function renamed to make_pano_record().
- nss_simulator.py - nodata defaults for ideal detector count maps updated to more
realistic values for dry terrain.
- image_statistics.py - Added additional stats in the compute() function, and added
a pprint() function to format the info nicely.

Added
^^^^^
- pds.Purpose now provides names and explanations for the PDS-allowable values
for "purpose."
- yamcs_reception_time column added to the image_records.py table.
- Association table junc_image_pano created which provides a many-to-many
connection between ImageRecords and PanoRecords and added bidirectional
relationship entries to each table.
- pano_records table now has azimuth and elevation angle min/max values to indicate
- pano_records table now has pan and tilt angle min/max values to indicate
angular range of panorama coverage.
- ImageRecord objects will now extract an ImageRequest ID from the provided capture_id
if it is larger than the 16 bit range.
- image_requests.py - "Acquired," "Not Acquired," "Not Planned," and "Not Obtainable"
statuses added to enum. Also added asdict() method.
- ptu_records.py - Tables to record the pan and tilt of the rover's pan-tilt-unit (PTU).
- create_browse.py - For making browse products from existing image products.
- create_mmgis_pano.py - For making pano products for use in MMGIS.
- create_pano.py - updated to correctly add PanoRecord associations, can now query
database for ImageRecords.
- create_pano_product.py - takes PanoRecords and makes a PDS Pano Product.
- get_position.py - Gets position and yaw from a REST-based service.
- create_vis_dbs.py - Now also supports spatialite databases, primarily for testing.
- create_raw.py - Added components for adding observational intent and data quality
to the XML label.
- labelmaker - A program to help build PDS4 bundle and collection labels.
- bundle_install - A program to copy just the files related to a PDS4 bundle into a
new location. Fundamentally allowing a "make install" for PDS4 bundles.

Removed
^^^^^^^
Expand Down Expand Up @@ -157,6 +181,7 @@ Added

Changed
^^^^^^^
- Updated templates and modules for PDS information model 21.
- Flattened test directory structure.
- tri2gpkg -v is no longer an alias for --value-names, as it now determines verbosity
since logging has been added.
Expand All @@ -175,6 +200,7 @@ Fixed
- heatmap's generate_density_heatmap() function now properly returns values of zero
in the returned out_count numpy array when there are no counts in those grid cells
instead of the provided nodata value.
- raw-template.xml can only have one Image_Filter object.
- tri2gpkg now works correctly if --keep_z is specified
- tri2gpkg now uses the correct srs if a pre-defined site is selected.

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ dependencies:
- shapely
- sqlalchemy
- tifftools
- yaml
1 change: 1 addition & 0 deletions environment_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ dependencies:
- tox
- types-pillow
- types-requests
- types-pyyaml
- twine
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ scikit-learn
shapely
sqlalchemy
tifftools
pyyaml
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ tox
twine
types-pillow
types-requests
types-pyyaml
wheel
watchdog
10 changes: 9 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.1
current_version = 0.7.0-dev
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down Expand Up @@ -67,22 +67,30 @@ where = src
console_scripts =
accrual = vipersci.carto.accrual:main
anaglyph = vipersci.vis.anaglyph:main
anom_pixel = vipersci.vis.anom_pixel:main
bundle_install = vipersci.pds.bundle_install:main
colorforge = vipersci.carto.colorforge:main
dice_buffer = vipersci.carto.dice_buffer:main
dissolve_dice = vipersci.carto.dissolve_dice:main
get_position = vipersci.carto.get_position:main
image_stats = vipersci.vis.image_statistics:main
labelmaker = vipersci.pds.labelmaker.cli:main
msolo_simulator = vipersci.carto.msolo_simulator:main
nirvss_simulator = vipersci.carto.nirvss_simulator:main
nss_modeler = vipersci.carto.nss_modeler:main
nss_simulator = vipersci.carto.nss_simulator:main
traverse_interpolator = vipersci.carto.traverse_interpolator:main
tri2gpkg = vipersci.carto.tri2gpkg:main
template_test = vipersci.vis.pds.template_test:main
vis_create_browse = vipersci.vis.pds.create_browse:main
vis_create_image = vipersci.vis.create_image:main
vis_create_mmgis_pano = vipersci.vis.create_mmgis_pano:main
vis_create_pano = vipersci.vis.create_pano:main
vis_create_pano_product = vipersci.vis.pds.create_pano_product:main
vis_create_tif = vipersci.vis.create_tif:main
vis_create_raw = vipersci.vis.pds.create_raw:main
vis_create_dbs = vipersci.vis.db.create_vis_dbs:main
vis_pano_check = vipersci.vis.pano_check:main
viseer = vipersci.vis.viseer:main

[bdist_wheel]
Expand Down
2 changes: 1 addition & 1 deletion src/vipersci/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """vipersci Developers"""
__email__ = "[email protected]"
__version__ = "0.6.1"
__version__ = "0.7.0-dev"
177 changes: 177 additions & 0 deletions src/vipersci/carto/get_position.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
"""Gather Rover locations from a REST-based service.
"""

# Copyright 2023, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Reuse is permitted under the terms of the license.
# The AUTHORS file and the LICENSE file are at the
# top level of this library.

import argparse
import csv
from datetime import datetime, timezone
import logging
from pathlib import Path
import sys

Check warning on line 31 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L26-L31

Added lines #L26 - L31 were not covered by tests

import pandas as pd
import requests

Check warning on line 34 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L33-L34

Added lines #L33 - L34 were not covered by tests

from vipersci import util

Check warning on line 36 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L36

Added line #L36 was not covered by tests

logger = logging.getLogger(__name__)

Check warning on line 38 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L38

Added line #L38 was not covered by tests


def arg_parser():
parser = argparse.ArgumentParser(

Check warning on line 42 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L41-L42

Added lines #L41 - L42 were not covered by tests
description=__doc__, parents=[util.parent_parser()]
)
parser.add_argument(

Check warning on line 45 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L45

Added line #L45 was not covered by tests
"-s",
"--start",
default=datetime(2020, 1, 1, tz=timezone.utc),
help="An ISO8601 datetime to start the query at.",
)
parser.add_argument(

Check warning on line 51 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L51

Added line #L51 was not covered by tests
"-e",
"--end",
default=datetime.now(tz=timezone.utc),
help="An ISO8601 datetime to end the query at.",
)
parser.add_argument(

Check warning on line 57 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L57

Added line #L57 was not covered by tests
"-f",
"--frequency",
help="A frequency between the start and end times, using pandas 'Offset alias' "
"string notation (https://pandas.pydata.org/pandas-docs/stable/user_guide/"
"timeseries.html#offset-aliases). Could be 'S' for secondly.",
)
parser.add_argument(

Check warning on line 64 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L64

Added line #L64 was not covered by tests
"-u",
"--url",
required=True,
help="URL to which event_times may be posted and for which location and "
"orientation will be returned.",
)
parser.add_argument(

Check warning on line 71 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L71

Added line #L71 was not covered by tests
"-o", "--output", type=Path, help="Output path for CSV file output."
)
return parser

Check warning on line 74 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L74

Added line #L74 was not covered by tests


def main():
parser = arg_parser()
args = parser.parse_args()
util.set_logger(args.verbose)

Check warning on line 80 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L77-L80

Added lines #L77 - L80 were not covered by tests

t_start = datetime.fromisoformat(args.start)
t_end = datetime.fromisoformat(args.end)

Check warning on line 83 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L82-L83

Added lines #L82 - L83 were not covered by tests

if args.frequency:
times = pd.date_range(t_start, t_end, freq=args.frequency).tolist()

Check warning on line 86 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L85-L86

Added lines #L85 - L86 were not covered by tests

unix_times = []
for t in times:
unix_times.append(t.timestamp())

Check warning on line 90 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L88-L90

Added lines #L88 - L90 were not covered by tests

tpp = get_position_and_pose(unix_times, args.url)

Check warning on line 92 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L92

Added line #L92 was not covered by tests
else:
tpp = get_position_and_pose_range(

Check warning on line 94 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L94

Added line #L94 was not covered by tests
t_start.timestamp(), t_end.timestamp(), args.url
)

if args.output is not None:
with open(args.output, "w", newline="") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["UTC datetime", "x", "y", "yaw"])
for row in tpp:
dt = datetime.fromtimestamp(row[0], tz=timezone.utc)
writer.writerow(

Check warning on line 104 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L98-L104

Added lines #L98 - L104 were not covered by tests
[
dt.isoformat(),
]
+ list(row[1:])
)


def get_position_and_pose(times: list, url: str, crs: str = "VIPER:910101"):

Check warning on line 112 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L112

Added line #L112 was not covered by tests
"""
Given a list of unix times and a URL that requests can be made against,
return a list of two-tuples whose first element is the time and
whose second element is a three-tuple of x-location, y-location,
and yaw.
"""

tpp = list()

Check warning on line 120 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L120

Added line #L120 was not covered by tests

for t in times:
logger.info(f"unix timestamp: {t}")
position_result = requests.get(

Check warning on line 124 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L122-L124

Added lines #L122 - L124 were not covered by tests
url,
params={
"event_time": t, # Event time in unix datetime.
"margin_seconds": 2, # Some "margin time" around the event to search.
"format": "xyyaw", # Could also be xyyaw_uncertainty
"time_format": "unix_seconds",
"source": "ROVER",
"limit": 0,
"crs_code": crs,
},
verify=False,
)
rj = position_result.json()
logger.info(rj)

Check warning on line 138 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L137-L138

Added lines #L137 - L138 were not covered by tests

tpp.append(

Check warning on line 140 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L140

Added line #L140 was not covered by tests
(rj["event_seconds"], (rj["location"][0], rj["location"][1], rj["yaw"]))
)

return tpp

Check warning on line 144 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L144

Added line #L144 was not covered by tests


def get_position_and_pose_range(

Check warning on line 147 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L147

Added line #L147 was not covered by tests
start_time, stop_time, url: str, crs: str = "VIPER:910101"
):
tpp = list()

Check warning on line 150 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L150

Added line #L150 was not covered by tests

track_result = requests.get(

Check warning on line 152 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L152

Added line #L152 was not covered by tests
url,
params={
"min_time": start_time,
"max_time": stop_time,
"all": False,
"format": "xyyaw",
"crs_code": crs,
"time_format": "unix_seconds",
"source": "ROVER",
"start_end_only": False,
"simplify": False,
"order": "asc",
},
verify=False,
)
rj = track_result.json()

Check warning on line 168 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L168

Added line #L168 was not covered by tests

for time, loc, yaw in zip(rj["event_seconds"], rj["location"], rj["yaw"]):
tpp.append((time, loc[0], loc[1], yaw))

Check warning on line 171 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L170-L171

Added lines #L170 - L171 were not covered by tests

return tpp

Check warning on line 173 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L173

Added line #L173 was not covered by tests


if __name__ == "__main__":
sys.exit(main())

Check warning on line 177 in src/vipersci/carto/get_position.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/get_position.py#L176-L177

Added lines #L176 - L177 were not covered by tests
5 changes: 3 additions & 2 deletions src/vipersci/carto/nss_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def main():


def write_tif(path: Path, ending: str, arr: np.typing.ArrayLike, kwds: dict):
with rasterio.open(path.with_name(path.name + ending), "w", **kwds) as dst_dataset:
p = path.with_name(path.name + ending)
with rasterio.open(p, "w", **kwds) as dst_dataset:
dst_dataset.write(arr, 1)
return
return p
5 changes: 4 additions & 1 deletion src/vipersci/carto/nss_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@
d2_arr = d2.reshape(bd_data.shape)

kwds = bd_data.profile
kwds["nodata"] = 0.0
# for Detector 1
kwds["nodata"] = 31.0

Check warning on line 186 in src/vipersci/carto/nss_simulator.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/nss_simulator.py#L186

Added line #L186 was not covered by tests
write_tif(args.output, "_d1.tif", d1_arr, kwds)
# for Detector 2
kwds["nodata"] = 60.0

Check warning on line 189 in src/vipersci/carto/nss_simulator.py

View check run for this annotation

Codecov / codecov/patch

src/vipersci/carto/nss_simulator.py#L189

Added line #L189 was not covered by tests
write_tif(args.output, "_d2.tif", d2_arr, kwds)
return

Expand Down
48 changes: 48 additions & 0 deletions src/vipersci/pds/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env python
# coding: utf-8

"""Provides some generic PDS structures."""

# Copyright 2023, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Reuse is permitted under the terms of the license.
# The AUTHORS file and the LICENSE file are at the
# top level of this library.

import enum


class Purpose(enum.Enum):
# These definitions are taken from the allowable values for
# Product_Observational/Observation_Area/Primary_Result_Summary/purpose
# in the PDS4 Data Dictionary.
CALIBRATION = "Data collected to determine the relationship between measurement "
"values and physical units."
CHECKOUT = "Data collected during operational tests."
ENGINEERING = "Data collected about support systems and structures, which are "
"ancillary to the primary measurements."
NAVIGATION = "Data collected to support navigation."
OBSERVATION_GEOMETRY = "Data used to compute instrument observation geometry, "
"such as SPICE kernels."
SCIENCE = "Data collected primarily to answer questions about the targets of "
"the investigation."
SUPPORTING_OBSERVATION = "A science observation that was acquired to provide "
"support for another science observation (e.g., a context image for a very "
"high resolution observation, or an image intended to support an observation "
"by a spectral imager)."
Loading
Loading