Skip to content

emeyer34/NightSkyMetricsReports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

NPS Night Sky Metrics Report Generator

Project Background

The Natural Sounds and Night Skies Division (NSNSD) collaborates with parks and partners to advance scientific understanding and inspire public appreciation of nighttime resources. NSNSD supports the study, preservation, and restoration of night skies and the nocturnal environment throughout the national park system by collecting data on night sky quality, conducting lighting inventories, assisting parks with star parties, and researching visitors’ perceptions of lighting.

This project aims to provide parks with published reports on night sky quality. Utilizing data collected in parks, the final product is a published report that parks can use for compliance, resource assessments, external reviews, and dark sky certification applications.

The intended audience of this repository is NSNSD staff who will provide published reports to parks on night sky quality. The five-step process will result in a fully formatted report following the reporting guidelines of the NPS Science Report Series. The MS Word document output is approximately 95% automated. The report author will need to update text that is bold and noted by the "~" character. Other park-specific descriptions will also be required.

The NPS Science Report Series must:

  1. Be peer-reviewed before submission.
  2. Adhere to rigorous format requirements to ensure consistent presentation, compliance with NPS graphic identity standards, correct exporting, and application of Section 508 of the Rehabilitation Act.

Users of this project will not need to manually adjust the report to the report template, as the output will already be formatted.

