Skip to content

Gear simulator ssg - #1464

Open
bwdev01 wants to merge 4 commits into
masterfrom
Gear_Simulator_SSG
Open

bwdev01 wants to merge 4 commits into
masterfrom
Gear_Simulator_SSG

Conversation

@bwdev01

@bwdev01 bwdev01 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@bwdev01
bwdev01 requested a review from agalasso September 5, 2026 20:43
Comment thread src/gear_simulator.cpp Outdated
Comment on lines +609 to +610
bool LoadNonFitsImage(cv::Mat& img, bool preProcess, wxSize& fullSize);
bool LoadFitsImage(usImage& img, cv::Mat& matImage, bool preProcess, wxSize& fullsize);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine these into a single LoadImage method that does everything and remove the filename extension check from the caller (it's duplicated in the method and needn't be done twice).
We can also remove the preProcess argument since it is always true.

Comment thread src/gear_simulator.cpp Outdated
bool LoadFitsImage(usImage& img, cv::Mat& matImage, bool preProcess, wxSize& fullsize);
void PreProcessImage(cv::Mat& img);
void GetSimDisplacements(double *pDeltaX, double *pDeltaY, double *pGearTime, bool TransformToCameraCoords);
bool ApplySimDisplacements(usImage *img, cv::Mat& matImage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const since it does not modify matImage

Suggested change
bool ApplySimDisplacements(usImage *img, cv::Mat& matImage);
bool ApplySimDisplacements(usImage *img, const cv::Mat& matImage);

@bwdev01
bwdev01 requested a review from agalasso September 22, 2026 03:34
Comment thread src/gear_simulator.cpp
bool SimCamParams::allow_async_st4 = true;
unsigned int SimCamParams::frame_download_ms; // frame download time, ms
unsigned int SimCamParams::SimFileIndex = 1;
wxString SimCamParams::SimFileTemplate = _("C:\\Temp\\phd2\\sim_image.png");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not translated!

Comment thread src/gear_simulator.cpp
// simulating solar system guiding. The image will be pre-processed to create a
// 16-bit gray-scale version of the original. Acceptable image formats are fits or any of the usual
// image formats supported by OpenCV (jpg, tif, bmp, png...)
bool SimCamState::LoadImageFromFile(usImage& img, cv::Mat& matImage, wxSize& fullSize)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's stick with the convention of using pointer arguments for output arguments (ok to use const references to pass objects that are not being modified). The helps make clear--especially in calling code--that the arguments are output arguments by passing them as pointers, not as references.

Suggested change
bool SimCamState::LoadImageFromFile(usImage& img, cv::Mat& matImage, wxSize& fullSize)
bool SimCamState::LoadImageFromFile(usImage *img, cv::Mat *matImage, wxSize *fullSize)

Comment thread src/gear_simulator.cpp
for (unsigned short *p = p0; p < end; p++)
*p = (unsigned short) (SimCamParams::noise_multiplier *
((double) gain / 10.0 * offset * exptime / 100.0 + (rand() % (gain * 100))));
dir.Open(wxf.GetPath());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReadFitImage does not use dir ... any idea why the dir.Open and CloseDir are being called here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants