Scripts
scripts.inspect_cdf_file.inspect_cdf_file
inspect_cdf_file
Prints a formatted table of metadata for all variables in a CDF file.
This function opens a CDF (Common Data Format) file, retrieves key metadata for each variable, and presents it in a clear, human-readable table. The table includes the variable name, data type, units, data shape, fill value, and a description. This is useful for quickly understanding the contents and structure of a CDF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to the CDF file. |
required |
Raises:
| Type | Description |
|---|---|
CDFError
|
If the file is not a valid CDF file or an error occurs while reading it. |
Source code in scripts/inspect_cdf_file.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
scripts.submit_slurm_jobs.submit_slurm_jobs_in_chunks
submit_slurm_jobs_in_chunks
Submits HPC jobs in time-based chunks.
This function divides a specified time range into smaller intervals (daily,
monthly, or yearly) and submits a separate job for each interval to an HPC
cluster using the sbatch command. It assumes a job script template named
job_script_template.sh exists in the same directory. The chunk start and
end times are passed to the job script as command-line arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_time_str
|
str
|
The start of the time range, in a format parsable
by |
required |
end_time_str
|
str
|
The end of the time range, in a format parsable
by |
required |
chunk_type
|
ChunkType
|
The type of time chunk to use for job submission.
Valid options are |
required |
Raises:
| Type | Description |
|---|---|
CalledProcessError
|
If an |
Source code in scripts/submit_slurm_jobs.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |