Git Product home page Git Product logo

spires's Introduction

Snow Property Inversion from Remote Sensing (SPIReS)

Landsat 8 OLI

  1. To run an example scence from 20160426 for p42r34, download the zip and m file (2.2 GB) from: https://snow.ucsb.edu/products/SPIRES/Landsat8/example/

  2. Checkout the code, https://github.com/edwardbair/SPIRES.git

  3. Add the code directory and all its subdirectories to your MATLAB path, "addpath(genpath([location where you checked out the code to]))"

  4. run L8_spires_example.m from MATLAB. Tested using R2022B. This latest version of MATLAB will produce some warnings about pixcenters that can be ignored.

MODIS

Requires MATLAB + Parallel Computing Toolbox + mapping & some other toolboxes

  1. Download R0, cc, watermask, fice, and Z for a given tile or set of tiles from: https://snow.ucsb.edu/products/SPIRES/MODIS/Inputs/MODIS/

For example, for h09v04, the R0 file is https://snow.ucsb.edu/products/SPIRES/MODIS/Inputs/MODIS/R0/h09v04R0.mat

  1. Checkout the code, https://github.com/edwardbair/SPIRES.git

  2. Adjust "RunScripts/run_batch_spires_example.sh"
    l9 - codedir - where you checout code to


l10 - mccmfile - where the .net file in lives, i.e., https://github.com/edwardbair/SPIRES/blob/master/MccM/net.mat
l11 - Ffile - lookup table, i.e., https://snow.ucsb.edu/products/SPIRES/MODIS/Sierra/ExampleData/lut_modis_b1to7_3um_dust.mat
l12 - HDF MOD09GA reflectance files, i.e. https://snow.ucsb.edu/products/SPIRES/MODIS/Sierra/ExampleData/mod09ga/
l15-20 - paths to inputs from 1.

l 24 - # of cores for parpool

l 27-41 - keep as is

l 44 adjust WYs if needed l 47 adjust tiles if needed

  1. Execute run_batch_spires_example.sh at the terminal or run as a SLURM job https://github.com/edwardbair/SPIRES/blob/master/RunScripts/SPIRES_tlun_slurm.sh

Notes:

Running the full year will take a long time and a lot of RAM, depending on the number of cores used. Using 60 AMD EPYC cores, plan on about 6 hours and about 400GB RAM, or about 7 GB RAM/core. For testing, you can run with a single core.

The minimum amount of time that'll work for smoothSPIREScube is 1 calendar month, i.e dom 1 through 28 to 31, but the smoothing needs a full water year. You can increase "tolval" to speed up computations and decrease quality. You're smart, you'll figure it out.

Reference:

Bair, E.H., Stillinger, T., and Dozier, J. (2021) Snow Property Inversion from Remote Sensing (SPIReS), IEEE Transactions on Remote Sensing and Geoscience, doi: 10.1109/TGRS.2020.3040328

NB 2024-01-05

spires's People

Contributors

dozierjeff avatar edwardbair avatar timbo-stillinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spires's Issues

source of offset band of fsca=0 in L8 SPIRES

tt=NDSI <= -0.5;

out.(outvars{j})(tt,i)=0;

Hey Ned,

I think this is the source of the band of fsca=0 in some of the L8 spires outputs. The issue is when R and R0 do not align, which is often, i.e. the edge of the swath is different on the two dates. In line 178 of the code when the matrix is filled up with the answers, fsca=0 gets pasted into areas where R0=valid measurement but R=NaN. It is different than Line 76 to 78, which correctly nans out the areas where R=NaN and R0=valid.

t=NDSI > -0.5 & ~daymask & ~isnan(thissolarZ) & all(~isnan(thisR),2);

Prior to get_spires, the nanmask is only based on R0 - line 74 and line 124 of run_spires_landsat.m, so we just need to figure out a better way to account for the fact that along the swath edges R and R0 might no have 1:1 matches of valid measurements, either can have NaNs when the other has surface reflectance, and those should all be Nan's.

lots of changes to stuff in the Mapping folder

See the Mapping folder in the RasterReprojection repository. Revised to handle the ProjectedCRS field in the raster reference object. Also anticipating that the referencing matrix will go away sometime.
Although you can copy stuff from my folder, it might be best to link if that's possible.
rasterrefMODtile replaces sinusoidProjMODtile

Speedup with unique?

[c,im,~]=uniquetol(M,tolval,'ByRows',true,'DataScale',1,...

Looking into a speedup here using unique per your suggestion, but I'm getting hung up because 1) there's no option for "OutputAllIndices" for IA ; 2) GPU acceleration doesn't work for OutputAllIndices or ByRows.

uniquetol is a built-in black box, but the source for unique is viewable. Maybe it can be modified to do what we need?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.