Skip to content

Implement inputfileSatelliteId for SlrSinexDataHandling2Files#414

Open
Hanbing59 wants to merge 2 commits intogroops-devs:mainfrom
Hanbing59:pr-SlrSinexDataHandling2Files
Open

Implement inputfileSatelliteId for SlrSinexDataHandling2Files#414
Hanbing59 wants to merge 2 commits intogroops-devs:mainfrom
Hanbing59:pr-SlrSinexDataHandling2Files

Conversation

@Hanbing59
Copy link
Copy Markdown
Contributor

No description provided.

@tmayerguerr
Copy link
Copy Markdown
Member

Hi Hanbing,

I guess I was planning to add inputfileSatelliteId else but then forgot about it.

You can implement this much more concisely if you use #include "files/fileStringTable.h".
Reading the file is then shortened to:

  std::vector<std::vector<std::string>> tableSatelliteId;
  if(fileNameSatelliteId.empty())
  {
    logStatus<<"read satellite ID mapping file <"<<fileNameSatelliteId<<">"<<Log::endl;
    readFileStringTable(fileNameSatelliteId, tableSatelliteId);
  }

You can then find the entry using:

  auto iter = std::find_if(tableSatelliteId.begin(), tableSatelliteId.end(),
                           [&](auto &t){return (t.size() > 1) && ((t.front() == satId) || (t.front() == "L"+satId));});
  if(iter != tableSatelliteId.end())
    satId = iter->at(1);

The code has a few fewer tests than yours, but I don't think you need to bloat the code just to catch every mistake the user makes.

What do you think of my suggestion? I haven't tested the code yet, though.

Best regards
Torsten

@Hanbing59
Copy link
Copy Markdown
Contributor Author

Hi Torsten,

thanks for your reply.

I agree with you totally, and will change the implementation accordingly based on your suggestion. Once finished and tested, I will modified this PR.

Best regards,
Hanbing

@Hanbing59 Hanbing59 force-pushed the pr-SlrSinexDataHandling2Files branch from 8192cf3 to 4c98d07 Compare April 6, 2026 08:50
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