SPICE, day/night and illumination layers

34 views
Skip to first unread message

Clément Jonglez

unread,
Mar 14, 2018, 1:22:43 PM3/14/18
to Lunaserv
Hello,

First of all, thank you for developing Lunaserv, it is a great tool.

I installed Lunaserv on my Ubuntu 16.04 computer to perform illumination analyses on the Moon.

First, I wanted to check that SPICE is working properly and I took a look at the "luna day_night" layer which is already present in the default setup. Unfortunately, it always renders a "Full Moon", i.e the near side region [-90,90 longitude] is always lit up and the far side is always dark. Because at the moment it is not the Full Moon (nearly the New Moon), and because the terminator is located at EXACTLY 90° longitude, I guess that SPICE is not working properly in my setup.

My basic setup works, I can visualize the default layers (WAC global, WAC DTM colorshade, grids, etc.) as well as custom layers (I added NACs, NAC DTM colorshades, NAC DTM slope colormaps, shapefiles, etc...).

My setup:
  • Ubuntu 16.04 x86_64 (up-to-date)
  • Lunaserv-3.20160316 + SPICE data + layer data + naif-spice-2.22.gem
  • For the backend, I use passenger, which I start from the lunaserv directory using the command "bundle exec passenger start"
  • As a frontend, I use both QGIS and the web interface http://localhost:3000/lunaserv.html
  • Lunaserv global configuration: See lunaserv.yml file attached (it is the default config file where I only changed the path to the layers and SRS directories)
  • day_night.yml layer config: See file attached. It is the default config file.

I attached a log file "luna_daynight_log.txt", where I was visualizing the day_night layer in QGIS. The log file does not report any anomalies with regard to SPICE.


I have several questions:

  • What is wrong in my setup?
  • How to specify the epoch at which I want to calculate the day/night limit and the illumination?
  • Do I need extra SPICE files in addition to those in lunaserv-3.20160316-spicedata.tar.bz2 ? In doubt, I also downloaded moon_080317.tf, moon_assoc_me.tf, moon_assoc_pa.tf, moon_pa_de421_1900-2050.bpc.

Furthermore, I tried to configure an illumination layer. Here is the layer config file illumination.yml as attachment. I want to render the illumination conditions in the Apollo 17 landing site region, so I downloaded a DTM in a TIF format from http://lroc.sese.asu.edu/data/LRO-L-LROC-5-RDR-V1.0/LROLRC_2001/DATA/SDP/NAC_DTM/APOLLO17/ . I then reprojected the DTM to the Moon2000 SRS, then generated pyramids (2 4 8 16 32 64 128 256), and then saved in the folder "layers/luna/illumination". The units for the elevation are meters, in offset from the Moon average level. It is without success so far, the layer displays nothing. In the logs (file attached illumination_log.txt), I get error messages like "No such file or directory", which probably means that the rendering failed and therefore no file was generated.



Thanks,

Cheers,

Clément.

luna_daynight_log.txt
lunaserv.yml
day_night.yml
illumination.yml
illumination_log.txt

Nick Estes

unread,
Mar 14, 2018, 1:27:26 PM3/14/18
to Clément Jonglez, Lunaserv
It sounds likely that it's some sort of SPICE related issue. Go into
the subsolar directory, and run "./get_point.rb moon". The output from
that should give us a much better idea of what isn't working.

--Nick


