Project

General

Profile

Download (39.2 KB) Statistics
| Branch: | Revision:
1 6cc19306 Jim Regetz
# Full sequence of (bash) commands used to transform the original
2
# organisms@jupiter home directory structure to the new layers@atlas
3
# home directory structure. This was done after first rsyncing the
4
# entire ~organisms home directory from jupiter onto atlas at
5
# /home/organisms, and creating a new 'layers' user with home directory
6
# /home/layers.
7
#
8
# Jim Regetz
9
# NCEAS
10
# Created on 23-Feb-2012
11
12
export ORGANISMS="/home/organisms"
13
export LAYERS="/home/layers"
14
15
#=======================================================================
16
# set up some directories
17
#=======================================================================
18
19
# create master home for all datasets
20
mkdir $LAYERS/data
21
mkdir $LAYERS/data/climate
22
mkdir $LAYERS/data/terrain
23
mkdir $LAYERS/data/land-cover
24
# create (temporary) home for associated readmes, documentation, etc
25
mkdir $LAYERS/documentation
26
mkdir $LAYERS/documentation/climate
27
mkdir $LAYERS/documentation/terrain
28
mkdir $LAYERS/documentation/land-cover
29
# create (temporary) home for processing code
30
mkdir $LAYERS/code
31
mkdir $LAYERS/code/climate
32
mkdir $LAYERS/code/terrain
33
mkdir $LAYERS/code/land-cover
34
# create (temporary) home for other cruft that i'm not quite ready to delete
35
mkdir $LAYERS/cruft
36
# create (temporary?) home for everything else
37
mkdir $LAYERS/experimental
38
mkdir $LAYERS/experimental/terrain
39
mkdir $LAYERS/experimental/land-cover
40
41
#=======================================================================
42
# carry out file migration, reorganization, and cleanup
43
#=======================================================================
44
45
#========#
46
# Marine #
47
#========#
48
49
# easy one ... just delete, as we're retaining this work on the original
50
# server
51
rm -rf Marine/
52
53
54
#=====#
55
# DEM #
56
#=====#
57
58
#
59
# SRTM 1km 
60
#
61
62
# migrate original rar file
63
mkdir $LAYERS/data/terrain/dem-cgiar-srtm-1km-ascii
64
mv $ORGANISMS/DEM/SRTM_1km_ASCII.rar $LAYERS/data/terrain/dem-cgiar-srtm-1km-ascii/srtm_1km_ascii.rar
65
# migrate clipped/reprojected bil
66
mv $ORGANISMS/Oregon_SRTM $LAYERS/data/terrain/dem-cgiar-srtm-1km-OR/
67
68
#
69
# CGIAR SRTM 90m
70
#
71
72
# SRTM 90m zips
73
mv $ORGANISMS/DEM/cgiarSrtm/archive $LAYERS/data/terrain/dem-cgiar-srtm-90m-zips
74
75
# SRTM 90m tiles and processed descendents
76
# first flatten out SRTM 90m directories
77
mv $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/Tiles_Resampled/Mosaiced \
78
   $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1_Resampled_Mosaiced
79
mv $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/Tiles_Resampled \
80
   $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1_Resampled
81
# now migrate to ~layers
82
mv $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1 \
83
   $LAYERS/data/terrain/dem-cgiar-srtm-90m-asc
84
mv $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1_Resampled \
85
   $LAYERS/data/terrain/dem-cgiar-srtm-90m-asc-resamp
86
mv $ORGANISMS/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1_Resampled_Mosaiced \
87
   $LAYERS/data/terrain/dem-cgiar-srtm-90m-asc-resamp-mosaic
88
89
# SRTM 90m tile index (zipped)
90
mkdir $LAYERS/data/terrain/dem-cgiar-srtm-90m-index-zip
91
mv $ORGANISMS/DEM/cgiarSrtm/srtm-tile-index_v4.1_shp.zip \
92
   $LAYERS/data/terrain/dem-cgiar-srtm-90m-index-zip/
93
94
# SRTM 90m tile index (unzipped)
95
mv $ORGANISMS/DEM/cgiarSrtm/index \
96
   $LAYERS/data/terrain/dem-cgiar-srtm-90m-index
