SCECcode / ucvm

UCVM is used to query seismic velocity models for earth properties (Vp, Vs, density) by lat,long, and depth. It can create velocity meshes used in seismic wave propagation simulations. This repo contains the source codes that implement the core UCVM query interface. Python-based plotting modules, based on matplotlib, are now hosted in a separate github repo called SCECcode/ucvm_plotting.
https://www.scec.org/research/ucvm
BSD 3-Clause "New" or "Revised" License
19 stars 3 forks source link

modular basins #3

Closed andreasplesch closed 2 years ago

andreasplesch commented 3 years ago

An issue to start organizing how to potentially add basin modules to ucvm.

The cvmh repo may be a better place to share files ?

https://github.com/SCECcode/cvmh

andreasplesch commented 3 years ago

Concept figure by example of LA basin:

image

meihuisu commented 3 years ago

Are these basins going to be accessed through cvmh ? or are they going to be separate standalone models?


From: Andreas Plesch @.> Sent: Monday, October 4, 2021 9:48 AM To: SCECcode/ucvm @.> Cc: Subscribed @.***> Subject: [SCECcode/ucvm] modular basins (#3)

An issue to start organizing how to potentially add basin modules to ucvm.

The cvmh repo may be a better place to share files ?

https://github.com/SCECcode/cvmhhttps://urldefense.com/v3/__https://github.com/SCECcode/cvmh__;!!LIr3w8kk_Xxm!_fOauK75dlZzUFnKvBMZJ7vHe0NhvrhpSoiKHGN9xYGrms4DIsFgKYox3aE$

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/SCECcode/ucvm/issues/3__;!!LIr3w8kk_Xxm!_fOauK75dlZzUFnKvBMZJ7vHe0NhvrhpSoiKHGN9xYGrms4DIsFgXE997R8$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ACE7UF6NBKGESHUT7KXCUUTUFHLEDANCNFSM5FJZUO5A__;!!LIr3w8kk_Xxm!_fOauK75dlZzUFnKvBMZJ7vHe0NhvrhpSoiKHGN9xYGrms4DIsFg-4eve6w$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!LIr3w8kk_Xxm!_fOauK75dlZzUFnKvBMZJ7vHe0NhvrhpSoiKHGN9xYGrms4DIsFgtKAGmQ4$ or Androidhttps://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!LIr3w8kk_Xxm!_fOauK75dlZzUFnKvBMZJ7vHe0NhvrhpSoiKHGN9xYGrms4DIsFgVmL1YDk$.

andreasplesch commented 3 years ago

Hi there. Let's discuss this. I think the idea is that they are separate, so they can be developed further independently.

andreasplesch commented 3 years ago

An example grid:

image

andreasplesch commented 3 years ago

An example voxet: ~CVMH15-1-Los-Angeles-Basin.zip~ CVMHB-Los-Angeles-Basin.zip

The .vo description:

GOCAD Voxet 1 
HEADER {
name: CVMHB-Los-Angeles-Basin
*painted*variable: tag61_basin
painted: on
sections: 3 1 1 39 2 0 0 3 1 66 
last_selected_folder: Sections
*axis*grid: false
*sections*grid: true
*sections*grid*sampling: 0
ascii: off
real_value: on
}
GOCAD_ORIGINAL_COORDINATE_SYSTEM
NAME Default
PROJECTION Unknown
DATUM Unknown
AXIS_NAME X Y Z
AXIS_UNIT m m m
ZPOSITIVE Elevation
END_ORIGINAL_COORDINATE_SYSTEM
CLASSIFICATION "3D Survey" Seismic "3D Survey"
AXIS_O 131000 3431000 -15000 
AXIS_U 697000 0 0 
AXIS_V 0 627000 0 
AXIS_W 0 0 19900 
AXIS_MIN 0.314203739 0.349282295 0 
AXIS_MAX 0.494978487 0.550239205 1 
AXIS_N 127 127 200 
AXIS_NAME axis-1 axis-2 axis-3
AXIS_LABEL_MIN 220 220 1 
AXIS_LABEL_MAX 346 346 200 
AXIS_UNIT "number" "number" "number" 
AXIS_TYPE even even even

PROPERTY 1 vp63_basin
PROPERTY_CLASS 1 "compressional velocity"
PROPERTY_KIND 1 " Compressional Velocity" 
PROPERTY_CLASS_HEADER 1 " compressional velocity"  {
kind: Compressional Velocity
unit: m/s
low_clip: 1481
high_clip: 6000
last_selected_folder: Property
*colormap*reverse: true
colormap: Spectral
*colormap*low_clip_transparent: false
*colormap*nodata*transparency: 1
*colormap*nodata: false

}
PROPERTY_SUBCLASS 1 QUANTITY Float
PROP_ORIGINAL_UNIT 1 none
PROP_UNIT 1 m/s
PROP_NO_DATA_VALUE 1 -99999
PROP_SAMPLE_STATS 1 4328 3276.28 723642 1565.98 5637.12
PROP_ESIZE 1 4
PROP_ETYPE 1  IEEE
PROP_FORMAT 1 RAW
PROP_OFFSET 1 0
PROP_FILE 1 CVMHB-Los-Angeles-Basin_vp63_basin@@

PROPERTY 2 vs63_basin
PROPERTY_CLASS 2 vs63
PROPERTY_KIND 2 unknown
PROPERTY_CLASS_HEADER 2 vs63 {
kind: unknown
name: vs63
low_clip: 0
high_clip: 5000
pclip: 99
colormap: flag
*colormap*nbcolors: 40
*colormap*reverse: true
unit: unitless
*colormap*flag*colors: 0 0 0 1 128 1 1 1 255 1 0 0 
}
PROPERTY_SUBCLASS 2 QUANTITY Float
PROP_ORIGINAL_UNIT 2 none
PROP_UNIT 2 unitless
PROP_NO_DATA_VALUE 2 -99999
PROP_SAMPLE_STATS 2 4328 1641.13 506382 177.57 3373.13
PROP_ESIZE 2 4
PROP_ETYPE 2  IEEE
PROP_FORMAT 2 RAW
PROP_OFFSET 2 0
PROP_FILE 2 CVMHB-Los-Angeles-Basin_vs63_basin@@

PROPERTY 3 tag61_basin
PROPERTY_CLASS 3 tag61
PROPERTY_KIND 3 unknown
PROPERTY_CLASS_HEADER 3 tag61 {
kind: unknown
name: tag61
pclip: 99
unit: unitless
high_clip: 6.5
low_clip: 0.5
*painted*smoothed: on
last_selected_folder: Property
*colormap*nbcolors: 6
*colormap*standard*colors: 0 0 0 1 85 0 1 1 170 1 1 0 255 1 0 0 
}
PROPERTY_SUBCLASS 3 QUANTITY Float
PROP_ORIGINAL_UNIT 3 none
PROP_UNIT 3 unitless
PROP_NO_DATA_VALUE 3 -99999
PROP_SAMPLE_STATS 3 4328 3.122 0.229161 2.99996 5
PROP_ESIZE 3 4
PROP_ETYPE 3  IEEE
PROP_FORMAT 3 RAW
PROP_OFFSET 3 0
PROP_FILE 3 CVMHB-Los-Angeles-Basin_tag61_basin@@
END
andreasplesch commented 3 years ago

The dimensions of the voxet: image It should be possible to derive these dimensions from the voxet .vo header above.

Unfortunately, I do not think the current code takes into account the offset from AXIS_LABEL_MIN field.

Let's see:

- AXIS_O is origin of large CVMH voxet

Origin AXIS_OB of basin voxet is:

AXIS_O + AXIS_U/V * AXIS_MIN

eg: 131000 + 697000 * 0.314203739 = 350000

- U extremity AXIS_UMAXB  of basin voxet is:

AXIS_O + AXIS_U * AXIS_MAX

eg: 131000 + 697000 * 0.494978487 = 131000 + 345000 = 476000

- U cell size is:

( AXIS_UMAXB - AXIS_OB_U ) / ( AXIS_N_u - 1 ) = 

( 476000 - 350000 ) / ( 127-1 ) = 1000

or

( AXIS_MAX-AXIS_MIN ) * AXIS_U / ( AXIS_N_u - 1 ) = 

( 0.494978487 - 0.314203739 ) * 697000 / 126 =
0.180774748 * 697000 / 126 =
126000 / 126 = 1000

V and W are analoguous
andreasplesch commented 3 years ago

Here are validation points, as a zipped csv file: CVMHB-Los-Angeles-Basin.points.zip

andreasplesch commented 3 years ago

I generated a simpler .vo header which does not have these index offsets. The data@@ files are unchanged but the .vo file references different file names:

GOCAD Voxet 1 
HEADER {
name: CVMHB-Los-Angeles-Basin_fromBox
smoothed: on
use_private_colormaps: off
probe_type: Sections
size: 0 0 0 126 126 199
fence0: 3 1 2 0 0 0 126 126 199
nb_fences: 1
sections: 3 1 1 54 2 0 0 3 0 0
last_selected_folder: Info
*gname*size: 6
*painted*variable: vp63_basin
painted: on
VoxetIntersectionAssociation: off
*channel2*grid: 
ascii: off
}
GOCAD_ORIGINAL_COORDINATE_SYSTEM
NAME Default
PROJECTION Unknown
DATUM Unknown
AXIS_NAME X Y Z
AXIS_UNIT m m m
ZPOSITIVE Elevation
END_ORIGINAL_COORDINATE_SYSTEM
CLASSIFICATION "3D Survey" Seismic "3D Survey"
AXIS_O 350000 3650000 -15000 
AXIS_U 126000 0 0 
AXIS_V 0 126000 0 
AXIS_W 0 0 19900 
AXIS_MIN 0 0 0 
AXIS_MAX 1 1 1 
AXIS_N 127 127 200 
AXIS_NAME axis-1 axis-2 axis-3
AXIS_UNIT "unitless" "unitless" "unitless" 
AXIS_TYPE even even even

FLAGS_ARRAY_LENGTH 3225800 
FLAGS_BIT_LENGTH 9 
FLAGS_ESIZE 2 
FLAGS_OFFSET 0 
FLAGS_FILE CVMHB-Los-Angeles-Basin-fromBoxCVMHB-Los-Angeles-Basin_fromBox__flags@@

PROPERTY 1 vp63_basin
PROPERTY_CLASS 1 "compressional velocity"
PROPERTY_KIND 1 " Compressional Velocity" 
PROPERTY_CLASS_HEADER 1 " compressional velocity"  {
kind: Compressional Velocity
unit: m/s
low_clip: 1481
high_clip: 6000
last_selected_folder: Property
*colormap*reverse: true
colormap: Spectral
*colormap*low_clip_transparent: false
*colormap*nodata*transparency: 1
*colormap*nodata: false
*0ab04f59-d3024a8f-bf9a-3729ccf73408@48cb6cb3-af6c4309-9b02-37b461cc7880*colormap*use_intensity_colormap: false
*ba78d951-fbae4ab3-b364-daa6add90c0b@48cb6cb3-af6c4309-9b02-37b461cc7880*colormap*use_intensity_colormap: false

}
PROPERTY_SUBCLASS 1 QUANTITY Float
PROP_ORIGINAL_UNIT 1 none
PROP_UNIT 1 m/s
PROP_NO_DATA_VALUE 1 -99999
PROP_SAMPLE_STATS 1 4328 3276.28 723642 1565.98 5637.12
PROP_ESIZE 1 4
PROP_ETYPE 1  IEEE
PROP_PAINTED_FLAG_BIT_POS 1  6 
PROP_FORMAT 1 RAW
PROP_OFFSET 1 0
PROP_FILE 1 CVMHB-Los-Angeles-Basin-fromBoxCVMHB-Los-Angeles-Basin_fromBox_vp63_basin@@

PROPERTY 2 tag61_basin
PROPERTY_CLASS 2 tag61
PROPERTY_KIND 2 unknown
PROPERTY_CLASS_HEADER 2 tag61 {
kind: unknown
name: tag61
pclip: 99
unit: unitless
high_clip: 6.5
low_clip: 0.5
*painted*smoothed: on
last_selected_folder: Property
*colormap*nbcolors: 6
*colormap*standard*colors: 0 0 0 1 85 0 1 1 170 1 1 0 255 1 0 0 
}
PROPERTY_SUBCLASS 2 QUANTITY Float
PROP_ORIGINAL_UNIT 2 none
PROP_UNIT 2 unitless
PROP_NO_DATA_VALUE 2 -99999
PROP_SAMPLE_STATS 2 4328 3.122 0.229161 2.99996 5
PROP_ESIZE 2 4
PROP_ETYPE 2  IEEE
PROP_PAINTED_FLAG_BIT_POS 2  7 
PROP_FORMAT 2 RAW
PROP_OFFSET 2 0
PROP_FILE 2 CVMHB-Los-Angeles-Basin-fromBoxCVMHB-Los-Angeles-Basin_fromBox_tag61_basin@@

PROPERTY 3 vs63_basin
PROPERTY_CLASS 3 vs63
PROPERTY_KIND 3 unknown
PROPERTY_CLASS_HEADER 3 vs63 {
kind: unknown
name: vs63
low_clip: 0
high_clip: 5000
pclip: 99
colormap: flag
*colormap*nbcolors: 40
*colormap*reverse: true
unit: unitless
*colormap*flag*colors: 0 0 0 1 128 1 1 1 255 1 0 0 
}
PROPERTY_SUBCLASS 3 QUANTITY Float
PROP_ORIGINAL_UNIT 3 none
PROP_UNIT 3 unitless
PROP_NO_DATA_VALUE 3 -99999
PROP_SAMPLE_STATS 3 4328 1641.13 506382 177.57 3373.13
PROP_ESIZE 3 4
PROP_ETYPE 3  IEEE
PROP_PAINTED_FLAG_BIT_POS 3  8 
PROP_FORMAT 3 RAW
PROP_OFFSET 3 0
PROP_FILE 3 CVMHB-Los-Angeles-Basin-fromBoxCVMHB-Los-Angeles-Basin_fromBox_vs63_basin@@
END

CVMHB-Los-Angeles-Basin-fromBox.vo.zip

andreasplesch commented 3 years ago

od can dump voxet files:

$ od -v -tf4 -w4 --endian=big  CVMHB-Los-Angeles-Basin/CVMHB-Los-Angeles-Basin_vp63_basin@@  | more

It has now for a while a --endian option.

andreasplesch commented 3 years ago

Here a version which uses awk for the endian conversion:

$ od -v -tu1 -w4 | awk -b '{printf "%c%c%c%c",$5,$4,$3,$2}' | od -v -tf4 -w4

On my system I need now the -b option for binary processing.

andreasplesch commented 2 years ago

Two test points:

354000.000000,3756000.000000,-2000.000366,3326.486084,1695.246582

464000.000000,3662000.000000,-1900.000000,3438.379395,1791.699829

Red outline is the HR area:

image

andreasplesch commented 2 years ago

Depth slice at -1900 with additional test point (circled) at:

421000.000000 3712000.000000 -1906

image

The test point is outside the HR area and close to nodata.

The HR area also has nodata points.

meihuisu commented 2 years ago

https://github.com/SCECcode/cvmhbn