On 2018-03-14 07:41, Clément Jonglez wrote:
> Hello,
>
> First of all, thank you for developing Lunaserv, it is a great tool.
>
> I installed Lunaserv on my Ubuntu 16.04 computer to perform
> illumination analyses on the Moon.
>
> First, I wanted to check that SPICE is working properly and I took a
> look at the "luna day_night" layer which is already present in the
> default setup. Unfortunately, it always renders a "Full Moon", i.e the
> near side region [-90,90 longitude] is always lit up and the far side
> is always dark. Because at the moment it is not the Full Moon (nearly
> the New Moon), and because the terminator is located at EXACTLY 90°
> longitude, I guess that SPICE is not working properly in my setup.
>
> My basic setup works, I can visualize the default layers (WAC global,
> WAC DTM colorshade, grids, etc.) as well as custom layers (I added
> NACs, NAC DTM colorshades, NAC DTM slope colormaps, shapefiles,
> etc...).
>
> My setup:
>
> * Ubuntu 16.04 x86_64 (up-to-date)
> * Lunaserv-3.20160316 + SPICE data + layer data + naif-spice-2.22.gem
>
>
> * For the backend, I use passenger, which I start from the lunaserv
> directory using the command "bundle exec passenger start"
> * As a frontend, I use both QGIS and the web interface
> http://localhost:3000/lunaserv.html
> * Lunaserv global configuration: See lunaserv.yml file attached (it
> is the default config file where I only changed the path to the layers
> and SRS directories)
> * day_night.yml layer config: See file attached. It is the default
> config file.
>
> I attached a log file "luna_daynight_log.txt", where I was visualizing
> the day_night layer in QGIS. The log file does not report any
> anomalies with regard to SPICE.
>
> I have several questions:
>
> * What is wrong in my setup?
> * How to specify the epoch at which I want to calculate the day/night
> limit and the illumination?
> * Do I need extra SPICE files in addition to those in
> lunaserv-3.20160316-spicedata.tar.bz2 ? In doubt, I also downloaded
> moon_080317.tf, moon_assoc_me.tf, moon_assoc_pa.tf,
> moon_pa_de421_1900-2050.bpc.
>
> Furthermore, I tried to configure an illumination layer. Here is the
> layer config file illumination.yml as attachment. I want to render the
> illumination conditions in the Apollo 17 landing site region, so I
> downloaded a DTM in a TIF format from
> http://lroc.sese.asu.edu/data/LRO-L-LROC-5-RDR-V1.0/LROLRC_2001/DATA/SDP/NAC_DTM/APOLLO17/
> . I then reprojected the DTM to the Moon2000 SRS, then generated
> pyramids (2 4 8 16 32 64 128 256), and then saved in the folder
> "layers/luna/illumination". The units for the elevation are meters, in
> offset from the Moon average level. It is without success so far, the
> layer displays nothing. In the logs (file attached
> illumination_log.txt), I get error messages like "No such file or
> directory", which probably means that the rendering failed and
> therefore no file was generated.
>
> Thanks,
>
> Cheers,
>
> Clément.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lunaserv" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lunaserv+u...@googlegroups.com.
> To post to this group, send email to luna...@googlegroups.com.
> Visit this group at https://groups.google.com/group/lunaserv.

Clément Jonglez

unread,
Mar 15, 2018, 2:18:53 PM3/15/18
to Lunaserv
Hi,

Thanks for the quick answer. get_point.rb seems to work, the subsolar longitude and latitude make sense, and they change over time. (I tested it for the Earth as well).

How can I further debug lunaserv and the SPICE wrapper than looking at the logs? I must admit that I am a beginner in Ruby.

***@***:~/lunaserv-3.20160316/subsolar$ ./get_point.rb moon
-159.59720430493 -1.0179372611416868
***@***:~/lunaserv-3.20160316/subsolar$ ./get_point.rb moon
-159.59752064500034 -1.0179376270141551
***@***:~/lunaserv-3.20160316/subsolar$ ./get_point.rb moon
-159.59762891187336 -1.0179377522334048


Cheers,
Clément.

Clément Jonglez

unread,
Mar 16, 2018, 7:21:39 AM3/16/18
to Lunaserv
Okay, I think I found the reason.

In the file lunaserv/layers/night_base_layer.rb, at line 26 after "point_call = [ self.body ]", there should be a check that the Moon is called 'moon' and not 'luna' before passing the parameter to get_point.rb (like it is done in illumination_base_layer.rb):
point_call = [ 'moon' ] if self.body == 'luna'

Cheers,
Clément.
Reply all
Reply to author
Forward
0 new messages