97
98
# move readme to deal with later
99
mv $ORGANISMS/DEM/cgiarSrtm/README.txt $LAYERS/documentation/terrain/cgiar-srtm-90m-readme.txt
100
101
# remove now-empty directory
102
rmdir $ORGANISMS/DEM/cgiarSrtm
103
104
#
105
# ASTER GDEM2
106
#
107
108
# remove gdal-generated metadata files
109
rm $ORGANISMS/DEM/asterGdem2/*.aux.xml
110
rm $ORGANISMS/DEM/asterGdem2/90m_NoPixelOffset/*.aux.xml
111
rm $ORGANISMS/DEM/asterGdem2/90m_NoPixelOffset/Mosaiced/N59to60/*.aux.xml
112
113
# first flatten out directories
114
mv $ORGANISMS/DEM/asterGdem2/90m_NoPixelOffset/Mosaiced/N59to60 \
115
   $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset-Mosaiced-N59to60
116
mv $ORGANISMS/DEM/asterGdem2/90m_NoPixelOffset/Mosaiced \
117
   $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset-Mosaiced
118
mv $ORGANISMS/DEM/asterGdem2/90m_NoPixelOffset \
119
   $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset
120
# now migrate to ~layers
121
mv $ORGANISMS/DEM/asterGdem2 \
122
   $LAYERS/data/terrain/dem-aster-gdem2-30m-orig
123
mv $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset \
124
   $LAYERS/data/terrain/dem-aster-gdem2-90m-resamp
125
mv $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset-Mosaiced \
126
   $LAYERS/data/terrain/dem-aster-gdem2-90m-resamp-mosaic-N60to83
127
mv $ORGANISMS/DEM/asterGdem2-90m_NoPixelOffset-Mosaiced-N59to60 \
128
   $LAYERS/data/terrain/dem-aster-gdem2-90m-resamp-mosaic-N59to60
129
130
#
131
# ASTER GDEM1
132
#
133
134
#TODO
135
136
#
137
# CDED
138
#
139
140
# remove duplicate files (confirmed by diffing)
141
rm $ORGANISMS/DEM/CanadaDED/084b\ \(1\).zip
142
rm $ORGANISMS/DEM/CanadaDED/Monday/114p\ \(1\).zip 
143
rm $ORGANISMS/DEM/CanadaDED/mosaicMostCanadaDem.sh
144
rm $ORGANISMS/DEM/CanadaDED/Monday/mergeCanada104105.{tif,aux,rrd}
145
# migrate zips
146
mkdir $LAYERS/data/terrain/dem-cded-zip
147
mv -i $ORGANISMS/DEM/CanadaDED/0*.zip \
148
      $LAYERS/data/terrain/dem-cded-zip/
149
mv -i $ORGANISMS/DEM/CanadaDED/Monday/1*.zip \
150
      $LAYERS/data/terrain/dem-cded-zip/
151
# migrate documentation
152
mv -i $ORGANISMS/DEM/CanadaDED/CanadaDEDTechRefManual.pdf \
153
      $LAYERS/documentation/terrain/cded-TechRefManual.pdf
154
# migrate some stuff to experimental, for now...
155
mkdir $LAYERS/experimental/terrain/dem-cded
156
# ... vrt files, what the heck
157
mv -i $ORGANISMS/DEM/CanadaDED/*demFile.vrt \
158
      $LAYERS/experimental/terrain/dem-cded/
159
# ... misc scripts and log files
160
mv -i $ORGANISMS/DEM/CanadaDED/in*DemFile.txt \
161
      $LAYERS/experimental/terrain/dem-cded/
162
mv -i $ORGANISMS/DEM/CanadaDED/unzipFiles.sh \
163
      $LAYERS/experimental/terrain/dem-cded/unzipFiles_0.sh
164
mv -i $ORGANISMS/DEM/CanadaDED/Monday/unzipFiles.sh \
165
      $LAYERS/experimental/terrain/dem-cded/unzipFiles_1.sh
166
mv -i $ORGANISMS/DEM/CanadaDED/{.,/Monday}/*.sh \
167
      $LAYERS/experimental/terrain/dem-cded/
168
mv -i $ORGANISMS/DEM/CanadaDED/*.log \
169
      $LAYERS/experimental/terrain/dem-cded/
170
mv -i $ORGANISMS/DEM/CanadaDED/moscomps \
171
      $LAYERS/experimental/terrain/dem-cded/
172
mv -i $ORGANISMS/DEM/CanadaDED/Monday/filesToMosaic \
173
      $LAYERS/experimental/terrain/dem-cded/
174
mv -i $ORGANISMS/DEM/CanadaDED/Monday/*Log \
175
      $LAYERS/experimental/terrain/dem-cded/
176
# remove extracted data (no plans to use it), after determining that these are
177
# the set of files matching globs "*.dem" or "*_fgdc_*.{xml,html}"
178
# # ---- bash code ---#
179
#  # list out all files contained in the zips
180
#  cd $LAYERS/data/terrain/dem-cded-zip && ls \
181
#    | xargs -I+ sh -c 'unzip -l + | grep -e " 200[7-9]-"' \
182
#    | awk '{print $4}' > /home/layers/cded-extracts.txt
183
# # ----- R code -----#
184
#  # read in the extracted file names
185
#  extracts <- scan("/home/layers/cded-extracts.txt", what="")
186
#  # read in all CDED files stored in the organisms home dir
187
#  files <- list.files(path=c("/home/organisms/DEM/CanadaDED",
188
#       "/home/organisms/DEM/CanadaDED/Monday"))
189
#  # note that all zip contents had been extracted (...based on filename)
190
#  all(extracts %in% files)
191
#  ## [1] TRUE
192
#  # isolate files *not* extracted from the zips
193
#  others <- setdiff(files, extracts)
194
#  # show that all extracted filenames match one of two patterns
195
#  all(grepl("dem$", extracts) | grepl("_fgdc_", extracts))
196
#  ## [1] TRUE
197
#  # and show that no other files match these
198
#  any(grepl("dem$", others) | grepl("_fgdc_", others))
199
#  ## [1] FALSE
200
# # ------------------#
201
rm $ORGANISMS/DEM/CanadaDED/*.dem
202
rm $ORGANISMS/DEM/CanadaDED/*_fgdc_*.{xml,html}
203
rm $ORGANISMS/DEM/CanadaDED/Monday/*.dem
204
rm $ORGANISMS/DEM/CanadaDED/Monday/*_fgdc_*.{xml,html}
205
# now remove items of uncertain origin
206
rm $ORGANISMS/DEM/CanadaDED/*.dem.aux.xml
207
rm $ORGANISMS/DEM/CanadaDED/Monday/*.dem.aux.xml
208
rm $ORGANISMS/DEM/CanadaDED/*dem?.{aux,rrd}
209
rm $ORGANISMS/DEM/CanadaDED/Monday/*dem?.{aux,rrd}
210
rm $ORGANISMS/DEM/CanadaDED/*demFile.{aux,rrd,vrt.aux,tif.aux.xml,tif,vrt.rrd}
211
rm $ORGANISMS/DEM/CanadaDED/CDEMPlySRTMDf.aux
212
rm -r $ORGANISMS/DEM/CanadaDED/cdemplysrtmdf
213
rm -r $ORGANISMS/DEM/CanadaDED/info
214
# what the hell, remove other generated tifs because I really can't account for
215
# the details of their creation...
216
rm $ORGANISMS/DEM/CanadaDED/CanadaDemMos*.{tif,rrd,aux,aux.xml,tif.xml,img,vat.dbf}
217
rm $ORGANISMS/DEM/CanadaDED/mergeCanada104105.{tif,aux,rrd}
218
219
# remove now-empty directories
220
rmdir $ORGANISMS/DEM/CanadaDED/Monday
221
rmdir $ORGANISMS/DEM/CanadaDED
222
223
224
#
225
# FUSED DEM 
226
#
227
228
# remove gdal-generated metadata files
229
rm $ORGANISMS/DEM/GlobalProduct/*.aux.xml
230
# migrate to ~layers
231
mv $ORGANISMS/DEM/GlobalProduct $LAYERS/data/terrain/dem-fused
232
233
#
234
# GTOPO30
235
#
236
237
# remove gdal-generated metadata file
238
rm $ORGANISMS/DEM/usgsGTOPO30/e020n90/*.aux.xml
239
# now migrate to ~layers
240
mv $ORGANISMS/DEM/usgsGTOPO30 $LAYERS/data/terrain/dem-usgs-gtopo30
241
242
#
243
# GMTED2010
244
#
245
246
# remove gdal-generated metadata files
247
rm $ORGANISMS/GMTED2010/*.aux.xml
248
# remove ArcMap(?) schema lock file
249
rm $ORGANISMS/GMTED2010/GMTED2010_Spatial_Metadata/GMTED2010_Spatial_Metadata.shp.IGSKMNCNWK00726.6284.8844.sr.lock
250
# migrate original (I think) downloaded data (OR only)
251
mkdir $LAYERS/data/terrain/dem-gmted2010-mea300-OR-tiles
252
mv $ORGANISMS/GMTED2010/30N150W_20101117_gmted_mea300.tif \
253
   $LAYERS/data/terrain/dem-gmted2010-mea300-OR-tiles/
254
mv $ORGANISMS/GMTED2010/30N120W_20101117_gmted_mea300.tif \
255
   $LAYERS/data/terrain/dem-gmted2010-mea300-OR-tiles/
256
# migrate merged OR tiles (i think)
257
mkdir $LAYERS/data/terrain/dem-gmted2010-mea300-OR-mosaic
258
mv $ORGANISMS/GMTED2010/OR_Coverage.tif \
259
   $LAYERS/data/terrain/dem-gmted2010-mea300-OR-mosaic/
260
# migrate OR clipped/reprojected data
261
mkdir $LAYERS/data/terrain/dem-gmted2010-mea300-OR-clip-proj-sinu-tif
262
mv $ORGANISMS/GMTED2010/OR_ClippedToMODIS_InSinu.tif \
263
   $LAYERS/data/terrain/dem-gmted2010-mea300-OR-clip-proj-sinu-tif/
264
mkdir $LAYERS/data/terrain/dem-gmted2010-mea300-OR-clip-proj-sinu-bil
265
mv $ORGANISMS/GMTED2010/OR_ClippedToMODIS_InSinu.{prj,hdr,bil} \
266
   $LAYERS/data/terrain/dem-gmted2010-mea300-OR-clip-proj-sinu-bil/
267
# migrate shapefile
268
mv $ORGANISMS/GMTED2010/GMTED2010_Spatial_Metadata \
269
   $LAYERS/data/terrain/dem-gmted2010-spatial-metadata
270
# migrate documentation
271
mv $ORGANISMS/GMTED2010/of2011-1073.pdf $LAYERS/documentation/terrain/gmted2010-report.pdf
272
mv $ORGANISMS/GMTED2010/ReadMe $LAYERS/documentation/terrain/gmted2010-readme.txt
273
# remove now-empty directory
274
rmdir $ORGANISMS/GMTED2010
275
276
#
277
# Nunokawa content
278
#
279
280
# TODO: deal with data
281
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_82N.tif             # Int16 59N-82N GDEM2 elevation
282
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_below.tif           # Int16 59N-60N GDEM2 elevation
283
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_above.tif           # Int16 60N-61N GDEM2 elevation
284
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_straddle.tif        # Int16 59N-61N GDEM2 elevation (GDEM2 above, GDEM2 below)
285
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_straddle_a.tif      # Flt32 59N-61N GDEM2-based aspect
286
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_straddle_s.tif      # Flt32 59N-61N GDEM2-based slope
287
$ORGANISMS/DEM/Yuni/Data/aster2/aster2_*_below_blendgau.tif  # Flt32 59N-60N GDEM2/SRTM blended elevation
288
289
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_straddle.tif         # Int16 59N-61N GDEM2/SRTM unblended elevation (GDEM2 above, SRTM below)
290
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_straddle_a.tif       # Flt32 59N-61N unblended-based aspect
291
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_straddle_s.tif       # Flt32 59N-61N unblended-based aspect
292
293
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_blendgau.tif         # Int16 59N-61N GDEM2/SRTM blended elevation (GDEM2 above, blended below)
294
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_blendgau_a.tif       # Flt32 59N-61N blend-based aspect
295
$ORGANISMS/DEM/Yuni/Data/aster2/fused_*_blendgau_s.tif       # Flt32 59N-61N blend-based aspect
296
297
$ORGANISMS/DEM/Yuni/Data/srtm/srtm_*_below.tif               # Int16 59N-60N SRTM elevation
298
$ORGANISMS/DEM/Yuni/Data/srtm/srtm_*_below_a.tif             # Flt32 59N-60N SRTM-based aspect
299
$ORGANISMS/DEM/Yuni/Data/srtm/srtm_*_below_below_s.tif       # Flt32 59N-60N SRTM-based slope
300
301
$ORGANISMS/DEM/Yuni/Data/aster2/aster.vrt                    # VRT - GDEM2 from ~59N-82N (with 1/2-pixel offset)
302
$ORGANISMS/DEM/Yuni/Data/srtm/srtm.vrt                       # VRT - SRTM from ~55N-60N (with 1/2-pixel offset)
303
304
$ORGANISMS/DEM/Yuni/Data/GTOPO30/*.dem                       # 59N-~82N GTOPO30 elevation clipped
305
306
# remove duplicate file
307
rm $ORGANISMS/DEM/Yuni/Data/aster2/fused_w180w141
308
# remove redundant backup files (but leaving some others)
309
rm $ORGANISMS/DEM/Yuni/scripts/toAnalyzeData/aspect.r~
310
rm $ORGANISMS/DEM/Yuni/scripts/toAnalyzeData/check.r~
311
rm $ORGANISMS/DEM/Yuni/scripts/toAnalyzeData/meanElv.r~
312
rm $ORGANISMS/DEM/Yuni/scripts/toAnalyzeData/meanElv_onlyN59.r~
313
rm $ORGANISMS/DEM/Yuni/scripts/toAnalyzeData/
314
rm $ORGANISMS/DEM/Yuni/scripts/toProduceData/assembling.r~
315
rm $ORGANISMS/DEM/Yuni/scripts/toProduceData/gaussian.r~
316
rm $ORGANISMS/DEM/Yuni/scripts/toProduceData/mkVrt_Tiff.r~
317
rm $ORGANISMS/DEM/Yuni/scripts/toProduceData/slope_aspect.r~
318
# migrate scripts files
319
mv $ORGANISMS/DEM/Yuni/scripts \
320
   $LAYERS/code/terrain/nunokawa-scripts
321
# migrate documents
322
mv -i $ORGANISMS/DEM/Yuni/documents \
323
      $LAYERS/documentation/terrain/nunokawa-documents
324
mv -i $ORGANISMS/DEM/Yuni/missing_gdem2_tiles.txt \
325
      $LAYERS/documentation/terrain/nunokawa-documents/
326
mv -i $ORGANISMS/DEM/Yuni/metadata.txt \
327
      $LAYERS/documentation/terrain/nunokawa-documents/
328
329
#
330
# Remaining DEM content
331
#
332
333
mv $ORGANISMS/DEM/DEM_ProcessingScripts $LAYERS/code/terrain/
334
mv $ORGANISMS/DEM/ReadMeInProgress.txt $LAYERS/documentation/terrain/misc-partial-readme.txt
335
336
337
rm $ORGANISMS/DEM/checklog
338
mv $ORGANISMS/DEM/checkBadAsterGDEMFiles.sh $LAYERS/cruft/
339
mv $ORGANISMS/DEM/CheckGDEMLog.txt $LAYERS/cruft/
340
341
342
#=========#
343
# CLIMATE #
344
#=========#
345
346
#
347
# CRU
348
#
349
350
# migrate original gz data from CRU (or so it appears...)
351
mkdir $LAYERS/data/climate/cru-ts-3.0-1901-2006-gzip
352
mv $ORGANISMS/CRU_TS_3.0/*.gz $LAYERS/data/climate/cru-ts-3.0-1901-2006-gzip/
353
# I confirmed that the gunzipped files are identical to the gz contents (by
354
# gunzipping to /tmp and then diffing):w
355
# ...so let's delete the uncompressed versions
356
rm $ORGANISMS/CRU_TS_3.0/cru_ts_3_00.1901.2006.pre.nc
357
rm $ORGANISMS/CRU_TS_3.0/cru_ts_3_00.1901.2006.tmn.nc
358
rm $ORGANISMS/CRU_TS_3.0/cru_ts_3_00.1901.2006.tmp.nc
359
rm $ORGANISMS/CRU_TS_3.0/cru_ts_3_00.1901.2006.tmx.nc
360
# migrate extracted ASCII grid files
361
mv $ORGANISMS/CRU_TS_3.0/PRE $LAYERS/data/climate/cru-ts-3.0-1967-2006-asc-pre
362
mv $ORGANISMS/CRU_TS_3.0/TMN $LAYERS/data/climate/cru-ts-3.0-1967-2006-asc-tmn
363
mv $ORGANISMS/CRU_TS_3.0/TMP $LAYERS/data/climate/cru-ts-3.0-1967-2006-asc-tmp
364
mv $ORGANISMS/CRU_TS_3.0/TMX $LAYERS/data/climate/cru-ts-3.0-1967-2006-asc-tmx
365
# migrate R script for asc extraction
366
mv -i $ORGANISMS/CRU_TS_3.0/R/cru_3.0_data_extract.r $LAYERS/code/climate/
367
# rename then migrate readmes
368
rename 's/(Read_Me)/clim-cru-ts-3.0-\1/' $ORGANISMS/CRU_TS_3.0/Read_Me_*.txt
369
mv $ORGANISMS/CRU_TS_3.0/*Read_Me_*.txt $LAYERS/documentation/climate/
370
# now remove empty directory structure
371
find $ORGANISMS/CRU_TS_3.0 -depth -type d -exec rmdir {} \;
372
373
#
374
# GSOD
375
#
376
377
# for now, just move the whole thing as-is
378
mv $ORGANISMS/gsod $LAYERS/data/climate/gsod
379
380
#
381
# GHCN
382
#
383
384
# for now, just move the whole thing as-is
385
mv $ORGANISMS/ghcn $LAYERS/data/climate/ghcn
386
387
#
388
# MODIS LST
389
#
390
391
# migrate MOD11A1 V4 daily 1km L3 LST (March 1-7, 2000)
392
mv $ORGANISMS/MODIS\ LST/MOD11A1.004 $LAYERS/data/climate/MOD11A1.004-daily-1km-L3-LST/
393
# migrate MOD11A2 V4 8-day 1km L3 LST (March 5, 2000)
394
mkdir $LAYERS/data/climate/MOD11A2.004-8day-1km-L3-LST
395
mv $ORGANISMS/MODIS\ LST/2000.03.05 $LAYERS/data/climate/MOD11A2.004-8day-1km-L3-LST/
396
# also remove identical copies of the MOD11A2 data (confirmed by diffing)
397
rm $ORGANISMS/Modis_2000.03.05/MOD11A2.A2000065.*.hdf
398
rm $ORGANISMS/Modis_2000.03.05/MOD11A2.A2000065.*.hdf.xml
399
rmdir $ORGANISMS/Modis_2000.03.05
400
# remove now-empty directory
401
rmdir $ORGANISMS/MODIS\ LST
402
403
#
404
# MODIS LST -- Oregon
405
#
406
407
# migrate original MODIS OR hdfs (2001-2010?)
408
mkdir $LAYERS/data/climate/MOD11A1.004-OR-orig
409
mv $ORGANISMS/MODIS_LST_Oregon/MOD11A1.*.hdf \
410
   $LAYERS/data/climate/MOD11A1.004-OR-orig/
411
mv $ORGANISMS/MODIS_LST_Oregon/MOD11A1.*.hdf.xml \
412
   $LAYERS/data/climate/MOD11A1.004-OR-orig/
413
# migrate original MODIS OR hdfs (2000, not used)
414
mkdir $LAYERS/data/climate/MOD11A1.004-OR-orig-2000
415
mv $ORGANISMS/MODIS_LST_Oregon/2000\ _WithheldFromAVG/MOD11A1.A2000*.hdf \
416
   $LAYERS/data/climate/MOD11A1.004-OR-orig-2000/
417
mv $ORGANISMS/MODIS_LST_Oregon/2000\ _WithheldFromAVG/MOD11A1.A2000*.hdf.xml \
418
   $LAYERS/data/climate/MOD11A1.004-OR-orig-2000/
419
# migrate ClearDayCov OR img extracts (2001-2010?)
420
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-img
421
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/MOD11A1.*.img \
422
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img/
423
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/MOD11A1.*.img.aux.xml \
424
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img/
425
# migrate ClearDayCov OR img extracts (2000, not used)
426
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-2000
427
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/2000_WithheldFromAVG/MOD11A1.A2000*.005_ClearDay.img \
428
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-2000/
429
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/2000_WithheldFromAVG/MOD11A1.A2000*.005_ClearDay.img.aux.xml \
430
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-2000/
431
432
# migrate renamed ClearDayCov OR img extracts (2001-2010?)
433
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed
434
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/*.img \
435
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed/
436
# migrate renamed ClearDayCov OR img extracts (2000, not used)
437
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed-2000
438
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/2000_WithheldFromAVG/MOD11A1.A.2000.*.img \
439
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed-2000/
440
441
# migrate renamed ClearDayCov OR img extracts with corrected pixels
442
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed-fixed
443
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles/*.img \
444
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed-fixed/
445
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles/*.img.aux.xml \
446
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-img-renamed-fixed/
447
448
# migrate ClearDayCov OR daily avg tiles
449
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img
450
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day*.img \
451
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img/
452
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day*.img.aux.xml \
453
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img/
454
# migrate ClearDayCov OR daily avg mosaic imgs
455
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img
456
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.img \
457
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img
458
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.img.aux.xml \
459
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img
460
# migrate ClearDayCov OR daily avg mosaic bils
461
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-bil
462
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.prj \
463
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-bil/
464
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.bil \
465
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-bil/
466
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.bil.aux.xml \
467
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-bil/
468
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day*_Mosaic_DailyAvg_Scaled.hdr \
469
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-bil/
470
471
# migrate ClearDayCov OR monthly avg tiles
472
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-tiles-img
473
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Tiles/*_AVG_Scaled.img \
474
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-tiles-img/
475
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Tiles/*_AVG_Scaled.img.aux.xml \
476
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-tiles-img/
477
# migrate ClearDayCov OR monthly avg mosaic imgs
478
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-img
479
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.img \
480
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-img/
481
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.img.aux.xml \
482
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-img/
483
# migrate ClearDayCov OR monthly avg mosaic bils
484
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-bil
485
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.prj \
486
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-bil/
487
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.bil \
488
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-bil/
489
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.bil.aux.xml \
490
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-bil/
491
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/*Mosaic_MonthlyAvg_Scaled.hdr \
492
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-monthlyavg-mosaics-bil/
493
494
# migrate *old* (wrong?) ClearDayCov OR daily avg tiles
495
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img-OLD
496
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_DailyAverage_Tiles_Old/Day_*_Average_Scaled_*.img \
497
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img-OLD/
498
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_DailyAverage_Tiles_Old/Day_*_Average_Scaled_*.img.aux.xml \
499
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img-OLD/
500
# migrate *old* (wrong?) ClearDayCov OR daily avg mosaics
501
mkdir $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img-OLD
502
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_DailyAverage_Mosaic_Old/Day_*_ClearDay_Average.img \
503
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img-OLD/
504
mv $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_DailyAverage_Mosaic_Old/Day_*_ClearDay_Average.img.aux.xml \
505
   $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-mosaics-img-OLD/
506
507
# remove identical copies of (old) ClearDayCov daily avgs for tile h08v04 
508
# *Note*: I first confirmed that these are duplicate copies:
509
# for i in {1..366};
510
# do
511
#   diff -q $ORGANISMS/MODIS_LST_Oregon/DailyAvg1_old/Day_"$i"_Average_Scaled.img \
512
#           $LAYERS/data/climate/MOD11A1.004-OR-clearday-dailyavg-tiles-img-OLD/Day_"$i"_Average_Scaled_h08v04.img
513
# done
514
rm $ORGANISMS/MODIS_LST_Oregon/DailyAvg1_old/Day_{1..366}_Average_Scaled.img
515
rm $ORGANISMS/MODIS_LST_Oregon/DailyAvg1_old/Day_{1..366}_Average_Scaled.img.aux.xml
516
# remove now-empty directory
517
rmdir $ORGANISMS/MODIS_LST_Oregon/DailyAvg1_old
518
519
# remove misc bil statistics (stx) files)
520
rm $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day11_Mosaic_DailyAvg_Scaled.stx
521
rm $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/Day1_Mosaic_DailyAvg_Scaled.stx
522
rm $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/AprMosaic_MonthlyAvg_Scaled.stx
523
524
# remove pyc file
525
rm $ORGANISMS/MODIS_LST_Oregon/GDAL_Extract_ClearDay_from_HDF_Files.pyc
526
527
# move and (if needed) rename documentation files
528
mv -i $ORGANISMS/MODIS_LST_Oregon/1\ ReadMe\ First.txt \
529
      $LAYERS/documentation/climate/clim-MOD11A1.004-OR-orig-readme.txt
530
mv -i $ORGANISMS/MODIS_LST_Oregon/MODIS_Oregon_ProcessingInfo.doc \
531
      $LAYERS/documentation/climate/
532
mv -i $ORGANISMS/MODIS_LST_Oregon/2000\ _WithheldFromAVG/ReadMe \
533
      $LAYERS/documentation/climate/clim-MOD11A1.004-OR-orig-2000-readme.txt
534
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/1\ ReadMe\ First.txt \
535
      $LAYERS/documentation/climate/clim-MOD11A1.004-OR-clearday-readme.txt
536
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles/1\ ReadMe\ First \
537
      $LAYERS/documentation/climate/clim-MOD11A1.004-OR-clearday-img-renamed-fixed-readme.txt
538
      
539
# move scripts
540
mkdir $LAYERS/code/climate/modis-lst-oregon
541
mv -i $ORGANISMS/MODIS_LST_Oregon/GDAL_Extract_ClearDay_from_HDF_Files.py \
542
      $LAYERS/code/climate/modis-lst-oregon/
543
mv -i $ORGANISMS/MODIS_LST_Oregon/QCTagCheck \
544
      $LAYERS/code/climate/modis-lst-oregon/QCTagCheck.py
545
mv -i $ORGANISMS/MODIS_LST_Oregon/ConvertMODIStobil.py \
546
      $LAYERS/code/climate/modis-lst-oregon/
547
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/DayAVGCalcs_h08v04TIles.r \
548
      $LAYERS/code/climate/modis-lst-oregon/
549
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/DayAVGCalcs_h09v04TIles.r \
550
      $LAYERS/code/climate/modis-lst-oregon/
551
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics/LST_Mosaicing_DailyAvgs.r \
552
      $LAYERS/code/climate/modis-lst-oregon/
553
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/LST_Mosaicing_MonthlyAvgs.R \
554
      $LAYERS/code/climate/modis-lst-oregon/
555
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics/Conversion_hdf_to_img.py \
556
      $LAYERS/code/climate/modis-lst-oregon/
557
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles/h09v04Tiles_BadPixelCorrection.r \
558
      $LAYERS/code/climate/modis-lst-oregon/
559
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles/h08v04Tiles_BadPixelCorrection.r \
560
      $LAYERS/code/climate/modis-lst-oregon/
561
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/Convert\ MODIS\ Day\ of\ Year\ to\ Date\ File\ Name.py \
562
      $LAYERS/code/climate/modis-lst-oregon/
563
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Tiles/MonthlyAvgCalcs_h08v04Tiles.r \
564
      $LAYERS/code/climate/modis-lst-oregon/
565
mv -i $ORGANISMS/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Tiles/MonthlyAvgCalcs_h09v04Tiles.r \
566
      $LAYERS/code/climate/modis-lst-oregon/
567
568
# move last few things...
569
mv -i $ORGANISMS/MODIS_LST_Oregon/hdf.txt \
570
      $LAYERS/cruft/clim-MOD11A1.004-OR-orig-hdf.txt
571
mv -i $ORGANISMS/MODIS_LST_Oregon/SDS_PctFills.txt \
572
      $LAYERS/cruft/clim-MOD11A1.004-OR-orig-SDS_PctFills.txt
573
574
# remove all the now-empty directories...
575
# tree $ORGANISMS/MODIS_LST_Oregon
576
# /home/organisms/MODIS_LST_Oregon
577
# .
578
# ├── 2000 _WithheldFromAVG
579
# └── ClearDayGDAL
580
#     ├── ClearDay_DailyAverage_Mosaic_Old
581
#     ├── ClearDay_DailyAverage_Tiles_Old
582
#     ├── ClearDay_Original_IMG_Extracts
583
#     │   ├── 2000_WithheldFromAVG
584
#     │   └── ByDate
585
#     │       ├── 2000_WithheldFromAVG
586
#     │       └── BadPixelsCorrected_Tiles
587
#     ├── NewClearDay_DailyAvgs_Mosaics
588
#     ├── NewClearDay_DailyAvgs_Tiles
589
#     ├── NewClearDay_MonthlyAvgs_Mosaics
590
#     └── NewClearDay_MonthlyAvgs_Tiles
591
find $ORGANISMS/MODIS_LST_Oregon -depth -type d -exec rmdir {} \;
592
593
# last but not least, deal with top level R directory
594
# ...move some (old? superceded?) scripts
595
mv -i $ORGANISMS/R/ReClass Clear Day Rasters h08v04.r \
596
      $LAYERS/code/climate/modis-lst-oregon/
597
mv -i $ORGANISMS/R/Calc Clear Day Daily Avg.r \
598
      $LAYERS/code/climate/modis-lst-oregon/
599
mv -i $ORGANISMS/R/Mosaic Clear Day Average Grids.r \
600
      $LAYERS/code/climate/modis-lst-oregon/
601
mv -i $ORGANISMS/R/Calc Clear Day Monthly Avg.r \
602
      $LAYERS/code/climate/modis-lst-oregon/
603
# don't know how this was created, but it's clearly derived data... 
604
mv -i $ORGANISMS/R/Modis_LSTdaily_climatology $LAYERS/data/clim-modis-lstdaily
605
# remove now-empty directory
606
rmdir $ORGANISMS/R
607
608
#
609
# TRMM
610
#
611
612
# this was an *empty* directory! removing...
613
rmdir $ORGANISMS/TRMM
614
615
#
616
# WorldClim
617
#
618
619
# migrate each one into its own directory
620
mkdir $LAYERS/data/climate/worldclim-bio-30s-esri-zip
621
mv $ORGANISMS/WorldClim/bio_30s_esri.zip $LAYERS/data/climate/worldclim-bio-30s-esri-zip/
622
mkdir $LAYERS/data/climate/worldclim-prec-30s-esri-zip
623
mv $ORGANISMS/WorldClim/prec_30s_esri.zip $LAYERS/data/climate/worldclim-prec-30s-esri-zip/
624
mkdir $LAYERS/data/climate/worldclim-tmax-30s-esri-zip
625
mv $ORGANISMS/WorldClim/tmax_30s_esri.zip $LAYERS/data/climate/worldclim-tmax-30s-esri-zip/
626
mkdir $LAYERS/data/climate/worldclim-tmean-30s-esri-zip
627
mv $ORGANISMS/WorldClim/tmean_30s_esri.zip $LAYERS/data/climate/worldclim-tmean-30s-esri-zip/
628
mkdir $LAYERS/data/climate/worldclim-tmin-30s-esri-zip
629
mv $ORGANISMS/WorldClim/tmin_30s_esri.zip $LAYERS/data/climate/worldclim-tmin-30s-esri-zip/
630
# remove now-empty directory
631
rmdir $ORGANISMS/WorldClim
632
633
634
#============#
635
# LAND COVER #
636
#============#
637
638
#
639
# GLCNMO
640
#
641
642
# for now, just move the whole thing as-is
643
mv $ORGANISMS/GLCNMO $LAYERS/experimental/land-cover/
644
645
#
646
# GlobCover
647
#
648
# migrate what seems like the original data (?)
649
mkdir $LAYERS/data/land-cover/GlobCover-v2.2
650
mv -i $ORGANISMS/GlobCoverv2.2/GLOBCOVER_200412_200606_V2.2_Global_CLA* \
651
      $LAYERS/data/land-cover/GlobCover-v2.2/
652
# migrate mysterious derivatives of the above
653
mkdir $LAYERS/data/land-cover/GlobCover-v2.2-arcgis
654
mv -i $ORGANISMS/GlobCoverv2.2/globcov22_beh $LAYERS/data/land-cover/GlobCover-v2.2-arcgis/
655
mv -i $ORGANISMS/GlobCoverv2.2/globcoverv22 $LAYERS/data/land-cover/GlobCover-v2.2-arcgis/
656
# migrate reference info to documentation area
657
mv -i $ORGANISMS/GlobCoverv2.2/Globcover_* $LAYERS/documentation/land-cover/
658
# remove now-empty directory
659
rmdir $ORGANISMS/GlobCoverv2.2
660
661
#
662
# LandCover (whatever that is)
663
#
664
665
# remove gdal-generated metadata file
666
rm $ORGANISMS/LandCover/Layer10_Clip1.tif.aux.xml
667
# migrate original OR landcover tiles
668
mkdir $LAYERS/data/land-cover/lc-OR-tiles
669
mv $ORGANISMS/LandCover/Layer*_Clip[1-3].tif \
670
   $LAYERS/data/land-cover/lc-OR-tiles/
671
# migrate OR landcover mosaics
672
mkdir $LAYERS/data/land-cover/lc-OR-mosaic
673
mv $ORGANISMS/LandCover/Layer*_Mosaic.tif \
674
   $LAYERS/data/land-cover/lc-OR-mosaic/
675
# migrate OR clipped/reprojected landcover mosaics
676
mkdir $LAYERS/data/land-cover/lc-OR-mosaic-clip-proj-sinu
677
mv $ORGANISMS/LandCover/Layer*_ClippedToMODIS_Sinu.* \
678
   $LAYERS/data/land-cover/lc-OR-mosaic-clip-proj-sinu/
679
# migrate OR multiband clipped/reprojected landcover mosaic
680
mkdir $LAYERS/data/land-cover/lc-OR-mosaic-clip-proj-sinu-multiband
681
mv $ORGANISMS/LandCover/Final_Multiband_SinuGrid.* \
682
   $LAYERS/data/land-cover/lc-OR-mosaic-clip-proj-sinu-multiband/
683
# migrate documentation
684
mv $ORGANISMS/LandCover/ReadMe $LAYERS/documentation/land-cover/landcover-ReadMe.txt
685
mv $ORGANISMS/LandCover/LCT\ calculations.xlsx $LAYERS/documentation/land-cover/
686
mv $ORGANISMS/LandCover/landcover_method_v3.docx $LAYERS/documentation/land-cover/
687
# migrate scripts
688
mv $ORGANISMS/LandCover/CheckForNoDataValues_LandCoverFiles.txt $LAYERS/code/land-cover/
689
# remove now-empty directory
690
rmdir $ORGANISMS/LandCover
691
692
#
693
# Tree height
694
#
695
696
# migrate $ORGANISMS/Tree_height/Lefsky2010
697
mkdir $LAYERS/data/land-cover/treeheight-lefsky2010
698
mv $ORGANISMS/Tree_height/Lefsky2010/x2_080809_global.img \
699
   $LAYERS/data/land-cover/treeheight-lefsky2010/
700
mv $ORGANISMS/Tree_height/Lefsky2010/p_080809_global.img* \
701
   $LAYERS/data/land-cover/treeheight-lefsky2010/
702
# migrate associated publication do documentation area
703
mv $ORGANISMS/Tree_height/Lefsky2010/Lefsky\ et\ al.\ 2010\ GeoRLett.pdf \
704
   $LAYERS/documentation/land-cover/treeheight-Lefsky2010-GeoRLett.pdf
705
# remove now-empty directory
706
rmdir $ORGANISMS/Tree_height/Lefsky2010
707
708
# migrate $ORGANISMS/Tree_height/Simard2011
709
mkdir $LAYERS/data/land-cover/treeheight-simard2011
710
mv $ORGANISMS/Tree_height/Simard2011/Simard_Pinto_3DGlobalVeg_JGR.tif \
711
   $LAYERS/data/land-cover/treeheight-simard2011/
712
# remove gdal-generated metadata file
713
rm $ORGANISMS/Tree_height/Simard2011/Simard_Pinto_3DGlobalVeg_JGR.tif.aux.xml
714
# migrate clipped/reprojected file (bil)
715
mkdir $LAYERS/data/land-cover/treeheight-simard2011-OR-clip-proj-sinu-bil
716
mv $ORGANISMS/Tree_height/Simard2011/GlobalCanopy_ClippedToMODIS_InSinu.* \
717
   $LAYERS/data/land-cover/treeheight-simard2011-OR-clip-proj-sinu-bil/
718
# migrate documentation
719
mv $ORGANISMS/Tree_height/Simard2011/SimardEtAl2011_GlobalTreeHeight_WithLIDAR.pdf \
720
   $LAYERS/documentation/land-cover/treeheight-SimardEtAl_GlobalTreeHeight_WithLIDAR.pdf
721
mv $ORGANISMS/Tree_height/Simard2011/ReadMe \
722
   $LAYERS/documentation/land-cover/treeheight-ReadMe.txt
723
# remove remaining files as per instructions from Natalie Robinson
724
rm $ORGANISMS/Tree_height/Simard2011/Test_Clip.tif
725
rm $ORGANISMS/Tree_height/Simard2011/GDALTranslate_test.*
726
rm $ORGANISMS/Tree_height/Simard2011/GDALTranslate_DT_int16.*
727
# remove now-empty directory
728
rmdir $ORGANISMS/Tree_height/Simard2011
729
730
# lastely, remove now-empty Tree_height directory
731
rmdir $ORGANISMS/Tree_height
732
733
734
#=================#
735
# Remaining stuff #
736
#=================#
737
738
#
739
# top level directory
740
#
741
742
# move top level notes
743
mv $ORGANISMS/Oregon_CaseStudy_FileProcessingInfo $LAYERS/documentation/
744
mv $ORGANISMS/ReProjection_To_MODIS $LAYERS/documentation/
745
mv $ORGANISMS/README.txt $LAYERS/documentation/organisms-homedir-readme.txt
746
mv $ORGANISMS/CHANGES.txt $LAYERS/documentation/organisms-homedir-changes.txt
747
# move old file extension summary
748
mv -i $ORGANISMS/file-extension-summary.txt $LAYERS/cruft/
749
750
#
751
# Desktop
752
#
753
754
# move MRT installer to cruft
755
mv $ORGANISMS/Desktop/MRT_download_Linux $LAYERS/cruft/
756
# remove orphaned bil metadata file
757
rm $ORGANISMS/Desktop/ASTER_Test.bil.aux.xml
758
# remove empty Desktop dir
759
rmdir $ORGANISMS/Desktop
760
761
#
762
# pyhdf
763
#
764
765
# move pyhdf package to cruft
766
mv $ORGANISMS/pyhdf $LAYERS/cruft/
767
768
#
769
# GIS/GDD
770
#
771
772
# confirmed that /tmean contains unzipped tmean, except there are additional
773
# aux files presumably autogenerated by Arc -- I'm find with deleting them
774
# # ---- bash code ---#
775
# cd /tmp && unzip $ORGANISMS/GIS/GDD/tmean_30s_esri.zip
776
# diff -qr /tmp/tmean /home/organisms/GIS/GDD/tmean_30s_esri/tmean/
777
#  done
778
# # ------------------#
779
# delete the uncompressed tmean_30s_esri directory
780
rm -r $ORGANISMS/GIS/GDD/tmean_30s_esri
781
782
# confirmed that WorldClim zips are identical to what we already have elsewhere
783
# # ---- bash code ---#
784
# for var in {'prec','tmin','tmax','tmean','bio'}
785
# do
786
#   diff -s $ORGANISMS/GIS/GDD/"$var"_30s_esri.zip \
787
#           $LAYERS/data/climate/worldclim-"$var"-30s-esri-zip/*.zip
788
# done
789
#  done
790
# # ------------------#
791
# delete the duplicate worldclim zips
792
rm $ORGANISMS/GIS/GDD/prec_30s_esri.zip
793
rm $ORGANISMS/GIS/GDD/tmin_30s_esri.zip
794
rm $ORGANISMS/GIS/GDD/tmax_30s_esri.zip
795
rm $ORGANISMS/GIS/GDD/tmean_30s_esri.zip
796
rm $ORGANISMS/GIS/GDD/bio_30s_esri.zip
797
798
# confirmed that all MODIS files here are identical to (though in fact they are
799
# only a subset of) what we already have elsewhere
800
# # ---- bash code ---#
801
# for dir in `ls $ORGANISMS/GIS/GDD/MOD11A1.004`
802
#  do
803
#    echo checking "$dir"...
804
#    ls $ORGANISMS/GIS/GDD/MOD11A1.004/"$dir" \
805
#     | xargs -I+ \
806
#         diff -q $ORGANISMS/GIS/GDD/MOD11A1.004/"$dir"/+ \
807
#                 $LAYERS/data/climate/MOD11A1.004-daily-1km-L3-LST/"$dir"/+
808
#  done
809
# # ------------------#
810
# delete the duplicate MODIS data
811
# note that the last 3 dirs were already empty...
812
rm $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.01/MOD11A1.A2000*.{hdf,hdf.xml}
813
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.01
814
rm $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.02/MOD11A1.A2000*.{hdf,hdf.xml}
815
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.02
816
rm $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.03/MOD11A1.A2000*.{hdf,hdf.xml}
817
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.03
818
rm $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.04/MOD11A1.A2000*.{hdf,hdf.xml}
819
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.04
820
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.05
821
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.06
822
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004/2000.03.07
823
rmdir $ORGANISMS/GIS/GDD/MOD11A1.004
824
825
# migrate remaining text (script?) file
826
mv $ORGANISMS/GIS/GDD/map\ algebra.txt $LAYERS/code/climate/gdd-worldclim-tmean-map-algebra.txt
827
# remove empty directory
828
rmdir $ORGANISMS/GIS/GDD
829
830
#
831
# GIS/terrain
832
#
833
834
# remove empty test directory
835
rmdir $ORGANISMS/GIS/terrain/test
836
# for now just migrate everything else to experimental area
837
mv $ORGANISMS/GIS/terrain $LAYERS/experimental/terrain/arcgis
838
839
# remove empty directory
840
rmdir $ORGANISMS/GIS
841
842
#
843
# Oregon
844
#
845
846
# TODO
847
848
#
849
# steph
850
#
851
852
# delete as per verbal instructions from Stephanie Pau
853
rm -rf $ORGANISMS/steph
854
855
#
856
# topo
857
#
858
859
# for now just migrate to experimental area
860
mv $ORGANISMS/topo $LAYERS/experimental/
861
862
#
863
# temp_benoit
864
#
865
866
# for now just migrate to experimental area
867
mv $ORGANISMS/temp_benoit $LAYERS/experimental/
868
869
870
#=======================================================================
871
# fix up permissions and ownership
872
#=======================================================================
873
874
chgrp -R layers $LAYERS/data
875
find $LAYERS/data -type f -exec chmod 640 {} \;
876
find $LAYERS/data -type d -exec chmod g-s {} \;
877
find $LAYERS/data -type d -exec chmod 750 {} \;
878 7526fb1c Jim Regetz
879
880
#=======================================================================
881
# now migrate code into git repository clone
882
#=======================================================================
883
884
# nunokawa terrain scripts
885
mkdir terrain/research/gtopo30
886
mv -i code/terrain/nunokawa-scripts/toProduceData/clipUSGS.r terrain/research/gtopo30/
887
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/check.r terrain/tests/
888
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/meanElv_OnlyN59.r terrain/research/north-60/
889
rm code/terrain/nunokawa-scripts/toAnalyzeData/meanElv.r 
890
rm code/terrain/nunokawa-scripts/toAnalyzeData/Deltas.r~
891
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/Deltas.r terrain/research/north-60/
892
rm code/terrain/nunokawa-scripts/toAnalyzeData/rmse_cor.r~ 
893
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/rmse_cor.r terrain/research/north-60/
894
rm code/terrain/nunokawa-scripts/toAnalyzeData/slope.r~
895
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/{aspect,slope}.r terrain/research/north-60/
896
mv -i code/terrain/nunokawa-scripts/toAnalyzeData/negativeTable.r terrain/research/north-60/
897
mv -i code/terrain/nunokawa-scripts/toProduceData/*.{r,r~} terrain/research/north-60/
898
899
# robinson terrain scripts
900
mv -i code/terrain/DEM_ProcessingScripts/Aster_CheckMosaicedTilesExtents.py terrain/tests/
901
mv -i code/terrain/DEM_ProcessingScripts/CheckPixelValuesAtOverlapZones.txt terrain/tests/
902
mv -i code/terrain/DEM_ProcessingScripts/Aster\&SRTM_* terrain/tests/
903
mv -i code/terrain/DEM_ProcessingScripts/Gaussian_Blend.r terrain/procedures/
904
mv -i terrain/tests/Aster\&SRTM_* terrain/procedures/
905
mv -i code/terrain/DEM_ProcessingScripts/SRTM_ClipToN59to60.txt terrain/procedures/
906
mv -i code/terrain/DEM_ProcessingScripts/Mosaicing_AllTiles_East\&WestHemispheres.txt terrain/procedures/
907
mv -i code/terrain/DEM_ProcessingScripts/AsterMosaicingScripts terrain/procedures/
908
909
# robinson land-cover check
910
mv -i code/land-cover/CheckForNoDataValues_LandCoverFiles.txt land-cover/tests/
911
912
# robinson/donoghue Oregon MODIS LST processing code
913
mkdir climate/research/oregon
914
mkdir climate/research/oregon/modis-lst
915
mv -i code/climate/modis-lst-oregon/*.{r,R,py} climate/research/oregon/modis-lst/
916
917
# misc old (authorless) climate code
918
mv -i code/climate/cru_3.0_data_extract.r climate/procedures/
919
mv -i code/climate/gdd-worldclim-tmean-map-algebra.txt climate/extra/
920
921
# TODO: set all file permissions to 644 before committing