Open oleg-alexandrov opened 10 months ago
I found the magic bit by digging through issues. Plugins must be in $ISISROOT/csmlibs/3.0.3/ (or a different dir can be set).
To add to the above, when a plugin is found, csminit better print out where it was found, and which one was loaded. That because there potentially be many compatible plugins, and the tool for now quietly stops at the first.
I think this is related to: https://github.com/DOI-USGS/ISIS3/issues/5384
Concerning particulars on how the plugin should be handled: I think that path that is in ISIS right now is a left over from early development. Adam and I were having this conversation right before break about how to go about updating this. This, I think, would require an update in both USGSCSM to change where it's installed that doesn't imply it's a directory just for USGSCSM, and a change in ISIS to make that new directory default.
Thank you for your contribution!
Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'
If no additional action is taken, this issue will be automatically closed in 180 days.
If you want to participate in our support prioritization meetings or be notified when support sprints are happening, you can sign up the support sprint notification emails here.
Read more about our support processs here
So that I do not open a new issue, I am going to piggy back on this one. The updates for plugin install are terrific. Usage of csminit
is still really painful because the pluginname and modelname need to be provided by the user and no guidance is given on where one gets these. Ultimately, I have to look them up in the appropriate USGSCSM headers. That's not a great user experience and way too much frication for most users.
I would propose that ISDs loaded use the try/except style paradigm that knoten uses. State files could try all plugins and pull the model name from the first line of the state. Then use the user can run csminit from=IMAGE state=STATEFILE
or csminit from=IMAGE isd=ISD
.
It would be entirely appropriate to leave the pluginname/modelname parameters if one needs to override those, but I think a simplified default behavior will support increased user adoption.
@jlaura You shouldn't need to provide those. Under the hood, we do preform the try except for you. What output are you getting when you run without providing the pluginname
and modelname
?
csminit from=TC1W2B0_01_02689N007E0011.cub state=TC1W2B0_01_02689N007E0011.json
**PROGRAMMER ERROR** When using a State string, PLUGINNAME and MODELNAME must be specified.
First isis LTS, so 8.0.0.
Ah, apologies @jlaura . Didn't realize it was using a state file. The ISDs try each model but the state file requires that the user provides the pluginname
and modelname
. Is the .json
file actually a state file or an ISD? If it's an ISD run with isd=TC1W2B0_01_02689N007E0011.json
rather than state
The csminit program should have no issue querying the plugin name and model name from the state file, I think. There's only one plugin anyway, the usgscsm one, which can be determined by peeking into the json. The model name is linescan or frame, etc.
I think there's a function already in CSM somewhere that does all the peeking and guesswork before loading the right thing.
@acpaquette It's a state file.
@oleg-alexandrov I think it's the getModelName method on the model or the canModelBeInstantiatedFromState method on the plugin. Isn't it the first line of the state file too?
Cool, that is something that should be handled for state files. I am not sure why states aren't handled in the try except manner but ISDs are
ISIS version(s) affected: 8.0.1
Description
I have a valid .cub file and .json file that work very well together. I validated the .cub file with spiceinit, and the CSM file with usgscsm_cam_test. It also works to project from the ISIS camera to the ground, back to CSM camera, and vicse-vera, as verified with ASP's cam_test tool.
But is not possible however to run csminit on it. Here's what I get:
csminit from = B17_016219_1978_XN_17N282W.cub isd = B17_016219_1978_XN_17N282W.json USER ERROR No loaded model could be created from the ISD [B17_016219_1978_XN_17N282W.json].Loaded plugin & model names:.
I tried to use the pluginname option, per https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/csminit/csminit.html. But the doc does not say what valid options are.
I tried to use the modelname option, but the doc also does not say what valid options are.
The documentation does not have an example of how this tool is to be used.
Then I tried to create a state file, which worked well, but then csminit still failed:
csminit from = B17_016219_1978_XN_17N282W.cub state = B17_016219_1978_XN_17N282W_state.json
PROGRAMMER ERROR When using a State string, PLUGINNAME and MODELNAME must be specified.
Then I tried this:
csminit from = B17_016219_1978_XN_17N282W.cub state = B17_016219_1978_XN_17N282W_state.json pluginname = UsgsAstroPluginCSM modelname = linescan
USER ERROR Cannot find requested Plugin: [UsgsAstroPluginCSM].
Also no luck with pluginname = usgscsm, or pluginname = csm.
This was tested with ISIS 8.0.1 as fetched with conda.