Skip to content

Conversation

@dave-kaye
Copy link
Contributor

Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.

Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.
@dave-kaye
Copy link
Contributor Author

Git f5512c4 removed the type column from the celestial browser for nebulae objects. Existing code is updated/finished and type designations are displayable for nebula.

Specifically:

  • Nebula types are updated

  • Type column is displayed and populated for nebulae

  • "Type Filter" input box is activated for nebulae

  • Some nebula have multiple cmod files with empty names in the .dsc file entries. They are used to piece together the object when displayed in the main window. This creates a DSO listing with multiple blank areas in the name section. These blank names are now removed from the nebula name listing. This also gives a total objects found value counting only the nebulae, and not the number of graphic objects needed to display the nebulae.

  • Absolute magnitude has a default value of -1000, leading to apparent magnitude values of -999. As the brightest object ever seen from earth was less than -50, these values are impossible. This code removes the errant values and displays a blank in its place. This code affects all DSO objects in the celestial browser window/deep sky tab (see open clusters).

Sample nebula files have been tested against Celestia 1.6.4 Linux and Celesta 1.7.0 Win interface versions. Neither codes have a deep sky browser window - neither gtk nor win interfaces have a deep sky browser window. The two systems are not affected by the addition of type tags to the DSO object nebula, as the default reading routines already read those tags but data is just not accessed by these programs.

This code modification does not update any celx capabilities to potentially display or use the additional available data.

@dave-kaye
Copy link
Contributor Author

Attached is a file of sample nebulae to test the code with. There are examples of nebulae that will demonstrate several of the code modifications.

planetary nebula:
eight-burst
ring
cat's eye
eskimo
lemon slice

supernova remnant:
firework
crab

These two sets will allow testing of the type filter box located near the bottom of the celestial browser window. Success will be if only the type entered into the filter is displayed in the listing and all examples of that type are shown.

The cat's eye nebula has multiple cmod files associated with it in the .dsc file. These nebula parts have no names. Success will be if a) the no name sections do not appear in the listing; and b) the cat's eye nebula still shows all of its parts (none of the no name sections are missing) when viewed as an image in the main window.

The firework nebula does not have an absolute magnitude associated with it. Success will be if the App. mag. column is blank, and does not display a default -999 magnitude which is impossible.

All nebula should display a reasonable information screen in the upper left corner of the main object display window when accessed.

Note: The deep sky browser is dynamic. It will change the distance and magnitude values based upon where the observer is located. However, it does need to be reloaded if the observer's location is changed and the user wants to see the new values. Otherwise the initial values based upon an earth observer point are displayed.

deepsky.zip


The samples were obtained from the Celestia Mobi website, then updated with newer information from primarily the NASA and Wikipedia websites. The tags modified in the .dsc were the addition of type and absolute magnitude tags. The "best" distance and magnitude values were selected from multiple conflicting data. Also the clickable tag was verified for multi-cmod files, so only the primary nebula image is clickable.

The absolute magnitude was calculated from the apparent magnitude with the formula:

magnitude calc

@dave-kaye
Copy link
Contributor Author

If this code is accepted, there are several items which can be updated.

[https://en.wikibooks.org/wiki/Celestia/DSC_File]
The wikibooks entry for Celestia DSC files in the Nebula section should be updated to add the "Type" tag using the nebula types found in the nebula.h file (enum Nebula type approx lines 27-36) and nebula.cpp file (array NebulaTypeNames approx lines 37-44). The NebulaTypeNames array contains the spelling/spacing of the types for the input .dsc file. The wikibooks entry should also add the use of the AbsMag tag. SEE the Galaxy entry as an example. Note: the general/common entry and galaxy entry shows AppMag tag as active, however testing a .dsc file by replacing a AbsMag tag with AppMag shows the code is not active/working. The clickable tag can also be added to the DSC entry.

The models on Celestia mobi and elsewhere can have their .dsc files updated; adding the tags Type and AppMag and Clickable as warranted. If owner/usage considerations prevent model file data from being updated, the necessary information can be posted as a comment and allow users to make the updates.

Distance and magnitude data varies widely based upon the source. Newer Gaia DR2 and DR3 data may be of use here. Also, the maintainers of the Celestia Origins website may have improved data. There is also a Planetary Nebula Database on the internet, however internet safety software is blocking my access to it. One thing I have found is many authors declare the magnitude of the nebula to be the magnitude of the central star. Others will keep them separate. Seperate is the better option so the magnitude of the nebula is the magnitude of the nebula object.

Copy link
Collaborator

@375gnu 375gnu left a comment

Choose a reason for hiding this comment

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

i haven't tested the build, just checked the code

dave-kaye and others added 9 commits April 2, 2025 10:51
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.
Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.
@dave-kaye
Copy link
Contributor Author

Authors have created models with multiple cmod files to draw an object in parts. The submitted code took this into account, removing parts with empty names in the *.dsc file from the DSO window display. However, I found some model builders did not use empty names, but rather blank space names. The code is updated to also remove from the DSO window display any model part with a name composed only of spaces.

This code uses a construct that was introduced in C++11. If this is unacceptable, the names could be converted to qstrings, trim the string, then check the string for zero length to achieve the same result.

@ajtribick ajtribick dismissed their stale review April 10, 2025 17:13

Dismissing stale review

dave-kaye and others added 4 commits April 11, 2025 11:02
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.
@dave-kaye
Copy link
Contributor Author

The code matches the galaxy.h and galaxy.cpp structure as originally submitted.

NebulaType was in class definition in the original code, but it was never accessed as that code was not written. Put NebulaType into Nebula class => multiple iterations of compile failure or class definition error occurred. Suspect that keeping the GalaxyType out of the class was how galaxy got around these problems. Found a way to make it work, but the order of operations in nebula.h is now required as written. It works on the GNU Linux compiler, but I don't know if this will work on Microsoft and Mac compilers. External definition does work because galaxy works on all the systems for a long time. If compiler errors, then roll back to external definition.

dave-kaye and others added 2 commits April 30, 2025 09:47
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Co-authored-by: Hleb Valoshka <375gnu@gmail.com>
Git f5512c4 removed the type column for nebula objects from the deep sky/celestial browser. Partially finished code still remains. This existing code is updated/finished and type designations are displayed for nebula.
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 2, 2025

@375gnu 375gnu requested a review from ajtribick May 16, 2025 07:52
@375gnu 375gnu merged commit cb9ede8 into CelestiaProject:master May 18, 2025
8 of 9 checks passed
ajtribick added a commit that referenced this pull request May 25, 2025
- Use const pointer parameter
- Fix potential undefined behavior of `std::isspace`
ajtribick added a commit that referenced this pull request May 25, 2025
- Use const pointer parameter
- Fix potential undefined behavior of `std::isspace`
@dave-kaye dave-kaye deleted the nebula branch June 9, 2025 15:20
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.

3 participants