Git Product home page Git Product logo

knoten's People

Contributors

acpaquette avatar austinsanders avatar jessemapel avatar jlaura avatar kaitlyndlee avatar kberryusgs avatar kelvinrr avatar ladoramkershner avatar paarongiroux avatar scsides avatar sgstapleton avatar thareusgs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knoten's Issues

Domain Review

Domain reviews are specific to Scientific Software (Refer to Scientific Software IM) and ensure the software generates output that aligns with published or otherwise well-known expected results. Domain reviews may involve:

  • Comparing output with external data sets
  • Comparing algorithms with published, scholarly articles about the algorithm
  • Reviewing unit and integration test results

Domain reviews should be performed by a trusted scientific expert with applicable subject-matter knowledge as well as sufficient applicable programming knowledge.

Administrative and Security Code Review

All software must have an administrative security review before it is made publicly available by any method. This type of review ensures personal, private, or otherwise sensitive information is not included in the repository. Types of sensitive information include:

  • Personally identifiable information (PII)
  • Absolute file system paths
  • Internal server host names or IP addresses
  • Usernames/passwords

Administrative security reviews may be performed by any trusted person; the reviewer does not necessarily need a strong scientific or programming background. When migrating an existing project into any non-private Git repository, it is important to remember that the entire project history needs to be reviewed if that history is to be maintained after migration.

Systemic Errors in CTX at the top (start or stop?) of images when generating ground points

Issue Description

CTX (line scan sensor model) is behaving strangely at the top of images.

Examples

I am seeing consistent, systematic errors at the top of CTX images using the CSM. These errors are evident when using the sensor model to project from the image to the ground. In the attached images, the pink pluses (+) are a grid of points at every 1000 pixels in the image, projected to an BCBF coordinate. Note the extreme shift in the uppermost set of points in this first image (B05_011720_1832_XN_03N217W).
Screen Shot 2022-09-11 at 6 13 13 AM

In the next image (B04_011377_1843_XN_04N212W), the effects are less pronounced at the top of the image. Instead, note how eight rows from the bottom, the regular grid suddenly widens. Points on the left (west) side of the image maintain good ground alignment while points on the right (east) side are incorrect.

Screen Shot 2022-09-11 at 6 14 43 AM

Finally, here is an example (B01_010018_1993_XN_19N191W) where the top rows of points are incorrect and are 'wrinkled' significantly to the top-right (NE). This is in contrast to the first example where the points shift dramatically to the left.

Screen Shot 2022-09-11 at 6 18 56 AM

Processing Steps

  • spiceinit from=lvl0 shape=ellipsoid
  • gen_csm - to create the ISD file using the gen_csm.py script described by the ASP team.
  • Knoten generate_ground_point using a high resolution DEM to compute the BCBF position of the intersection via the CSM. (I can provide the notebook and DEMs if desired).

Environment

ale                       0.8.7           py310h91b1402_1    conda-forge
csm                       3.0.3.3              hc9558a2_0    conda-forge
cspice                    66                h7f98852_1015    conda-forge
isis                      6.0.0                         0    usgs-astrogeology
usgscsm                   1.6.0                h924138e_0    conda-forge

Attachments

ISDs.zip

Installing knoten

I followed the instructions at

https://github.com/USGS-Astrogeology/knoten/blob/master/README.md

to install knoten, so I ran the environment.yml file. But this did not install knoten, only its dependencies. I had to do, in addition,

conda install -c usgs-astrogeology -c conda-forge knoten

to install it, which was not mentioned anywhere. Perhaps another line needs to be added to the enviornment file for knoten itself?

Testing

In order to test this library, a csm is required. Right now, the swig wrapper cooks a default CSM with a number of canned values in order to test that the API is being generated correctly. We could adopt that model here. I think that that might be the safest approach, but would require moving some of the C lang compiling items into knoten making the builds slightly more complex.

Two alternatives would be to:

  1. Pull the 'fake' CSM out of swig into a stand alone repo, build that a push the artifact to somewhere publicly accessible. This might be the best approach to avoid duplication.
  2. Pull the usgscsm artifact in here and instantiate sensor models from that. This requires that knoten carries around ISDs, is testing using a live model, etc. I am less enamored with this approach.

Thoughts?

knoten does not ship vis

I installed knoten with the command:

conda install -c usgs-astrogeology -c conda-forge knoten

in a fresh environment having no other packages. Then started the python from this very environment, and did

import knoten

So far so good.

Then I did

from knoten import vis

I got the error:

Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'vis'

However, this works:

from knoten import csmapi

Is there a reason why vis is missing from the packaged knoten? It appears to be in the repo, and if I pulled it manually it works (kind of, some apis are broken when it comes to plotly).

MetaData Files

For USGS software release several MetaData files need to be added/updated:

  • A code.json file needs to be created and added at the top of the repo
  • The LICENSE file needs to be renamed to LICENSE.md
  • a DISCLAIMER.md file needs to be created and added at the top of the repo

Args have defaults specific to Mars

Functions:
generate_gcps
generate_latlon_footprint
generate_bodyfixed_footprint
generate_vrt
All have default arguments using Mars radii in their argument list.

