DM-31175: Add online and offline blind solving code#27
Conversation
Add utility function for getting ra/dec at zenith Improve error handling in the main fit
b418279 to
2eb72c0
Compare
| self.corrFile = corrFile | ||
| self._calcScatter() # sets self.scatterPixels and self.scatterArcseconds | ||
|
|
||
| def _buildWcs(self): |
There was a problem hiding this comment.
Do you actually want this object to be mutable? I'm guessing not since you made buildWcs and calcScatter single-underscore and never call them outside init.
In that case, I suggest making this a frozen dataclass (from dataclasses import dataclass and add @dataclass(frozen=True)). Then, replace the existing class attributes with methods using @cached_property (from functools). The nice thing about that is that the wcs method will contain all but the last line of what is now _buildWcs, whereas plateScale will be a one-liner calling self.wcs.getPixelScale().asArcseconds(), and you won't need any single-underscore methods at all. Plus, if you really care about performance, if you never call those methods it won't bother to read the file and build the wcs in the first place.
taranu
left a comment
There was a problem hiding this comment.
Mostly minor/inane/nitpicking comments; hopefully the others are useful.
| raise RuntimeError(f"Could not find {binary} in path, please install 'solve-field' and either" | ||
| " put it on your PATH or specify the full path to it in the 'binary' argument") | ||
|
|
||
| def _writeConfigFile(self, wide): |
There was a problem hiding this comment.
Just FYI, we are hopefully going to get documenteer/Sphinx support for type hints Soon and not have to write types in the numpy docstrings anymore. I'm not sure if that means we should do both in the meantime...
There was a problem hiding this comment.
Presumably that will need mypy on everything though, right?
There was a problem hiding this comment.
Certainly good to know though.
No description provided.