Additional tips:

  1. Place first draft in Teams: NSNSD>Planning>Night Sky Reports (create park folder)
  2. Use the review log managed by Li-Wei when you are ready for internal review (internal; https://doimspp.sharepoint.com/:x:/r/sites/nsnsdallstaff/_layouts/15/Doc.aspx?sourcedoc=%7B1E77E498-5CF3-4B6D-9823-1D0DA8BE9DA6%7D&file=NightSkiesNRR_review.xlsx&action=default&mobileredirect=true&wdLOR=cDE2BEA02-49FE-4950-8547-832828F1FF04)
  3. Add template specific comments to the running log (internal; https://doimspp.sharepoint.com/:x:/r/sites/nsnsdallstaff/_layouts/15/Doc.aspx?sourcedoc=%7B1D745879-5C41-48FD-A74B-2483F8994405%7D&file=Night%20Sky%20Report%20Template%20Updates.xlsx&action=default&mobileredirect=true&DefaultItemOpen=1&wdLOR=cFF6A13AC-5FBE-4D9A-B325-96BE56D0433C )
  4. Advise park, internal, and admin reviewers to review on the Desktop MS Word app instead of the web app. The web app introduces errors that do not carry through on the desktop app.
  5. Submit your manuscript here after peer and park review (internal):https://doimspp.sharepoint.com/sites/nps-NR-Pubs/SitePages/Home.aspx

NPS night sky data collection site: Dinosaur National Monument Example: https://irma.nps.gov/DataStore/DownloadFile/740932"
NSNSD Night Sky Metrics Reports Data Collection Series: https://irma.nps.gov/DataStore/Collection/Profile/9562"

Report Generation Process

Step 1. Installation Guide

  1. Install RStudio (Software Center)
  2. Install R Statistical Software (Software Center)
  3. Install ArcGIS Pro (Software Center)
  4. Install Git (Software Center)

Step 1a: Preparing Your Workstation (Complete Only Once)

  1. Open a terminal (Git Bash) and navigate to the desired project directory:

cd [path to the place where you would like to save the project]

  1. Clone the GitHub repository:

git clone https://github.com/emeyer34/NightSkyMetricsReports.git

  1. Fetch any updates:

git fetch

  1. Pull the latest changes:

git pull origin main

  1. In Windows Explorer, navigate to the cloned project at:
    NightSkyMetricsReports\NightSkyReportGenerator\NightSkyReporting
    a. Open NightSkyReporting.Rproj
    b. In the R project, open NSreportmkdown.Rmd
    c. Run the code chunk labeled “r packages” on line 54 by pressing the play button on the upper right of the code chunk. This process may take some time if the required packages have not been previously downloaded.
  2. Download the geodatabase from the NSNSD "Planning" channel on Teams: https://doimspp.sharepoint.com/:u:/r/sites/nsnsdallstaff/Shared%20Documents/Planning/Night%20Sky%20Reports/DataUpdates/NightSkyReportProcess.gdb.zip?csf=1&web=1&e=oxb9yM. This folder will be updated with the latest sALR model, and users will be notified when a new geodatabase is available:
    a. sALR Database
    b. Extract contents of the gdb into the project folder: NightSkyMetricsReports\NightSkyReportGenerator\ArcPro\NightSkyReportProcess

Step 1b: Pull Updates to Workstation (Repeat After Step 1a)

  1. Open a terminal and navigate to the project directory:

cd [path to the place where you would like to save the project]

  1. Pull the latest updates:

git pull

  1. If "git pull" results in errors due to local modifications, you can overwrite your changes with:

git fetch --all git reset --hard origin/master

Step 2. Spatial analysis and mapping

  1. Ensure you have the latest geodatabase, which will contain the most recent ALR model. NPS employees can find it in the NSNSD SharePoint Software and Scripts folder, named NightSkyReportProcess.gdb.zip. Extract the contents into:
    NightSkyMetricsReports\NightSkyReportGenerator\ArcPro\NightSkyReportProcess
  2. Open NightSkyReportProcess.aprx.
  3. Select the Processing Map
  4. In NightSkyScripts.ipynb, update the "repgen" file path to your local project folder and change the park unit code to the park you are reporting on. Then, select Run All in the Cells menu.
  5. In the ParkOverview Layout, select the StudySites map. Remove all pre-existing park study sites or park boundary layers.
  6. In LayoutScripts_ParkOverview, select Run All in the Cells menu.
  7. Return to the ParkOverview Layout and refine the map by adjusting labels and zoom levels as needed. Double-click the map title to update the dynamic text to display the Unit_Name from the Park Unit boundary file. When satisfied, export the layout and save it in the park unit folder at:
    NightSkyMetricsReports\NightSkyReportGenerator\NightSkyReporting\Figures.
    In the folder of Replace the existing file named park_geographic_location.PNG.
  8. Select the ALR_PARK map in the sALR layout. Remove all pre-existing park boundary layers. In LayoutScripts_sALR, select Run All in the Cells menu.
  9. Return to the sALR layout and adjust the map to include nearby areas that may influence ALR results. Double-click the map title to update the dynamic text to display the Unit_Name. When satisfied, export the layout and save it in the appropriate park unit folder at:
    NightSkyMetricsReports\NightSkyReportGenerator\NightSkyReporting\Figures.
    In the folder of Replace the existing file named sALR.PNG.

Step 3. Data Exploration

  1. Navigate to the following location: NightSkyMetricsReports\NightSkyReportGenerator\NightSkyReporting. Open NightSkyReporting.Rproj
  2. Open the RMarkdown document, NSReportDataExplore.Rmd. In the Knit dropdown, select "Knit with Parameters."
  3. A data form will appear; enter the park unit code and select Knit.
  4. This will generate an HTML report saved in the same location as the .Rproj file. Use this report to explore the night sky data for the focal park unit. Choose a study site to highlight in the larger published report. It is advised to keep this report open for Step 4.

Step 4. Report Generation

  1. In the same R project as Step 3, open NSreportmkdown.Rmd.
  2. In the Knit dropdown, select "Knit with Parameters."
  3. A data form will appear. Enter the park name and unit code. Accept the default values for the ALR model and census data unless instructed otherwise by the project manager. Use the HTML report from Step 3 to fill out the information for the Site of Interest.
  4. Click Knit. After approximately 5–20 seconds, a Word document will be generated with a fully formatted report. This document will also be saved as NSreportmkdown.docx in the same location as the .Rproj.

Step 5. Finalize Report

  1. Move both reports from Steps 3 and 4 to the park folder at: NightSkyMetricsReports\NightSkyReportGenerator\NightSkyReporting\Parks
  2. It is recommended to rename the documents to associate them with the specific park.
  3. In the Word document, update all the text indicated in bold and noted with "~".
  4. Once the documents have been finalized and reviewed, they are ready for publication.

Public domain

This project is in the worldwide public domain:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published