Change default branch from master to main

Git has moved away from the master/slave branch naming because it's culturally insensitive. Instead, new git repos now use main as the default branch. This repo still uses the old master primary branch and we should update it to use the new default branch name.

This would be a minor disruption to work.

Open pull requests will need to be changed to pull into main instead. This should not impact contributors; it will be a one time action for maintainers.

Contributors will need to pull and create branches from main instead of master. For example, to create a new branch for work, you will run git fetch upstream && git checkout -b my_work_branch upstream/main instead of git fetch upstream && git checkout -b my_work_branch upstream/master. To ensure contributors don't accidentally create branches or pull from the now out-of-date master branch, we should delete it. This will result in the old commands erroring instead of silently continuing but not actually pulling the most recent changes.

Importing from gdal in knoten

I am having issues with the line: https://github.com/USGS-Astrogeology/knoten/blob/master/knoten/csm.py#L7

which says:

from gdal import ogr

This can be reproduced on the command line, by installing the knoten dependencies, then running python as:

~/miniconda3/envs/knoten/bin/python

and then running: from gdal import ogr

It says:

ModuleNotFoundError: No module named 'gdal'

What works is to say:

from osgeo import ogr

This is on Linux. What I have installed with miniconda in the knoten environment is:

gdal 3.2.2 py37hc5bc4e4_0 conda-forge
libgdal 3.2.2 h804b7da_0 conda-forge

knoten has a jupyter dependency - should it really?

When creating a knotted environment, the library has a jupyter dependency. I get that the package contains notebooks, but not all users are going to want to have an arguably bloated environment that in includes the full jupyter installation.

For many, have jupyter installed in a base env and then registering the knoten kernel is the preferred workflow. Should jupyter be removed from the environment.yml because it is not a necessary component of the library? I am happy to PR in the change and include instructions in a README for how better to handle the visualizations / interactions through multiple environments.

Py3.8 / Py3.9 release

Can knotted be released for python 3.6 - 3.9? Does not seem like the library is doing anything that is not supported by all of those versions.

boundary crossing footprint computation fails

Tested with a CT image that crosses the 180 boundary.

~/autocnet/autocnet/graph/node.py in footprint(self)
    641         if res is None:
    642             boundary = generate_boundary(self.geodata.raster_size[::-1])  # yx to xy
--> 643             footprint_latlon = generate_latlon_footprint(self.camera, boundary)
    644             footprint_latlon.FlattenTo2D()
    645             footprint_latlon = footprint_latlon.ExportToWkt()

~/anaconda3/envs/autocnet/lib/python3.6/site-packages/knoten/csm.py in generate_latlon_footprint(camera, boundary, semi_major, semi_minor)
    219             slope, b = regression.slope, regression.intercept
    220             current_ring.AddPoint(0 - 180, (slope*0 + b))
--> 221             current_ring.AddPoint(*switch_point)
    222             current_ring = ring
    223             current_ring.AddPoint(360 - 180, (slope*360 + b))

~/anaconda3/envs/autocnet/lib/python3.6/site-packages/osgeo/ogr.py in AddPoint(self, *args, **kwargs)
   6218     def AddPoint(self, *args, **kwargs):
   6219         """AddPoint(Geometry self, double x, double y, double z=0)"""
-> 6220         return _ogr.Geometry_AddPoint(self, *args, **kwargs)
   6221 
   6222 

TypeError: in method 'Geometry_AddPoint', argument 2 of type 'double'

create_csm fails silently

If create_csm fails to create a camera, it returns None. Is this what we want it to do, or should it fail with an error?

Creating CSM ISDs

I am using the example at https://github.com/USGS-Astrogeology/knoten/blob/master/examples/mro_ctx_isis_cmp.ipynb

to create ISD json files. I fetched knoten and am using ISIS 4.4.0, the latest.

Things work, except for the fact that the lines:

kernels = ale.util.generate_kernels_from_cube(cub_loc, expand=True)
usgscsm_str = ale.loads(fileName, props={'kernels': kernels}, formatter="usgscsm", verbose=False)

csm_isd = os.path.splitext(cub_loc)[0] + '.json'
with open(csm_isd, 'w') as isd_file:
isd_file.write(usgscsm_str)

creates .json files that are compatible with libusgscsm.so.1.4.0 and not with libusgscsm.so.1.5.1

That, despite my conda environment having

ale 0.8.5 py37h2527ec5_1 conda-forge
csm 3.0.3.3 hc9558a2_0 conda-forge
csmapi 1.0.1 py37h99015e2_0 conda-forge
usgscsm 1.5.1 h4bd325d_0 conda-forge

Is the ale package able to create the latest CSM .json files?

Or maybe I am doing something wrong.

Requirements for running example notebooks

What do we expect to be able to run the example notebooks? I have a couple questions that I think we need to answer before these are ready for consumption.

  1. Are we generating ISDs in the notebook or are we adding them to the repo?

  2. How are users getting the image files. Will the notebooks download them. Do we want to add them to the repo?

I would like to add some CI that runs the notebooks to ensure that the examples are still good.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.